use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringMonitoringEndpoint method getActualMeterReadsGas.
@PayloadRoot(localPart = "ActualMeterReadsGasRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public ActualMeterReadsGasAsyncResponse getActualMeterReadsGas(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ActualMeterReadsGasRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualMeterReadsQuery requestData = new org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualMeterReadsQuery(true);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.REQUEST_ACTUAL_METER_DATA).withMessageType(MessageType.REQUEST_ACTUAL_METER_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, ActualMeterReadsGasAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse in project open-smart-grid-platform by OSGP.
the class ActualMeterReadsGasSteps method theGetActualMeterReadsRequestIsReceived.
@When("^the get actual meter reads gas request is received$")
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable {
final ActualMeterReadsGasRequest request = ActualMeterReadsGasRequestFactory.fromParameterMap(settings);
final ActualMeterReadsGasAsyncResponse 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.ActualMeterReadsGasAsyncResponse in project open-smart-grid-platform by OSGP.
the class FunctionalExceptionsSteps method theGetActualMeterReadsGasRequestGeneratingAnErrorIsReceived.
@When("^the get actual meter reads gas request generating an error is received$")
public void theGetActualMeterReadsGasRequestGeneratingAnErrorIsReceived(final Map<String, String> requestData) throws Throwable {
final ActualMeterReadsGasRequest request = ActualMeterReadsGasRequestFactory.fromParameterMap(requestData);
final ActualMeterReadsGasAsyncResponse asyncResponse = this.actualMeterReadsGasRequestClient.doRequest(request);
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
final ActualMeterReadsGasAsyncRequest asyncRequest = ActualMeterReadsGasRequestFactory.fromScenarioContext();
try {
this.actualMeterReadsGasResponseClient.getResponse(asyncRequest);
} catch (final Exception exception) {
ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
}
}
Aggregations