Interface MessageLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface MessageLookupSession extends OsidSession

This session defines methods for retrieving messages.

This lookup session defines several views:

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete result set or is an error condition
  • isolated mailbox view: All message methods in this session operate, retrieve and pertain to messages defined explicitly in the current mailbox. Using an isolated view is useful for managing Messages with the MessageAdminSession .
  • federated mailbox view: All message methods in this session operate, retrieve and pertain to all messages defined in this mailbox and any other messages implicitly available in this mailbox through mailbox inheritence.

The methods useFederatedMailboxView() and useIsolatedMailboxView() behave as a radio group and one should be selected before invoking any lookup methods.

Messages may have an additional records indicated by their respective record types. The record may not be accessed through a cast of the Message .

  • 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.
    • canLookupMessages

      boolean canLookupMessages()
      Tests if this user can perform Message lookups. 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 lookup operations.
      Returns:
      false if lookup methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeMessageView

      void useComparativeMessageView()
      The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.
      Compliance:
      mandatory - This method is must be implemented.
    • usePlenaryMessageView

      void usePlenaryMessageView()
      A complete view of the Message returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.
      Compliance:
      mandatory - This method is 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 lookups to this mailbox only.
      Compliance:
      mandatory - This method is must be implemented.
    • getMessage

      Gets the Message specified by its Id . In plenary mode, the exact Id is found or a NOT_FOUND results. Otherwise, the returned Message may have a different Id than requested, such as the case where a duplicate Id was assigned to a Message and retained for compatibility.
      Parameters:
      messageId - the Id of the Message to retrieve
      Returns:
      the returned Message
      Throws:
      NotFoundException - no Message found with the given Id
      NullArgumentException - messageId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByIds

      Gets a MessageList corresponding to the given IdList . In plenary mode, the returned list contains all of the messages specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in the supplied list is not found or inaccessible. Otherwise, inaccessible Messages may be omitted from the list and may present the elements in any order including returning a unique set.
      Parameters:
      messageIds - the list of Ids to retrieve
      Returns:
      the returned Message list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - messageIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByGenusType

      MessageList getMessagesByGenusType(Type messageGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList corresponding to the given message genus Type which does not include messages of types derived from the specified Type .In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      messageGenusType - a message genus type
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - messageGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByParentGenusType

      MessageList getMessagesByParentGenusType(Type messageGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList corresponding to the given message genus Type and include any additional messages with genus types derived from the specified Type .In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session
      Parameters:
      messageGenusType - a message genus type
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - messageGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByRecordType

      MessageList getMessagesByRecordType(Type messageRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList containing the given message record Type . In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      messageRecordType - a message record type
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - messageRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesBySentTime

      Gets a MessageList sent within the specified range inclusive. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesBySentTimeAndGenusType

      MessageList getMessagesBySentTimeAndGenusType(Type messageGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList of the given genus type and sent within the specified range inclusive. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      messageGenusType - a message genus type
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - messageGenusType, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesFromSender

      MessageList getMessagesFromSender(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList sent by the specified sender. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByGenusTypeFromSender

      MessageList getMessagesByGenusTypeFromSender(Id resourceId, Type messageGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList of the given genus type and sender. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      messageGenusType - a message genus type
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - resourceId or messageGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesBySentTimeFromSender

      MessageList getMessagesBySentTimeFromSender(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList sent by the specified sender and sent time. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session
      Parameters:
      resourceId - a resource Id
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesBySentTimeAndGenusTypeFromSender

      MessageList getMessagesBySentTimeAndGenusTypeFromSender(Id resourceId, Type messageGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList of the given genus type and sent within the specified range inclusive. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      messageGenusType - a message genus type
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, messageGenusType, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesForRecipient

      MessageList getMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList received by the specified recipient. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByGenusTypeForRecipient

      MessageList getMessagesByGenusTypeForRecipient(Id resourceId, Type messageGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList received by the specified recipient. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      messageGenusType - a message genus type
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - resourceId or messageGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByReceivedTimeForRecipient

      MessageList getMessagesByReceivedTimeForRecipient(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList received by the specified resource and received time. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByReceivedTimeAndGenusTypeForRecipient

      MessageList getMessagesByReceivedTimeAndGenusTypeForRecipient(Id resourceId, Type messageGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList of the given genus type received by the specified resource and received time. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      messageGenusType - a message genus type
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, messageGenusType, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesFromSenderForRecipient

      MessageList getMessagesFromSenderForRecipient(Id senderResourceId, Id recipientResourceId) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList sent by the specified sender and received by the specified recipient. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      senderResourceId - a resource Id
      recipientResourceId - a resource Id
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - senderResourceId or recipientResourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByGenusTypeFromSenderForRecipient

      MessageList getMessagesByGenusTypeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, Type messageGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList of the given genus type sent by the specified sender and received by the specified recipient. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      senderResourceId - a resource Id
      recipientResourceId - a resource Id
      messageGenusType - a message genus type
      Returns:
      the returned Message list
      Throws:
      NullArgumentException - senderResourceId, recipientResourceId or messageGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByReceivedTimeFromSenderForRecipient

      MessageList getMessagesByReceivedTimeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList by the specified sender, recipient, and received time. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      senderResourceId - a resource Id
      recipientResourceId - a resource Id
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - senderResourceId, recipientResourceId, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessagesByReceivedTimeAndGenusTypeFromSenderForRecipient

      MessageList getMessagesByReceivedTimeAndGenusTypeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, Type messageGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a MessageList of the given genus type and received by the specified resource and received time. In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Parameters:
      senderResourceId - a resource Id
      recipientResourceId - a resource Id
      messageGenusType - a message genus type
      from - starting date
      to - ending date
      Returns:
      the returned Message list
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - senderResourceId, recipientResourceId, messageGenusType, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getMessages

      Gets all Messages . In plenary mode, the returned list contains all known messages or an error results. Otherwise, the returned list may contain only those messages that are accessible through this session.
      Returns:
      a list of Messages
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.