Search in sources :

Example 1 with ActualPowerQualityRequest

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest in project open-smart-grid-platform by OSGP.

the class ActualPowerQualityRequestMapperTest method testGetActualPowerQualityRequest.

@Test
public void testGetActualPowerQualityRequest() {
    final ActualPowerQualityRequest actualPowerQualityRequest = new ActualPowerQualityRequest("PUBLIC");
    final ActualPowerQualityRequest result = this.mapper.map(actualPowerQualityRequest, ActualPowerQualityRequest.class);
    assertThat(result).isNotNull().isInstanceOf(ActualPowerQualityRequest.class);
    assertThat(result.getProfileType()).isEqualTo("PUBLIC");
}
Also used : ActualPowerQualityRequest(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest) Test(org.junit.jupiter.api.Test)

Example 2 with ActualPowerQualityRequest

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest in project open-smart-grid-platform by OSGP.

the class ActualPowerQualityRequestMessageProcessor method handleMessage.

@Override
protected void handleMessage(final MessageMetadata deviceMessageMetadata, final Object dataObject) throws FunctionalException {
    final ActualPowerQualityRequest actualPowerQualityRequest = (ActualPowerQualityRequest) dataObject;
    this.monitoringService.requestActualPowerQuality(deviceMessageMetadata, actualPowerQualityRequest);
}
Also used : ActualPowerQualityRequest(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest)

Example 3 with ActualPowerQualityRequest

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest 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

ActualPowerQualityRequest (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ActualPowerQualityRequest)3 Test (org.junit.jupiter.api.Test)1 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 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