Search in sources :

Example 1 with SwitchFirmwareDeviceRequest

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

the class CommonSwitchFirmwareRequestMessageProcessor method processMessage.

@Override
public void processMessage(final ObjectMessage message) {
    LOGGER.debug("Processing common switch firmware message");
    MessageMetadata messageMetadata;
    String version;
    try {
        messageMetadata = MessageMetadata.fromMessage(message);
        version = (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 SwitchFirmwareDeviceRequest deviceRequest = new SwitchFirmwareDeviceRequest(DeviceRequest.newBuilder().messageMetaData(messageMetadata), version);
    this.deviceService.switchFirmware(deviceRequest);
}
Also used : MessageMetadata(org.opensmartgridplatform.shared.infra.jms.MessageMetadata) SwitchFirmwareDeviceRequest(org.opensmartgridplatform.adapter.protocol.oslp.elster.device.requests.SwitchFirmwareDeviceRequest) JMSException(javax.jms.JMSException)

Aggregations

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