Interface CommentNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CommentNotificationSession extends OsidSession

This session defines methods to receive notifications on adds/changes to Comments . 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.

  • Method Details

    • getBookId

      Id getBookId()
      Gets the Book Id associated with this session.
      Returns:
      the Book Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBook

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

      boolean canRegisterForCommentNotifications()
      Tests if this user can register for Comment 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.
    • useFederatedBookView

      void useFederatedBookView()
      Federates the view for methods in this session. A federated view will include notifications for commentss in books which are children of this book in the book hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedBookView

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

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

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

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

      void registerForNewComments() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new comments. CommentReceiver.newComments() is invoked when a new Comment is created.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewCommentsForCommentor

      void registerForNewCommentsForCommentor(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new comments by the given resource Id . CommentReceiver.newComments() is invoked when a new Comment is created.
      Parameters:
      resourceId - the Id of the resource to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewCommentsForReference

      void registerForNewCommentsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new comments for the given reference Id . CommentReceiver.newComments() is invoked when a new Comment is created.
      Parameters:
      referenceId - the Id of the reference to monitor
      Throws:
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedComments

      void registerForChangedComments() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated comments. CommentReceiver.changedComments() is invoked when a comment is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedCommentsForCommentor

      void registerForChangedCommentsForCommentor(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of changed comments by the given resource Id . CommentReceiver.changedComments() is invoked when a Comment by the resource is changed.
      Parameters:
      resourceId - the Id of the resource to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedCommentsForReference

      void registerForChangedCommentsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of changed comments for the given reference Id . CommentReceiver.changedComments() is invoked when a Comment for the reference is changed.
      Parameters:
      referenceId - the Id of the reference to monitor
      Throws:
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedComment

      void registerForChangedComment(Id commentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Registers for notification of an updated comment. CommentReceiver.changedComments() is invoked when the specified comment is changed.
      Parameters:
      commentId - the Id of the Comment to monitor
      Throws:
      NotFoundException - a comment was not found identified by the given Id
      NullArgumentException - commentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedComments

      void registerForDeletedComments() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted comments. CommentReceiver.deletedComments() is invoked when a comment is deleted.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedCommentsForCommentor

      void registerForDeletedCommentsForCommentor(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of deleted comments by the given resource Id . CommentReceiver.deletedComments() is invoked when a Comment by the resource is deleted.
      Parameters:
      resourceId - the Id of the resource to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedCommentsForReference

      void registerForDeletedCommentsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of deleted comments for the given reference Id . CommentReceiver.deletedComments() is invoked when a Comment for the reference is deleted.
      Parameters:
      referenceId - the Id of the reference to monitor
      Throws:
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedComment

      void registerForDeletedComment(Id commentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted comment. CommentReceiver.deletedComments() is invoked when the specified comment is deleted.
      Parameters:
      commentId - the Id of the Comment to monitor
      Throws:
      NotFoundException - a comment was not found identified by the given Id
      NullArgumentException - commentId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.