Search in sources :

Example 1 with OslpEnvelopeProcessor

use of org.opensmartgridplatform.adapter.protocol.oslp.elster.infra.messaging.OslpEnvelopeProcessor in project open-smart-grid-platform by OSGP.

the class OslpSigningService method handleSignedOslpRequest.

private void handleSignedOslpRequest(final SignedOslpEnvelopeDto signedOslpEnvelopeDto, final String deviceIdentification) {
    final OslpEnvelope oslpEnvelope = signedOslpEnvelopeDto.getOslpEnvelope();
    final UnsignedOslpEnvelopeDto unsignedOslpEnvelopeDto = signedOslpEnvelopeDto.getUnsignedOslpEnvelopeDto();
    // Handle OSLP request message.
    LOGGER.debug(LINES);
    LOGGER.info("oslpEnvelope.size: {} for message type: {}", oslpEnvelope.getSize(), unsignedOslpEnvelopeDto.getMessageType());
    LOGGER.debug(LINES);
    LOGGER.debug("unsignedOslpEnvelopeDto.getCorrelationUid() : {}", unsignedOslpEnvelopeDto.getCorrelationUid());
    LOGGER.debug("unsignedOslpEnvelopeDto.getDeviceId() : {}", unsignedOslpEnvelopeDto.getDeviceId());
    LOGGER.debug("unsignedOslpEnvelopeDto.getDomain() : {}", unsignedOslpEnvelopeDto.getDomain());
    LOGGER.debug("unsignedOslpEnvelopeDto.getDomainVersion() : {}", unsignedOslpEnvelopeDto.getDomainVersion());
    LOGGER.debug("unsignedOslpEnvelopeDto.getIpAddress() : {}", unsignedOslpEnvelopeDto.getIpAddress());
    LOGGER.debug("unsignedOslpEnvelopeDto.getMessageType() : {}", unsignedOslpEnvelopeDto.getMessageType());
    LOGGER.debug("unsignedOslpEnvelopeDto.getMessagePriority() : {}", unsignedOslpEnvelopeDto.getMessagePriority());
    LOGGER.debug("unsignedOslpEnvelopeDto.getOrganisationIdentification() : {}", unsignedOslpEnvelopeDto.getOrganisationIdentification());
    LOGGER.debug("unsignedOslpEnvelopeDto.getPayloadMessage() : {}", unsignedOslpEnvelopeDto.getPayloadMessage().toString());
    LOGGER.debug("unsignedOslpEnvelopeDto.getRetryCount() : {}", unsignedOslpEnvelopeDto.getRetryCount());
    LOGGER.debug("unsignedOslpEnvelopeDto.getSequenceNumber() : {}", unsignedOslpEnvelopeDto.getSequenceNumber());
    LOGGER.debug("unsignedOslpEnvelopeDto.isScheduled() : {}", unsignedOslpEnvelopeDto.isScheduled());
    LOGGER.debug(LINES);
    final MessageType messageType = MessageType.valueOf(unsignedOslpEnvelopeDto.getMessageType());
    // Handle message for message type.
    final OslpEnvelopeProcessor messageProcessor = this.deviceRequestMessageProcessorMap.getOslpEnvelopeProcessor(messageType);
    if (messageProcessor == null) {
        LOGGER.error("No message processor for messageType: {}", unsignedOslpEnvelopeDto.getMessageType());
        return;
    }
    messageProcessor.processSignedOslpEnvelope(deviceIdentification, signedOslpEnvelopeDto);
}
Also used : OslpEnvelopeProcessor(org.opensmartgridplatform.adapter.protocol.oslp.elster.infra.messaging.OslpEnvelopeProcessor) UnsignedOslpEnvelopeDto(org.opensmartgridplatform.oslp.UnsignedOslpEnvelopeDto) MessageType(org.opensmartgridplatform.shared.infra.jms.MessageType) OslpEnvelope(org.opensmartgridplatform.oslp.OslpEnvelope)

Aggregations

OslpEnvelopeProcessor (org.opensmartgridplatform.adapter.protocol.oslp.elster.infra.messaging.OslpEnvelopeProcessor)1 OslpEnvelope (org.opensmartgridplatform.oslp.OslpEnvelope)1 UnsignedOslpEnvelopeDto (org.opensmartgridplatform.oslp.UnsignedOslpEnvelopeDto)1 MessageType (org.opensmartgridplatform.shared.infra.jms.MessageType)1