use of org.opensmartgridplatform.adapter.ws.schema.core.configurationmanagement.SwitchConfigurationResponse in project open-smart-grid-platform by OSGP.
the class ConfigurationManagementEndpoint method getSwitchConfigurationResponse.
@PayloadRoot(localPart = "SwitchConfigurationAsyncRequest", namespace = NAMESPACE)
@ResponsePayload
public SwitchConfigurationResponse getSwitchConfigurationResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SwitchConfigurationAsyncRequest request) throws OsgpException {
LOGGER.info("Switch Configuration Async Request received from organisation: {} for device: {}.", organisationIdentification, request.getAsyncRequest().getDeviceId());
final SwitchConfigurationResponse response = new SwitchConfigurationResponse();
try {
final ResponseMessage responseMessage = this.getResponseMessage(request.getAsyncRequest());
if (responseMessage != null) {
throwExceptionIfResultNotOk(responseMessage, "switching configuration");
response.setResult(OsgpResultType.fromValue(responseMessage.getResult().getValue()));
} else {
LOGGER.debug("Get Configuration data is null");
}
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
Aggregations