Search in sources :

Example 1 with ActualMeterReadsAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse in project open-smart-grid-platform by OSGP.

the class ActualMeterReadsSteps method theGetActualMeterReadsRequestIsReceived.

@When("^the get actual meter reads request is received$")
public void theGetActualMeterReadsRequestIsReceived(final Map<String, String> settings) throws Throwable {
    final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings);
    final ActualMeterReadsAsyncResponse 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 : ActualMeterReadsRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsRequest) ActualMeterReadsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse) When(io.cucumber.java.en.When)

Example 2 with ActualMeterReadsAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse in project open-smart-grid-platform by OSGP.

the class ActualMeterReadsSteps method theGetActualMeterReadsRequestGeneratingAnErrorIsReceived.

@When("^the get actual meter reads request generating an error is received$")
public void theGetActualMeterReadsRequestGeneratingAnErrorIsReceived(final Map<String, String> settings) throws Throwable {
    final ActualMeterReadsRequest request = ActualMeterReadsRequestFactory.fromParameterMap(settings);
    final ActualMeterReadsAsyncResponse asyncResponse = this.requestClient.doRequest(request);
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
    final ActualMeterReadsAsyncRequest actualMeterReadsAsyncRequest = ActualMeterReadsRequestFactory.fromScenarioContext();
    assertThat(actualMeterReadsAsyncRequest).as("ActualMeterReadsAsyncRequest should not be null").isNotNull();
    try {
        final ActualMeterReadsResponse response = this.responseClient.getResponse(actualMeterReadsAsyncRequest);
        fail("Expected exception, but got a response: %s", response.toString());
    } catch (final Exception exception) {
        ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
    }
}
Also used : ActualMeterReadsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsResponse) ActualMeterReadsRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsRequest) ActualMeterReadsAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncRequest) ActualMeterReadsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse) When(io.cucumber.java.en.When)

Example 3 with ActualMeterReadsAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse in project open-smart-grid-platform by OSGP.

the class SmartMeteringMonitoringEndpoint method getActualMeterReads.

@PayloadRoot(localPart = "ActualMeterReadsRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public ActualMeterReadsAsyncResponse getActualMeterReads(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ActualMeterReadsRequest 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(false);
    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, ActualMeterReadsAsyncResponse.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)

Aggregations

ActualMeterReadsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse)3 When (io.cucumber.java.en.When)2 ActualMeterReadsRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsRequest)2 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 ActualMeterReadsAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncRequest)1 ActualMeterReadsGasAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse)1 ActualMeterReadsResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsResponse)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