use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusRequest in project open-smart-grid-platform by OSGP.
the class OsgpPublicLightingClientSoapService method getDeviceStatus.
/**
* Creates a getDeviceStatus request with the parameter deviceId. Sends it to the Platform using a
* WebServiceTemplate.
*
* <p>Returns the CorrelationId response from the platform.
*/
public String getDeviceStatus(final String deviceId) {
final WebServiceTemplate requestTemplate = this.soapRequestHelper.createPublicLightingRequest();
final GetStatusRequest request = new GetStatusRequest();
request.setDeviceIdentification(deviceId);
GetStatusAsyncResponse asyncStatusResponse = null;
asyncStatusResponse = (GetStatusAsyncResponse) requestTemplate.marshalSendAndReceive(request);
return asyncStatusResponse.getAsyncResponse().getCorrelationUid();
}
use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusRequest in project open-smart-grid-platform by OSGP.
the class AuthorizeDeviceFunctionsSteps method getLightStatus.
private void getLightStatus(final Map<String, String> requestParameters) throws WebServiceSecurityException, GeneralSecurityException, IOException {
final GetStatusRequest request = new GetStatusRequest();
request.setDeviceIdentification(getString(requestParameters, PlatformPubliclightingKeys.KEY_DEVICE_IDENTIFICATION, PlatformPubliclightingDefaults.DEFAULT_DEVICE_IDENTIFICATION));
ScenarioContext.current().put(PlatformPubliclightingKeys.RESPONSE, this.publicLightingAdHocManagementClient.getStatus(request));
}
use of org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusRequest in project open-smart-grid-platform by OSGP.
the class GetStatusSteps method receivingAGetStatusRequest.
/**
* Sends a Get Status request to the platform for a given device identification.
*
* @param requestParameters The table with the request parameters.
* @throws WebServiceSecurityException
*/
@When("^receiving a get status request$")
public void receivingAGetStatusRequest(final Map<String, String> requestParameters) throws WebServiceSecurityException {
final GetStatusRequest request = new GetStatusRequest();
request.setDeviceIdentification(getString(requestParameters, PlatformPubliclightingKeys.KEY_DEVICE_IDENTIFICATION, PlatformPubliclightingDefaults.DEFAULT_DEVICE_IDENTIFICATION));
try {
ScenarioContext.current().put(PlatformPubliclightingKeys.RESPONSE, this.publicLightingClient.getStatus(request));
} catch (final SoapFaultClientException ex) {
ScenarioContext.current().put(PlatformPubliclightingKeys.RESPONSE, ex);
}
}
Aggregations