use of org.opensmartgridplatform.adapter.ws.schema.tariffswitching.adhocmanagement.GetStatusResponse in project open-smart-grid-platform by OSGP.
the class TariffSwitchingAdHocManagementEndpoint method getGetStatusResponse.
@PayloadRoot(localPart = "GetStatusAsyncRequest", namespace = NAMESPACE)
@ResponsePayload
public GetStatusResponse getGetStatusResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetStatusAsyncRequest request) throws OsgpException {
LOGGER.info("Get Status Response received from organisation: {} for correlationUid: {}.", organisationIdentification, request.getAsyncRequest().getCorrelationUid());
final GetStatusResponse response = new GetStatusResponse();
try {
final ResponseMessage message = this.adHocManagementService.dequeueGetTariffStatusResponse(request.getAsyncRequest().getCorrelationUid());
if (message != null) {
response.setResult(OsgpResultType.fromValue(message.getResult().getValue()));
final DeviceStatusMapped deviceStatus = (DeviceStatusMapped) message.getDataObject();
if (deviceStatus != null) {
response.setDeviceStatus(this.adHocManagementMapper.map(deviceStatus, org.opensmartgridplatform.adapter.ws.schema.tariffswitching.adhocmanagement.DeviceStatus.class));
}
}
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
Aggregations