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");
}
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);
}
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);
}
Aggregations