Search in sources :

Example 1 with SetDataRequest

use of org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataRequest in project open-smart-grid-platform by OSGP.

the class SetDataRequestBuilder method fromParameterMap.

public static SetDataRequest fromParameterMap(final Map<String, String> requestParameters) {
    final SetDataRequest setDataRequest = new SetDataRequest();
    setDataRequest.setDeviceIdentification(requestParameters.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
    final List<SetDataSystemIdentifier> systems = new SetDataSystemIdentifierBuilder().withSettings(requestParameters).buildList();
    setDataRequest.getSystem().addAll(systems);
    return setDataRequest;
}
Also used : SetDataRequest(org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataRequest) SetDataSystemIdentifier(org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataSystemIdentifier)

Example 2 with SetDataRequest

use of org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataRequest in project open-smart-grid-platform by OSGP.

the class SetDataSteps method aSetDataRequestIsReceived.

@When("^a set data request is received$")
public void aSetDataRequestIsReceived(final Map<String, String> requestParameters) throws Throwable {
    final String organizationIdentification = (String) ScenarioContext.current().get(PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION, PlatformDefaults.DEFAULT_ORGANIZATION_IDENTIFICATION);
    ScenarioContext.current().put(PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION, organizationIdentification);
    final String userName = (String) ScenarioContext.current().get(PlatformKeys.KEY_USER_NAME, PlatformDefaults.DEFAULT_USER_NAME);
    ScenarioContext.current().put(PlatformKeys.KEY_USER_NAME, userName);
    final SetDataRequest setDataRequest = SetDataRequestBuilder.fromParameterMap(requestParameters);
    final SetDataAsyncResponse response = this.client.setDataAsync(setDataRequest);
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, response.getAsyncResponse().getCorrelationUid());
}
Also used : SetDataAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataAsyncResponse) SetDataRequest(org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataRequest) When(io.cucumber.java.en.When)

Aggregations

SetDataRequest (org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataRequest)2 When (io.cucumber.java.en.When)1 SetDataAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataAsyncResponse)1 SetDataSystemIdentifier (org.opensmartgridplatform.adapter.ws.schema.microgrids.adhocmanagement.SetDataSystemIdentifier)1