Search in sources :

Example 6 with Notification

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);
}
Also used : Notification(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification)

Example 7 with Notification

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);
}
Also used : SendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.SendNotificationRequest) GenericSendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest) Notification(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification) GenericNotification(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericNotification) GenericSendNotificationRequest(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest) Test(org.junit.jupiter.api.Test)

Example 8 with Notification

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;
}
Also used : Notification(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification) GenericNotification(org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericNotification)

Example 9 with 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);
}
Also used : GetPushNotificationAlarmResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetPushNotificationAlarmResponse) GetPushNotificationAlarmAsyncRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetPushNotificationAlarmAsyncRequest) Notification(org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification)

Aggregations

Notification (org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.Notification)9 GenericNotification (org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericNotification)2 Test (org.junit.jupiter.api.Test)1 GenericSendNotificationRequest (org.opensmartgridplatform.adapter.ws.schema.shared.notification.GenericSendNotificationRequest)1 GetPushNotificationAlarmAsyncRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetPushNotificationAlarmAsyncRequest)1 GetPushNotificationAlarmResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetPushNotificationAlarmResponse)1 SendNotificationRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.notification.SendNotificationRequest)1