use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.requests.SetEventNotificationsDeviceRequest in project open-smart-grid-platform by OSGP.
the class CommonSetEventNotificationsRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) {
LOGGER.debug("Processing common set event notifications request message");
MessageMetadata messageMetadata;
EventNotificationMessageDataContainerDto eventNotificationMessageDataContainer;
try {
messageMetadata = MessageMetadata.fromMessage(message);
eventNotificationMessageDataContainer = (EventNotificationMessageDataContainerDto) message.getObject();
} catch (final JMSException e) {
LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
return;
}
try {
this.printDomainInfo(messageMetadata.getMessageType(), messageMetadata.getDomain(), messageMetadata.getDomainVersion());
final SetEventNotificationsDeviceRequest deviceRequest = new SetEventNotificationsDeviceRequest(DeviceRequest.newBuilder().messageMetaData(messageMetadata), eventNotificationMessageDataContainer);
this.deviceService.setEventNotifications(deviceRequest);
} catch (final RuntimeException e) {
this.handleError(e, messageMetadata);
}
}
Aggregations