Interface NotificationListener


public interface NotificationListener
Client code can register a notification listener on an Endpoint in order to be called back when notifications for observed resources are received from peers.

Notification listeners are registered at a global level only, i.e. the listener will be invoked for all notifications for all observed resources. This is in contrast to the CoapHandler that client code can register when invoking one of CoapClient's methods and which is called back for notifications for a particular observed resource only.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onNotification(Request request, Response response)
    Invoked when a notification for an observed resource has been received.
  • Method Details

    • onNotification

      void onNotification(Request request, Response response)
      Invoked when a notification for an observed resource has been received.
      Parameters:
      request - The original request that was used to establish the observation.
      response - the notification.