Search in sources :

Example 1 with ActualMeterReadsGasAsyncResponse

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);
}
Also used : GetPowerQualityProfileAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileAsyncResponse) AsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse) ClearAlarmRegisterAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ClearAlarmRegisterAsyncResponse) ReadAlarmRegisterAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ReadAlarmRegisterAsyncResponse) PeriodicMeterReadsGasAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsGasAsyncResponse) ActualMeterReadsGasAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse) ActualPowerQualityAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse) ActualMeterReadsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse) PeriodicMeterReadsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsAsyncResponse) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 2 with ActualMeterReadsGasAsyncResponse

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());
}
Also used : ActualMeterReadsGasRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest) ActualMeterReadsGasAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse) When(io.cucumber.java.en.When)

Example 3 with ActualMeterReadsGasAsyncResponse

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);
    }
}
Also used : ActualMeterReadsGasAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest) ActualMeterReadsGasRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest) ActualMeterReadsGasAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse) When(io.cucumber.java.en.When)

Aggregations

ActualMeterReadsGasAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse)3 When (io.cucumber.java.en.When)2 ActualMeterReadsGasRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasRequest)2 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 ActualMeterReadsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse)1 ActualMeterReadsGasAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncRequest)1 ActualPowerQualityAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse)1 ClearAlarmRegisterAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ClearAlarmRegisterAsyncResponse)1 GetPowerQualityProfileAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetPowerQualityProfileAsyncResponse)1 PeriodicMeterReadsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsAsyncResponse)1 PeriodicMeterReadsGasAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsGasAsyncResponse)1 ReadAlarmRegisterAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ReadAlarmRegisterAsyncResponse)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1