Interface CommentNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidacknowledgeCommentNotification(Id notificationId) Acknowledge a comment notification.booleanTests if this user can register forCommentnotifications.getBook()Gets theBookassociated with this session.Gets theBookIdassociated with this session.voidregisterForChangedComment(Id commentId) Registers for notification of an updated comment.voidRegisters for notification of updated comments.voidregisterForChangedCommentsForCommentor(Id resourceId) Register for notifications of changed comments by the given resourceId.voidregisterForChangedCommentsForReference(Id referenceId) Register for notifications of changed comments for the given referenceId.voidregisterForDeletedComment(Id commentId) Registers for notification of a deleted comment.voidRegisters for notification of deleted comments.voidregisterForDeletedCommentsForCommentor(Id resourceId) Register for notifications of deleted comments by the given resourceId.voidregisterForDeletedCommentsForReference(Id referenceId) Register for notifications of deleted comments for the given referenceId.voidRegister for notifications of new comments.voidregisterForNewCommentsForCommentor(Id resourceId) Register for notifications of new comments by the given resourceId.voidregisterForNewCommentsForReference(Id referenceId) Register for notifications of new comments for the given referenceId.voidReliable notifications are desired.voidUnreliable notifications are desired.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getBookId
Id getBookId()Gets theBookIdassociated with this session.- Returns:
- the
Book Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBook
Gets theBookassociated with this session.- Returns:
- the book
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForCommentNotifications
boolean canRegisterForCommentNotifications()Tests if this user can register forCommentnotifications. 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer notification operations.- Returns:
falseif notification methods are not authorized,trueotherwise- 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 usingacknowledgeCommentNotification().- 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- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewComments
Register for notifications of new comments.CommentReceiver.newComments()is invoked when a newCommentis created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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 resourceId.CommentReceiver.newComments()is invoked when a newCommentis created.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 referenceId.CommentReceiver.newComments()is invoked when a newCommentis created.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedComments
Registers for notification of updated comments.CommentReceiver.changedComments()is invoked when a comment is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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 resourceId.CommentReceiver.changedComments()is invoked when aCommentby the resource is changed.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 referenceId.CommentReceiver.changedComments()is invoked when aCommentfor the reference is changed.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theCommentto monitor- Throws:
NotFoundException- a comment was not found identified by the givenIdNullArgumentException-commentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedComments
Registers for notification of deleted comments.CommentReceiver.deletedComments()is invoked when a comment is deleted.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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 resourceId.CommentReceiver.deletedComments()is invoked when aCommentby the resource is deleted.- Parameters:
resourceId- theIdof the resource to monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 referenceId.CommentReceiver.deletedComments()is invoked when aCommentfor the reference is deleted.- Parameters:
referenceId- theIdof the reference to monitor- Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theCommentto monitor- Throws:
NotFoundException- a comment was not found identified by the givenIdNullArgumentException-commentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-