Interface MessageNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface MessageNotificationSession extends 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 Details

    • getMailboxId

      Id getMailboxId()
      Gets the Mailbox Id associated with this session.
      Returns:
      the Mailbox Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getMailbox

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

      boolean canRegisterForMessageNotifications()
      Tests if this user can register for Message 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.
    • 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 using acknowledgeMessageNotification() .
      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 - the Id of the notification
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewMessages

      void registerForNewMessages() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new messages. MessageReceiver.newMessages() is invoked when a new Message is appears in this mailbox.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 new Message is appears in this mailbox.
      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.
    • registerForNewMessagesForRecipient

      void registerForNewMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new messages for a recipient. MessageReceiver.newMessages() is invoked when a new Message is appears in this mailbox.
      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.
    • registerForChangedMessages

      void registerForChangedMessages() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated messages. MessageReceiver.changedMessages() is invoked when a message in this mailbox is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 a Message in this mailbox 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.
    • registerForChangedMessagesForRecipient

      void registerForChangedMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of updated messages for a recipient. MessageReceiver.updatedMessages() is invoked when a Message in this mailbox 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.
    • 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 - the Id of the Message to monitor
      Throws:
      NullArgumentException - messageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedMessages

      void registerForDeletedMessages() throws OperationFailedException, PermissionDeniedException
      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 request
      PermissionDeniedException - 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 a Message is deleted or removed from this mailbox.
      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.
    • registerForDeletedMessagesForRecipient

      void registerForDeletedMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of deleted messages for a recipient. MessageReceiver.deletedMessages() is invoked when a Message is deleted or removed from this mailbox.
      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.
    • 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 - the Id of the Message to monitor
      Throws:
      NullArgumentException - messageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.