Interface StateChangeNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface StateChangeNotificationSession extends OsidSession

This session defines methods to receive notifications on changes of object states. This session is intended for consumers needing to synchronize their state with this service without the use of polling. Notifications are cancelled when this session

  • Method Details

    • canRegisterForStateChangeNotifications

      boolean canRegisterForStateChangeNotifications()
      Tests if this user can register for State notifications. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer notification operations.
      Returns:
      false if notification methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • reliableStateChangeNotifications

      void reliableStateChangeNotifications()
      Reliable notifications are desired. In reliable mode, notifications are to be acknowledged using acknowledgeStateChangeNotification() .
      Compliance:
      mandatory - This method is must be implemented.
    • unreliableStateChangeNotifications

      void unreliableStateChangeNotifications()
      Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.
      Compliance:
      mandatory - This method is must be implemented.
    • acknowledgeStateChangeNotification

      void acknowledgeStateChangeNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException
      Acknowledge a state change notification.
      Parameters:
      notificationId - the Id of the notification
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedState

      void registerForChangedState() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated states. StateChangeReceiver.changedState() is invoked when a state is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedState

      void registerForChangedState(Id id) throws OperationFailedException, PermissionDeniedException
      Registers for notification of an updated state. StateChangeReceiver.changedState() is invoked when the specified state is changed.
      Parameters:
      id - the Id to monitor
      Throws:
      NullArgumentException - id is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.