use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ReadAlarmRegisterAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringMonitoringEndpoint method readAlarmRegister.
@PayloadRoot(localPart = "ReadAlarmRegisterRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public ReadAlarmRegisterAsyncResponse readAlarmRegister(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ReadAlarmRegisterRequest 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.ReadAlarmRegisterRequest requestData = this.monitoringMapper.map(request, org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ReadAlarmRegisterRequest.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.READ_ALARM_REGISTER).withMessageType(MessageType.READ_ALARM_REGISTER).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, ReadAlarmRegisterAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ReadAlarmRegisterAsyncResponse in project open-smart-grid-platform by OSGP.
the class ReadAlarmRegisterSteps method theGetReadAlarmRegisterRequestIsReceived.
@When("^the get read alarm register request is received$")
public void theGetReadAlarmRegisterRequestIsReceived(final Map<String, String> settings) throws Throwable {
final ReadAlarmRegisterRequest request = ReadAlarmRegisterRequestFactory.fromParameterMap(settings);
final ReadAlarmRegisterAsyncResponse asyncResponse = this.requestClient.doRequest(request);
assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Aggregations