use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method handleOslpResponseResumeSchedule.
private void handleOslpResponseResumeSchedule(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasResumeScheduleResponse()) {
final Oslp.Status oslpStatus = oslpResponse.getPayloadMessage().getResumeScheduleResponse().getStatus();
status = this.mapper.map(oslpStatus, DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
final DeviceResponse deviceResponse = new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method buildDeviceResponseSwitchConfiguration.
private DeviceResponse buildDeviceResponseSwitchConfiguration(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse) {
DeviceMessageStatus status = null;
if (oslpResponse.getPayloadMessage().hasSwitchConfigurationResponse()) {
final Oslp.SwitchConfigurationResponse switchConfigurationResponse = oslpResponse.getPayloadMessage().getSwitchConfigurationResponse();
status = this.mapper.map(switchConfigurationResponse.getStatus(), DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
return new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), status);
}
use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method buildDeviceResponseSwitchFirmware.
private DeviceResponse buildDeviceResponseSwitchFirmware(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse) {
DeviceMessageStatus status = null;
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(), status);
}
Aggregations