use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.requests.SetTransitionDeviceRequest in project open-smart-grid-platform by OSGP.
the class PublicLightingSetTransitionRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) {
LOGGER.debug("Processing public lighting set transition request message");
MessageMetadata messageMetadata;
TransitionMessageDataContainerDto transitionMessageDataContainer;
try {
messageMetadata = MessageMetadata.fromMessage(message);
transitionMessageDataContainer = (TransitionMessageDataContainerDto) 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 SetTransitionDeviceRequest deviceRequest = new SetTransitionDeviceRequest(DeviceRequest.newBuilder().messageMetaData(messageMetadata), transitionMessageDataContainer);
this.deviceService.setTransition(deviceRequest);
} catch (final RuntimeException e) {
this.handleError(e, messageMetadata);
}
}
Aggregations