Search in sources :

Example 1 with SwitchConfigurationBankRequest

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

the class CommonSwitchConfigurationRequestMessageProcessor method processMessage.

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

Aggregations

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