use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class SmartMeteringMonitoringResponseClient method getResponse.
public T getResponse(final V request, final NotificationType notificationType) throws WebServiceSecurityException {
final Notification notification = this.waitForNotification(notificationType);
request.setCorrelationUid(notification.getCorrelationUid());
return (T) this.getTemplate().marshalSendAndReceive(request);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class NotificationServiceWsTest method testMappingFromGenericSendNotificationRequest.
@Test
public void testMappingFromGenericSendNotificationRequest() {
final GenericSendNotificationRequest genericRequest = new GenericSendNotificationRequest(this.createGenericNotification());
final SendNotificationRequest sendNotificationRequest = this.mapperFactory.getMapperFacade().map(genericRequest, SendNotificationRequest.class);
final Notification notification = sendNotificationRequest.getNotification();
assertThat(notification.getMessage()).isEqualTo(MESSAGE);
assertThat(notification.getResult()).isEqualTo(RESULT);
assertThat(notification.getDeviceIdentification()).isEqualTo(DEVICEIDENTIFICATION);
assertThat(notification.getCorrelationUid()).isEqualTo(CORRELATION_UID);
assertThat(notification.getNotificationType()).isEqualTo(NOTIFICATION_TYPE);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class NotificationServiceWsTest method createNotification.
private Notification createNotification() {
final Notification notification = new Notification();
notification.setMessage(MESSAGE);
notification.setResult(RESULT);
notification.setDeviceIdentification(DEVICEIDENTIFICATION);
notification.setCorrelationUid(CORRELATION_UID);
notification.setNotificationType(NOTIFICATION_TYPE);
return notification;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationClient method getPushNotificationAlarm.
public GetPushNotificationAlarmResponse getPushNotificationAlarm() throws WebServiceSecurityException {
final Notification notification = this.waitForNotification(NotificationType.PUSH_NOTIFICATION_ALARM);
final GetPushNotificationAlarmAsyncRequest request = new GetPushNotificationAlarmAsyncRequest();
request.setCorrelationUid(notification.getCorrelationUid());
request.setDeviceIdentification(notification.getDeviceIdentification());
return (GetPushNotificationAlarmResponse) this.getTemplate().marshalSendAndReceive(request);
}
Aggregations