use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceResponse in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method handleOslpResponseSetScheduleSingle.
private void handleOslpResponseSetScheduleSingle(final SetScheduleDeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
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(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceResponse in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method handleOslpResponseSetDeviceVerificationKey.
private void handleOslpResponseSetDeviceVerificationKey(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
final DeviceResponse deviceResponse = this.buildDeviceResponseSetDeviceVerificationKey(deviceRequest, oslpResponse);
deviceResponseHandler.handleResponse(deviceResponse);
}
use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceResponse in project Protocol-Adapter-OSLP 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);
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(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceResponse in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method handleOslpResponseUpdateFirmware.
private void handleOslpResponseUpdateFirmware(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasUpdateFirmwareResponse()) {
final Oslp.Status oslpStatus = oslpResponse.getPayloadMessage().getUpdateFirmwareResponse().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.DeviceResponse in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method handleOslpResponseGetFirmwareVersion.
private void handleOslpResponseGetFirmwareVersion(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
String firmwareVersion = "";
if (oslpResponse.getPayloadMessage().hasGetFirmwareVersionResponse()) {
firmwareVersion = oslpResponse.getPayloadMessage().getGetFirmwareVersionResponse().getFirmwareVersion();
}
final DeviceResponse deviceResponse = new GetFirmwareVersionDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), firmwareVersion);
deviceResponseHandler.handleResponse(deviceResponse);
}
Aggregations