use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project open-smart-grid-platform by OSGP.
the class OslpDeviceService method handleOslpResponseSetEventNotifications.
private void handleOslpResponseSetEventNotifications(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
final DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasSetEventNotificationsResponse()) {
final Oslp.Status oslpStatus = oslpResponse.getPayloadMessage().getSetEventNotificationsResponse().getStatus();
status = this.mapper.map(oslpStatus, DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
final DeviceResponse deviceResponse = new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), deviceRequest.getMessagePriority(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project open-smart-grid-platform by OSGP.
the class OslpDeviceService method handleOslpResponseStartSelfTest.
private void handleOslpResponseStartSelfTest(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
final DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasStartSelfTestResponse()) {
final Oslp.Status oslpStatus = oslpResponse.getPayloadMessage().getStartSelfTestResponse().getStatus();
status = this.mapper.map(oslpStatus, DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
final DeviceResponse deviceResponse = new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), deviceRequest.getMessagePriority(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project open-smart-grid-platform by OSGP.
the class OslpDeviceService method buildDeviceResponseSwitchFirmware.
private DeviceResponse buildDeviceResponseSwitchFirmware(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse) {
final DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasSwitchFirmwareResponse()) {
final Oslp.SwitchFirmwareResponse switchFirmwareResponse = oslpResponse.getPayloadMessage().getSwitchFirmwareResponse();
status = this.mapper.map(switchFirmwareResponse.getStatus(), DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
return new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), deviceRequest.getMessagePriority(), status);
}
use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project open-smart-grid-platform by OSGP.
the class OslpDeviceService method handleOslpResponseSetScheduleSingle.
private void handleOslpResponseSetScheduleSingle(final SetScheduleDeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
final DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasSetScheduleResponse()) {
final Oslp.Status oslpStatus = oslpResponse.getPayloadMessage().getSetScheduleResponse().getStatus();
status = this.mapper.map(oslpStatus, DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
final DeviceResponse deviceResponse = new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), deviceRequest.getMessagePriority(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project open-smart-grid-platform by OSGP.
the class OslpDeviceService method handleOslpResponseSetReboot.
private void handleOslpResponseSetReboot(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
final DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasSetRebootResponse()) {
final Oslp.Status oslpStatus = oslpResponse.getPayloadMessage().getSetRebootResponse().getStatus();
status = this.mapper.map(oslpStatus, DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
final DeviceResponse deviceResponse = new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), deviceRequest.getMessagePriority(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
Aggregations