use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsAsyncResponse in project open-smart-grid-platform by OSGP.
the class PeriodicMeterReadsSteps method theGetMeterReadsRequestIsReceived.
@When("^the get \"([^\"]*)\" meter reads request is received$")
public void theGetMeterReadsRequestIsReceived(final String periodType, final Map<String, String> settings) throws Throwable {
final PeriodicMeterReadsRequest request = PeriodicMeterReadsRequestFactory.fromParameterMap(settings);
final PeriodicMeterReadsAsyncResponse asyncResponse = this.requestClient.doRequest(request);
assertThat(asyncResponse).isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringMonitoringEndpoint method getPeriodicMeterReads.
@PayloadRoot(localPart = "PeriodicMeterReadsRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public PeriodicMeterReadsAsyncResponse getPeriodicMeterReads(@OrganisationIdentification final String organisationIdentification, @RequestPayload final PeriodicMeterReadsRequest request, @MessagePriority final String messagePriority, @ResponseUrl final String responseUrl, @ScheduleTime final String scheduleTime, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PeriodicMeterReadsQuery requestData = this.monitoringMapper.map(request, org.opensmartgridplatform.domain.core.valueobjects.smartmetering.PeriodicMeterReadsQuery.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.REQUEST_PERIODIC_METER_DATA).withMessageType(MessageType.REQUEST_PERIODIC_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, PeriodicMeterReadsAsyncResponse.class);
}
Aggregations