use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileRequest in project open-smart-grid-platform by OSGP.
the class PowerQualityProfileSteps method theGetPowerQualityProfileRequestDataIsReceived.
@When("^the get power quality profile request data is received$")
public void theGetPowerQualityProfileRequestDataIsReceived(final Map<String, String> settings) throws Throwable {
final GetPowerQualityProfileRequest request = GetPowerQualityProfileRequestFactory.fromParameterMap(settings);
final GetPowerQualityProfileAsyncResponse asyncResponse = this.requestClient.doRequest(request);
assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileRequest in project open-smart-grid-platform by OSGP.
the class GetPowerQualityProfileRequestFactory method fromParameterMap.
public static GetPowerQualityProfileRequest fromParameterMap(final Map<String, String> requestParameters) {
final GetPowerQualityProfileRequest getPowerQualityProfileRequestData = new GetPowerQualityProfileRequest();
final DateTime beginDate = dateFromParameterMap(requestParameters, PlatformKeys.KEY_BEGIN_DATE);
final DateTime endDate = dateFromParameterMap(requestParameters, PlatformKeys.KEY_END_DATE);
final String profileType = getString(requestParameters, PlatformKeys.KEY_POWER_QUALITY_PROFILE_TYPE);
final CaptureObjectDefinitions captureObjecDefinitions = CaptureObjectDefinitionsFactory.fromParameterMap(requestParameters);
getPowerQualityProfileRequestData.setDeviceIdentification(requestParameters.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
getPowerQualityProfileRequestData.setBeginDate(DateConverter.createXMLGregorianCalendar(beginDate.toDate()));
getPowerQualityProfileRequestData.setEndDate(DateConverter.createXMLGregorianCalendar(endDate.toDate()));
getPowerQualityProfileRequestData.setProfileType(profileType);
getPowerQualityProfileRequestData.setSelectedValues(captureObjecDefinitions);
return getPowerQualityProfileRequestData;
}
Aggregations