use of com.alliander.osgp.adapter.protocol.oslp.elster.device.DeviceMessageStatus in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method handleOslpResponseSetTransition.
private void handleOslpResponseSetTransition(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse, final DeviceResponseHandler deviceResponseHandler) {
this.saveOslpResponseLogEntry(deviceRequest, oslpResponse);
this.updateSequenceNumber(deviceRequest.getDeviceIdentification(), oslpResponse);
DeviceMessageStatus status;
if (oslpResponse.getPayloadMessage().hasSetTransitionResponse()) {
final Oslp.Status oslpStatus = oslpResponse.getPayloadMessage().getSetTransitionResponse().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 buildDeviceResponseSetDeviceVerificationKey.
private DeviceResponse buildDeviceResponseSetDeviceVerificationKey(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse) {
DeviceMessageStatus status = null;
if (oslpResponse.getPayloadMessage().hasSetDeviceVerificationKeyResponse()) {
final Oslp.SetDeviceVerificationKeyResponse setDeviceVerificationKeyResponse = oslpResponse.getPayloadMessage().getSetDeviceVerificationKeyResponse();
status = this.mapper.map(setDeviceVerificationKeyResponse.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 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.DeviceMessageStatus 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.DeviceMessageStatus in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method buildDeviceResponseUpdateDeviceSslCertification.
private DeviceResponse buildDeviceResponseUpdateDeviceSslCertification(final DeviceRequest deviceRequest, final OslpEnvelope oslpResponse) {
DeviceMessageStatus status = null;
if (oslpResponse.getPayloadMessage().hasUpdateDeviceSslCertificationResponse()) {
final Oslp.UpdateDeviceSslCertificationResponse updateDeviceSslCertificationResponse = oslpResponse.getPayloadMessage().getUpdateDeviceSslCertificationResponse();
status = this.mapper.map(updateDeviceSslCertificationResponse.getStatus(), DeviceMessageStatus.class);
} else {
status = DeviceMessageStatus.FAILURE;
}
return new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), status);
}
Aggregations