Class ObserveNotificationOrderer

java.lang.Object
org.eclipse.californium.core.observe.ObserveNotificationOrderer

public class ObserveNotificationOrderer extends Object
The ObservingNotificationOrderer holds the state of an observe relation such as the timeout of the last notification and the current number.
  • Constructor Details

    • ObserveNotificationOrderer

      public ObserveNotificationOrderer()
      Creates a new notification orderer.
    • ObserveNotificationOrderer

      public ObserveNotificationOrderer(Integer observe)
      Creates a new notification orderer for a given notification.
      Parameters:
      observe - value of observe option
      Throws:
      NullPointerException - if observe is null
  • Method Details

    • getNextObserveNumber

      public int getNextObserveNumber()
      Return a new observe option number. This method is thread-safe as it increases the option number atomically.
      Returns:
      a new observe option number
    • getCurrent

      public int getCurrent()
      Returns the current notification number.
      Returns:
      the current notification number
    • isNew

      public boolean isNew(Response response)
      Check, if the provided notification is newer than the current one.
      Parameters:
      response - the notification
      Returns:
      true, if the notification is new, or the response is no notify
    • reset

      public void reset()
      Reset state.
      Since:
      3.8