use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetAlarmNotificationsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setAlarmNotifications.
@PayloadRoot(localPart = "SetAlarmNotificationsRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetAlarmNotificationsAsyncResponse setAlarmNotifications(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetAlarmNotificationsRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final AlarmNotifications alarmNotifications = this.configurationMapper.map(request.getSetAlarmNotificationsRequestData().getAlarmNotifications(), AlarmNotifications.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_ALARM_NOTIFICATIONS).withMessageType(MessageType.SET_ALARM_NOTIFICATIONS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, alarmNotifications);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetAlarmNotificationsAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.SetAlarmNotificationsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetAlarmNotifications method theSetAlarmNotificationsRequestIsReceived.
@When("^the set alarm notifications request is received$")
public void theSetAlarmNotificationsRequestIsReceived(final Map<String, String> requestData) throws Throwable {
final SetAlarmNotificationsRequest setAlarmNotificationsRequest = SetAlarmNotificationsRequestFactory.fromParameterMap(requestData);
final SetAlarmNotificationsAsyncResponse setAlarmNotificationsAsyncResponse = this.smartMeteringConfigurationClient.setAlarmNotifications(setAlarmNotificationsRequest);
LOGGER.info("Set alarm notifications response is received {}", setAlarmNotificationsAsyncResponse);
assertThat(setAlarmNotificationsAsyncResponse).as("Set alarm notifications response should not be null").isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setAlarmNotificationsAsyncResponse.getCorrelationUid());
}
Aggregations