use of org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.services.Iec61850DeviceResponseHandler in project open-smart-grid-platform by OSGP.
the class MicrogridsSetDataRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) throws JMSException {
LOGGER.info("Processing microgrids set data request message");
MessageMetadata messageMetadata;
SetDataRequestDto setDataRequest;
try {
messageMetadata = MessageMetadata.fromMessage(message);
setDataRequest = (SetDataRequestDto) message.getObject();
} catch (final JMSException e) {
LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
return;
}
final RequestMessageData requestMessageData = RequestMessageData.newBuilder().messageMetadata(messageMetadata).build();
this.printDomainInfo(requestMessageData);
final Iec61850DeviceResponseHandler iec61850DeviceResponseHandler = this.createIec61850DeviceResponseHandler(requestMessageData, message);
final DeviceRequest.Builder deviceRequestBuilder = DeviceRequest.newBuilder().messageMetaData(messageMetadata);
this.deviceService.setData(new SetDataDeviceRequest(deviceRequestBuilder, setDataRequest), iec61850DeviceResponseHandler);
}
use of org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.services.Iec61850DeviceResponseHandler in project open-smart-grid-platform by OSGP.
the class CommonGetFirmwareRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) throws JMSException {
LOGGER.debug("Processing common get firmware request message");
final MessageMetadata messageMetadata;
try {
messageMetadata = MessageMetadata.fromMessage(message);
} catch (final JMSException e) {
LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
return;
}
final RequestMessageData requestMessageData = RequestMessageData.newBuilder().messageMetadata(messageMetadata).build();
this.printDomainInfo(requestMessageData);
final Iec61850DeviceResponseHandler iec61850DeviceResponseHandler = this.createIec61850DeviceResponseHandler(requestMessageData, message);
final DeviceRequest deviceRequest = DeviceRequest.newBuilder().messageMetaData(messageMetadata).build();
this.deviceService.getFirmwareVersion(deviceRequest, iec61850DeviceResponseHandler);
}
use of org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.services.Iec61850DeviceResponseHandler in project open-smart-grid-platform by OSGP.
the class CommonSetEventNotificationsRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) throws JMSException {
LOGGER.debug("Processing common set event notifications request message");
MessageMetadata messageMetadata;
EventNotificationMessageDataContainerDto eventNotificationsContainer;
try {
messageMetadata = MessageMetadata.fromMessage(message);
eventNotificationsContainer = (EventNotificationMessageDataContainerDto) message.getObject();
} catch (final JMSException e) {
LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
return;
}
final RequestMessageData requestMessageData = RequestMessageData.newBuilder().messageMetadata(messageMetadata).build();
this.printDomainInfo(requestMessageData);
final Iec61850DeviceResponseHandler iec61850DeviceResponseHandler = this.createIec61850DeviceResponseHandler(requestMessageData, message);
final DeviceRequest.Builder deviceRequestBuilder = DeviceRequest.newBuilder().messageMetaData(messageMetadata);
this.deviceService.setEventNotifications(new SetEventNotificationsDeviceRequest(deviceRequestBuilder, eventNotificationsContainer), iec61850DeviceResponseHandler);
}
use of org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.services.Iec61850DeviceResponseHandler in project open-smart-grid-platform by OSGP.
the class CommonStopDeviceTestRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) throws JMSException {
LOGGER.debug("Processing common stop device test request message");
MessageMetadata messageMetadata;
try {
messageMetadata = MessageMetadata.fromMessage(message);
} catch (final JMSException e) {
LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
return;
}
final RequestMessageData requestMessageData = RequestMessageData.newBuilder().messageMetadata(messageMetadata).build();
this.printDomainInfo(requestMessageData);
final Iec61850DeviceResponseHandler iec61850DeviceResponseHandler = this.createIec61850DeviceResponseHandler(requestMessageData, message);
final DeviceRequest deviceRequest = DeviceRequest.newBuilder().messageMetaData(messageMetadata).build();
// This is a stop self-test, so startOfTest == false.
this.deviceService.runSelfTest(deviceRequest, iec61850DeviceResponseHandler, false);
}
use of org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.services.Iec61850DeviceResponseHandler in project open-smart-grid-platform by OSGP.
the class CommonUpdateFirmwareRequestMessageProcessor method processMessage.
@Override
public void processMessage(final ObjectMessage message) throws JMSException {
LOGGER.debug("Processing common update firmware request message");
MessageMetadata messageMetadata;
FirmwareUpdateMessageDataContainer firmwareUpdateMessageDataContainer;
try {
messageMetadata = MessageMetadata.fromMessage(message);
firmwareUpdateMessageDataContainer = (FirmwareUpdateMessageDataContainer) message.getObject();
} catch (final JMSException e) {
LOGGER.error("UNRECOVERABLE ERROR, unable to read ObjectMessage instance, giving up.", e);
return;
}
final RequestMessageData requestMessageData = RequestMessageData.newBuilder().messageMetadata(messageMetadata).build();
this.printDomainInfo(requestMessageData);
final Iec61850DeviceResponseHandler iec61850DeviceResponseHandler = this.createIec61850DeviceResponseHandler(requestMessageData, message);
final DeviceRequest.Builder deviceRequestBuilder = DeviceRequest.newBuilder().messageMetaData(messageMetadata);
this.deviceService.updateFirmware(new UpdateFirmwareDeviceRequest(deviceRequestBuilder, this.firmwareLocation.getDomain(), this.firmwareLocation.getFullPath(firmwareUpdateMessageDataContainer.getFirmwareUrl()), firmwareUpdateMessageDataContainer.getFirmwareModuleData()), iec61850DeviceResponseHandler);
}
Aggregations