use of org.opensmartgridplatform.adapter.protocol.oslp.elster.device.responses.EmptyDeviceResponse in project open-smart-grid-platform 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);
final 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(), deviceRequest.getMessagePriority(), status);
deviceResponseHandler.handleResponse(deviceResponse);
}
Aggregations