use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method getUpdateFirmwareResponse.
@PayloadRoot(localPart = "UpdateFirmwareAsyncRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.UpdateFirmwareResponse getUpdateFirmwareResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final UpdateFirmwareAsyncRequest request) throws OsgpException {
log.info("GetUpdateFirmwareResponse Request received from organisation {} for device: {}.", organisationIdentification, request.getDeviceIdentification());
UpdateFirmwareResponse response = null;
try {
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
this.throwExceptionIfResultNotOk(responseData, "updating firmware");
response = new UpdateFirmwareResponse();
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method getSetPushSetupAlarmResponse.
@PayloadRoot(localPart = "SetPushSetupAlarmAsyncRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetPushSetupAlarmResponse getSetPushSetupAlarmResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetPushSetupAlarmAsyncRequest request) throws OsgpException {
log.info("Incoming SetPushSetupAlarmAsyncRequest for organisation {} for meter: {}.", organisationIdentification, request.getDeviceIdentification());
SetPushSetupAlarmResponse response = null;
try {
response = new SetPushSetupAlarmResponse();
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
if (responseData.getMessageData() instanceof String) {
response.setDescription((String) responseData.getMessageData());
}
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method getConfigureDefinableLoadProfileResponse.
@PayloadRoot(localPart = "ConfigureDefinableLoadProfileAsyncRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public ConfigureDefinableLoadProfileResponse getConfigureDefinableLoadProfileResponse(@RequestPayload final ConfigureDefinableLoadProfileAsyncRequest request) throws OsgpException {
ConfigureDefinableLoadProfileResponse response = null;
try {
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
response = new ConfigureDefinableLoadProfileResponse();
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
if (responseData.getMessageData() instanceof String) {
response.setDescription((String) responseData.getMessageData());
}
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method retrieveGetAdministrativeStatusResponse.
@PayloadRoot(localPart = "GetAdministrativeStatusAsyncRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GetAdministrativeStatusResponse retrieveGetAdministrativeStatusResponse(@RequestPayload final GetAdministrativeStatusAsyncRequest request) throws OsgpException {
GetAdministrativeStatusResponse response = null;
try {
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
this.throwExceptionIfResultNotOk(responseData, "retrieving the administrative status");
response = new GetAdministrativeStatusResponse();
final AdministrativeStatusType dataRequest = this.configurationMapper.map(responseData.getMessageData(), AdministrativeStatusType.class);
response.setEnabled(dataRequest);
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.
the class SmartMeteringInstallationEndpoint method getAddDeviceResponse.
@PayloadRoot(localPart = "AddDeviceAsyncRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public AddDeviceResponse getAddDeviceResponse(@RequestPayload final AddDeviceAsyncRequest request) throws OsgpException {
AddDeviceResponse response = null;
try {
response = new AddDeviceResponse();
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
this.throwExceptionIfResultNotOk(responseData, "Add Device");
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
if (responseData.getMessageData() instanceof String) {
response.setDescription((String) responseData.getMessageData());
}
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
Aggregations