Search in sources :

Example 1 with GetStatusRequest

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();
}
Also used : GetStatusRequest(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusRequest) GetStatusAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusAsyncResponse) WebServiceTemplate(org.springframework.ws.client.core.WebServiceTemplate)

Example 2 with GetStatusRequest

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));
}
Also used : GetStatusRequest(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusRequest)

Example 3 with GetStatusRequest

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);
    }
}
Also used : GetStatusRequest(org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusRequest) SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) When(io.cucumber.java.en.When)

Aggregations

GetStatusRequest (org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusRequest)3 When (io.cucumber.java.en.When)1 GetStatusAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.GetStatusAsyncResponse)1 WebServiceTemplate (org.springframework.ws.client.core.WebServiceTemplate)1 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)1