Search in sources :

Example 1 with ActualPowerQualityAsyncResponse

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

the class ActualPowerQualitySteps method theGetActualMeterReadsRequestGeneratingAnErrorIsReceived.

@When("^the get actual power quality request generating an error is received$")
public void theGetActualMeterReadsRequestGeneratingAnErrorIsReceived(final Map<String, String> settings) throws Throwable {
    final ActualPowerQualityRequest request = ActualPowerQualityRequestFactory.fromParameterMap(settings);
    final ActualPowerQualityAsyncResponse asyncResponse = this.requestClient.doRequest(request);
    ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
    final ActualPowerQualityAsyncRequest actualPowerQualityAsyncRequest = ActualPowerQualityRequestFactory.fromScenarioContext();
    try {
        final ActualPowerQualityResponse response = this.responseClient.getResponse(actualPowerQualityAsyncRequest);
        fail("Expected exception, but got a response: %s", response.toString());
    } catch (final Exception exception) {
        ScenarioContext.current().put(PlatformKeys.RESPONSE, exception);
    }
}
Also used : ActualPowerQualityResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityResponse) ActualPowerQualityAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse) ActualPowerQualityRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest) ActualPowerQualityAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncRequest) When(io.cucumber.java.en.When)

Example 2 with ActualPowerQualityAsyncResponse

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

the class ActualPowerQualitySteps method theGetActualMeterReadsRequestIsReceived.

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

Example 3 with ActualPowerQualityAsyncResponse

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

the class SmartMeteringMonitoringEndpoint method getActualPowerQuality.

@PayloadRoot(localPart = "ActualPowerQualityRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public ActualPowerQualityAsyncResponse getActualPowerQuality(@OrganisationIdentification final String organisationIdentification, @RequestPayload final org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest request, @MessagePriority final String messagePriority, @ResponseUrl final String responseUrl, @ScheduleTime final String scheduleTime, @BypassRetry final String bypassRetry) throws OsgpException {
    final ActualPowerQualityRequest requestData = this.monitoringMapper.map(request, ActualPowerQualityRequest.class);
    final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_ACTUAL_POWER_QUALITY).withMessageType(MessageType.GET_ACTUAL_POWER_QUALITY).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, ActualPowerQualityAsyncResponse.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) ActualPowerQualityRequest(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Aggregations

ActualPowerQualityAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncResponse)3 When (io.cucumber.java.en.When)2 ActualPowerQualityRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityRequest)2 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 ActualMeterReadsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsAsyncResponse)1 ActualMeterReadsGasAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsGasAsyncResponse)1 ActualPowerQualityAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityAsyncRequest)1 ActualPowerQualityResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualPowerQualityResponse)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 ActualPowerQualityRequest (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1