Interface UnparsedNotificationCallback (2.1.0)

public interface UnparsedNotificationCallback extends Serializable

Beta
Callback to receive unparsed notifications for watched resource.

Must NOT be implemented in form of an anonymous class since this would break serialization.

Should be thread-safe as several notifications might be processed at the same time. Example usage:


 static class MyNotificationCallback implements UnparsedNotificationCallback {

   private static final long serialVersionUID = 1L;

   {@literal @}Override
   public void onNotification(StoredChannel storedChannel, UnparsedNotification notification) {
     String contentType = notification.getContentType();
     InputStream contentStream = notification.getContentStream();
     switch (notification.getResourceState()) {
       case ResourceStates.SYNC:
         break;
       case ResourceStates.EXISTS:
         break;
       case ResourceStates.NOT_EXISTS:
         break;
     }
   }
 }
 

Implements

Serializable

Methods

onNotification(StoredChannel storedChannel, UnparsedNotification notification)

public abstract void onNotification(StoredChannel storedChannel, UnparsedNotification notification)

Handles a received unparsed notification.

Parameters
NameDescription
storedChannelStoredChannel

stored notification channel

notificationUnparsedNotification

unparsed notification

Exceptions
TypeDescription
IOException