use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileAsyncResponse 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.GetPowerQualityProfileAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringMonitoringEndpoint method getGetPowerQualityProfile.
@PayloadRoot(localPart = "GetPowerQualityProfileRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public GetPowerQualityProfileAsyncResponse getGetPowerQualityProfile(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetPowerQualityProfileRequest request, @MessagePriority final String messagePriority, @ResponseUrl final String responseUrl, @ScheduleTime final String scheduleTime, @BypassRetry final String bypassRetry) throws OsgpException {
final GetPowerQualityProfileRequest requestData = this.monitoringMapper.map(request, GetPowerQualityProfileRequest.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_PROFILE_GENERIC_DATA).withMessageType(MessageType.GET_PROFILE_GENERIC_DATA).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, requestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.monitoringMapper.map(asyncResponse, GetPowerQualityProfileAsyncResponse.class);
}
Aggregations