Interface MessageNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to receive notifications on adds/changes
to Message objects in this Mailbox . This also includes
existing messages that may appear or disappear due to changes in the
Mailbox hierarchy, This session is intended for consumers needing
to synchronize their message with this service without the use of polling.
Notifications are cancelled when this session is closed.
The two views defined in this session correspond to the views in the
MessageLookupSession .
-
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledgeMessageNotification(Id notificationId) Acknowledge a message notification.booleanTests if this user can register forMessagenotifications.Gets theMailboxassociated with this session.Gets theMailboxIdassociated with this session.voidregisterForChangedMessage(Id messageId) Registers for notification of an updated message.voidRegisters for notification of updated messages.voidregisterForChangedMessagesForRecipient(Id resourceId) Register for notifications of updated messages for a recipient.voidregisterForChangedMessagesFromSender(Id resourceId) Register for notifications of updated messages from sender.voidregisterForDeletedMessage(Id messageId) Registers for notification of a deleted message.voidRegisters for notification of deleted messages.voidregisterForDeletedMessagesForRecipient(Id resourceId) Register for notifications of deleted messages for a recipient.voidregisterForDeletedMessagesFromSender(Id resourceId) Register for notifications of deleted messages from sender.voidRegister for notifications of new messages.voidregisterForNewMessagesForRecipient(Id resourceId) Register for notifications of new messages for a recipient.voidregisterForNewMessagesFromSender(Id resourceId) Register for notifications of new messages from sender.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
-
getMailboxId
Id getMailboxId()Gets theMailboxIdassociated with this session.- Returns:
- the
Mailbox Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getMailbox
Gets theMailboxassociated with this session.- Returns:
- the
Mailboxassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canRegisterForMessageNotifications
boolean canRegisterForMessageNotifications()Tests if this user can register forMessagenotifications. 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.
-
useFederatedMailboxView
void useFederatedMailboxView()Federates the view for methods in this session. A federated view will include messages in mailboxes which are children of this mailbox in the mailbox hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedMailboxView
void useIsolatedMailboxView()Isolates the view for methods in this session. An isolated view restricts notifications to this mailbox only.- Compliance:
mandatory- This method is must be implemented.
-
reliableMessageNotifications
void reliableMessageNotifications()Reliable notifications are desired. In reliable mode, notifications are to be acknowledged usingacknowledgeMessageNotification().- Compliance:
mandatory- This method is must be implemented.
-
unreliableMessageNotifications
void unreliableMessageNotifications()Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.- Compliance:
mandatory- This method is must be implemented.
-
acknowledgeMessageNotification
void acknowledgeMessageNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException Acknowledge a message notification.- Parameters:
notificationId- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewMessages
Register for notifications of new messages.MessageReceiver.newMessages()is invoked when a newMessageis appears in this mailbox.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewMessagesFromSender
void registerForNewMessagesFromSender(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of new messages from sender.MessageReceiver.newMessages()is invoked when a newMessageis appears in this mailbox.- Parameters:
resourceId- theIdof theResourceto monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewMessagesForRecipient
void registerForNewMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of new messages for a recipient.MessageReceiver.newMessages()is invoked when a newMessageis appears in this mailbox.- Parameters:
resourceId- theIdof theResourceto monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedMessages
Registers for notification of updated messages.MessageReceiver.changedMessages()is invoked when a message in this mailbox is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedMessagesFromSender
void registerForChangedMessagesFromSender(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of updated messages from sender.MessageReceiver.updatedMessages()is invoked when aMessagein this mailbox is changed.- Parameters:
resourceId- theIdof theResourceto monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedMessagesForRecipient
void registerForChangedMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of updated messages for a recipient.MessageReceiver.updatedMessages()is invoked when aMessagein this mailbox is changed.- Parameters:
resourceId- theIdof theResourceto monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedMessage
void registerForChangedMessage(Id messageId) throws OperationFailedException, PermissionDeniedException Registers for notification of an updated message.MessageReceiver.changedMessage()is invoked when the specified message in this mailbox is changed.- Parameters:
messageId- theIdof theMessageto monitor- Throws:
NullArgumentException-messageIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedMessages
Registers for notification of deleted messages.MessageReceiver.deletedMessages()is invoked when a message is deleted or removed from this mailbox.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedMessagesFromSender
void registerForDeletedMessagesFromSender(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted messages from sender.MessageReceiver.deletedMessages()is invoked when aMessageis deleted or removed from this mailbox.- Parameters:
resourceId- theIdof theResourceto monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedMessagesForRecipient
void registerForDeletedMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException Register for notifications of deleted messages for a recipient.MessageReceiver.deletedMessages()is invoked when aMessageis deleted or removed from this mailbox.- Parameters:
resourceId- theIdof theResourceto monitor- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedMessage
void registerForDeletedMessage(Id messageId) throws OperationFailedException, PermissionDeniedException Registers for notification of a deleted message.MessageReceiver.deletedMessages()is invoked when the specified message is deleted or removed from this mailbox.- Parameters:
messageId- theIdof theMessageto monitor- Throws:
NullArgumentException-messageIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-