Search in sources :

Example 1 with SetDeviceVerificationKeyDeviceRequest

use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.requests.SetDeviceVerificationKeyDeviceRequest in project open-smart-grid-platform by OSGP.

the class CommonSetDeviceVerificationKeyRequestMessageProcessor method processMessage.

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing common Set device verification key message");
    MessageMetadata messageMetadata;
    String verificationKey;
    try {
        messageMetadata = MessageMetadata.fromMessage(message);
        verificationKey = (String) message.getObject();
    } catch (final JMSException e) {
        LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
        return;
    }
    this.printDomainInfo(messageMetadata.getMessageType(), messageMetadata.getDomain(), messageMetadata.getDomainVersion());
    final SetDeviceVerificationKeyDeviceRequest deviceRequest = new SetDeviceVerificationKeyDeviceRequest(DeviceRequest.newBuilder().messageMetaData(messageMetadata), verificationKey);
    this.deviceService.setDeviceVerificationKey(deviceRequest);
}
Also used : MessageMetadata(org.opensmartgridplatform.shared.infra.jms.MessageMetadata) SetDeviceVerificationKeyDeviceRequest(org.opensmartgridplatform.adapter.protocol.oslp.elster.device.requests.SetDeviceVerificationKeyDeviceRequest) JMSException(javax.jms.JMSException)

Aggregations

JMSException (javax.jms.JMSException)1 SetDeviceVerificationKeyDeviceRequest (org.opensmartgridplatform.adapter.protocol.oslp.elster.device.requests.SetDeviceVerificationKeyDeviceRequest)1 MessageMetadata (org.opensmartgridplatform.shared.infra.jms.MessageMetadata)1