use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.SetLightRequest in project open-smart-grid-platform by OSGP.
the class OsgpPublicLightingClientSoapService method switchLightRequest.
/**
* Creates a SetLight request using the parameters deviceId and lightOn. Sends the request to the
* platform using the WebServiceTemplate.
*
* <p>Returns the CorrelationId response from the Platform.
*/
public String switchLightRequest(final String deviceId, final boolean lightOn) {
final SetLightRequest request = new SetLightRequest();
final LightValue lightValue = new LightValue();
lightValue.setOn(lightOn);
final WebServiceTemplate template = this.soapRequestHelper.createPublicLightingRequest();
request.setDeviceIdentification(deviceId);
request.getLightValue().add(lightValue);
final SetLightAsyncResponse response = (SetLightAsyncResponse) template.marshalSendAndReceive(request);
return response.getAsyncResponse().getCorrelationUid();
}
Aggregations