Interface CompositionNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CompositionNotificationSession extends OsidSession

This session defines methods to receive notifications on adds/changes to Composition objects in this Repository . 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 is closed.

Two view are defined in this session:

  • federateRepositoryView : includes notifications of compositions in repositories of which this repository is an ancestor in the repository hierarchy
  • isolateRepositoryView : restricts notifications to this Repository only
  • Method Details

    • getRepositoryId

      Id getRepositoryId()
      Gets the Repository Id associated with this session.
      Returns:
      the Repository Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getRepository

      Gets the Repository associated with this session.
      Returns:
      the Repository associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canRegisterForCompositionNotifications

      boolean canRegisterForCompositionNotifications()
      Tests if this user can register for Composition 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.
    • useFederatedRepositoryView

      void useFederatedRepositoryView()
      Federates the view for composition methods in this session. A federated view will include compositions in repositories which are children of this repository in the repository hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedRepositoryView

      void useIsolatedRepositoryView()
      Isolates the view for composition methods in this session. An isolated view restricts notifications to this repository only.
      Compliance:
      mandatory - This method is must be implemented.
    • reliableCompositionNotifications

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

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

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

      void registerForNewCompositions() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new composition. CompositionReceiver.newCompositions() is invoked when a new Composition appears in this repository.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedCompositions

      void registerForChangedCompositions() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new compositions. CompositionReceiver.changedCompositions() is invoked when a Composition is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedComposition

      void registerForChangedComposition(Id compositionId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of an updated composition. CompositionReceiver.changedCompositions() is invoked when the specified composition is changed.
      Parameters:
      compositionId - the Id of the Composition to monitor
      Throws:
      NullArgumentException - compositionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedCompositions

      void registerForDeletedCompositions() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new compositions. CompositionReceiver.deletedCompositions() is invoked when a Composition is removed from this repository.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedComposition

      void registerForDeletedComposition(Id compositionId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted composition. CompositionReceiver.deletedCompositions() is invoked when the specified composition is removed from this repository.
      Parameters:
      compositionId - the Id of the Composition to monitor
      Throws:
      NullArgumentException - compositionId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.