Interface MessageLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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
Messageswith theMessageAdminSession. - 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 Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performMessagelookups.Gets theMailboxassociated with this session.Gets theMailboxIdassociated with this session.getMessage(Id messageId) Gets theMessagespecified by itsId.Gets allMessages.getMessagesByGenusType(Type messageGenusType) Gets aMessageListcorresponding to the given message genusTypewhich does not include messages of types derived from the specifiedType.In plenary mode, the returned list contains all known messages or an error results.getMessagesByGenusTypeForRecipient(Id resourceId, Type messageGenusType) Gets aMessageListreceived by the specified recipient.getMessagesByGenusTypeFromSender(Id resourceId, Type messageGenusType) Gets aMessageListof the given genus type and sender.getMessagesByGenusTypeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, Type messageGenusType) Gets aMessageListof the given genus type sent by the specified sender and received by the specified recipient.getMessagesByIds(IdList messageIds) Gets aMessageListcorresponding to the givenIdList.getMessagesByParentGenusType(Type messageGenusType) Gets aMessageListcorresponding to the given message genusTypeand include any additional messages with genus types derived from the specifiedType.In plenary mode, the returned list contains all known messages or an error results.getMessagesByReceivedTimeAndGenusTypeForRecipient(Id resourceId, Type messageGenusType, DateTime from, DateTime to) Gets aMessageListof the given genus type received by the specified resource and received time.getMessagesByReceivedTimeAndGenusTypeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, Type messageGenusType, DateTime from, DateTime to) Gets aMessageListof the given genus type and received by the specified resource and received time.getMessagesByReceivedTimeForRecipient(Id resourceId, DateTime from, DateTime to) Gets aMessageListreceived by the specified resource and received time.getMessagesByReceivedTimeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, DateTime from, DateTime to) Gets aMessageListby the specified sender, recipient, and received time.getMessagesByRecordType(Type messageRecordType) Gets aMessageListcontaining the given message recordType.getMessagesBySentTime(DateTime from, DateTime to) Gets aMessageListsent within the specified range inclusive.getMessagesBySentTimeAndGenusType(Type messageGenusType, DateTime from, DateTime to) Gets aMessageListof the given genus type and sent within the specified range inclusive.getMessagesBySentTimeAndGenusTypeFromSender(Id resourceId, Type messageGenusType, DateTime from, DateTime to) Gets aMessageListof the given genus type and sent within the specified range inclusive.getMessagesBySentTimeFromSender(Id resourceId, DateTime from, DateTime to) Gets aMessageListsent by the specified sender and sent time.getMessagesForRecipient(Id resourceId) Gets aMessageListreceived by the specified recipient.getMessagesFromSender(Id resourceId) Gets aMessageListsent by the specified sender.getMessagesFromSenderForRecipient(Id senderResourceId, Id recipientResourceId) Gets aMessageListsent by the specified sender and received by the specified recipient.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theMessagereturns is desired.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.
-
canLookupMessages
boolean canLookupMessages()Tests if this user can performMessagelookups. 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 lookup operations.- Returns:
falseif lookup methods are not authorized,trueotherwise- 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 theMessagereturns 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
Message getMessage(Id messageId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theMessagespecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedMessagemay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aMessageand retained for compatibility.- Parameters:
messageId- theIdof theMessageto retrieve- Returns:
- the returned
Message - Throws:
NotFoundException- noMessagefound with the givenIdNullArgumentException-messageIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByIds
MessageList getMessagesByIds(IdList messageIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aMessageListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the messages specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleMessagesmay be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
messageIds- the list ofIdsto retrieve- Returns:
- the returned
Message list - Throws:
NotFoundException- anId wasnot foundNullArgumentException-messageIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByGenusType
MessageList getMessagesByGenusType(Type messageGenusType) throws OperationFailedException, PermissionDeniedException Gets aMessageListcorresponding to the given message genusTypewhich does not include messages of types derived from the specifiedType.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
Messagelist - Throws:
NullArgumentException-messageGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByParentGenusType
MessageList getMessagesByParentGenusType(Type messageGenusType) throws OperationFailedException, PermissionDeniedException Gets aMessageListcorresponding to the given message genusTypeand include any additional messages with genus types derived from the specifiedType.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
Messagelist - Throws:
NullArgumentException-messageGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByRecordType
MessageList getMessagesByRecordType(Type messageRecordType) throws OperationFailedException, PermissionDeniedException Gets aMessageListcontaining the given message recordType. 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
Messagelist - Throws:
NullArgumentException-messageRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesBySentTime
MessageList getMessagesBySentTime(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aMessageListsent 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 dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesBySentTimeAndGenusType
MessageList getMessagesBySentTimeAndGenusType(Type messageGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aMessageListof 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 typefrom- starting dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-messageGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesFromSender
MessageList getMessagesFromSender(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets aMessageListsent 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
Messagelist - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByGenusTypeFromSender
MessageList getMessagesByGenusTypeFromSender(Id resourceId, Type messageGenusType) throws OperationFailedException, PermissionDeniedException Gets aMessageListof 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 IdmessageGenusType- a message genus type- Returns:
- the returned
Messagelist - Throws:
NullArgumentException-resourceIdormessageGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesBySentTimeFromSender
MessageList getMessagesBySentTimeFromSender(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aMessageListsent 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 Idfrom- starting dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesBySentTimeAndGenusTypeFromSender
MessageList getMessagesBySentTimeAndGenusTypeFromSender(Id resourceId, Type messageGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aMessageListof 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 IdmessageGenusType- a message genus typefrom- starting dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, messageGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesForRecipient
MessageList getMessagesForRecipient(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets aMessageListreceived 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
Messagelist - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByGenusTypeForRecipient
MessageList getMessagesByGenusTypeForRecipient(Id resourceId, Type messageGenusType) throws OperationFailedException, PermissionDeniedException Gets aMessageListreceived 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 IdmessageGenusType- a message genus type- Returns:
- the returned
Messagelist - Throws:
NullArgumentException-resourceIdormessageGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByReceivedTimeForRecipient
MessageList getMessagesByReceivedTimeForRecipient(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aMessageListreceived 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 Idfrom- starting dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByReceivedTimeAndGenusTypeForRecipient
MessageList getMessagesByReceivedTimeAndGenusTypeForRecipient(Id resourceId, Type messageGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aMessageListof 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 IdmessageGenusType- a message genus typefrom- starting dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-resourceId, messageGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesFromSenderForRecipient
MessageList getMessagesFromSenderForRecipient(Id senderResourceId, Id recipientResourceId) throws OperationFailedException, PermissionDeniedException Gets aMessageListsent 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 IdrecipientResourceId- a resource Id- Returns:
- the returned
Messagelist - Throws:
NullArgumentException-senderResourceIdorrecipientResourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByGenusTypeFromSenderForRecipient
MessageList getMessagesByGenusTypeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, Type messageGenusType) throws OperationFailedException, PermissionDeniedException Gets aMessageListof 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 IdrecipientResourceId- a resource IdmessageGenusType- a message genus type- Returns:
- the returned
Messagelist - Throws:
NullArgumentException-senderResourceId, recipientResourceIdormessageGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessagesByReceivedTimeFromSenderForRecipient
MessageList getMessagesByReceivedTimeFromSenderForRecipient(Id senderResourceId, Id recipientResourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets aMessageListby 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 IdrecipientResourceId- a resource Idfrom- starting dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-senderResourceId, recipientResourceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 aMessageListof 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 IdrecipientResourceId- a resource IdmessageGenusType- a message genus typefrom- starting dateto- ending date- Returns:
- the returned
Messagelist - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-senderResourceId, recipientResourceId, messageGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMessages
Gets allMessages. 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 requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-