Interface MessageMailboxAssignmentSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to re-assign Messages to
Mailboxes . A Message may map to multiple Mailbox objects
and removing the last reference to a Message is the equivalent of
deleting it. Each Mailbox may have its own authorizations
governing who is allowed to operate on it.
Moving or adding a reference of a Message to another
Mailbox is not a copy operation (eg: does not change its Id ).
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignMessageToMailbox(Id messageId, Id mailboxId) Adds an existingMessageto aMailbox.booleanTests if this user can alter message/mailbox mappings.booleancanAssignMessagesToMailbox(Id mailboxId) Tests if this user can alter message/mailbox mappings.getAssignableMailboxIds(Id mailboxId) Gets a list of mailboxes including and under the given mailbox node in which any message can be assigned.getAssignableMailboxIdsForMessage(Id mailboxId, Id messageId) Gets a list of mailboxes including and under the given mailbox node in which a specific message can be assigned.voidreassignCreditToMailbox(Id messageId, Id fromMailboxId, Id toMailboxId) Moves aMessagefrom oneMailboxto another.voidunassignMessageFromMailbox(Id messageId, Id mailboxId) Removes aMessagefrom aMailbox.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
-
canAssignMessages
boolean canAssignMessages()Tests if this user can alter message/mailbox mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Returns:
falseif mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canAssignMessagesToMailbox
Tests if this user can alter message/mailbox mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.- Parameters:
mailboxId- theIdof theMailbox- Returns:
falseif messaging is not authorized,trueotherwise- Throws:
NullArgumentException-mailboxIdisnull- Compliance:
mandatory- This method must be implemented.
-
getAssignableMailboxIds
Gets a list of mailboxes including and under the given mailbox node in which any message can be assigned.- Parameters:
mailboxId- theIdof theMailbox- Returns:
- list of assignable mailbox
Ids - Throws:
NullArgumentException-mailboxIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
getAssignableMailboxIdsForMessage
IdList getAssignableMailboxIdsForMessage(Id mailboxId, Id messageId) throws OperationFailedException Gets a list of mailboxes including and under the given mailbox node in which a specific message can be assigned.- Parameters:
mailboxId- theIdof theMailboxmessageId- theIdof theMessage- Returns:
- list of assignable mailbox
Ids - Throws:
NullArgumentException-mailboxIdormessageIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
assignMessageToMailbox
void assignMessageToMailbox(Id messageId, Id mailboxId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingMessageto aMailbox.- Parameters:
messageId- theIdof theMessagemailboxId- theIdof theMailbox- Throws:
AlreadyExistsException-messageIdis already assigned tomailboxIdNotFoundException-messageIdormailboxIdnot foundNullArgumentException-messageIdormailboxIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignMessageFromMailbox
void unassignMessageFromMailbox(Id messageId, Id mailboxId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aMessagefrom aMailbox.- Parameters:
messageId- theIdof theMessagemailboxId- theIdof theMailbox- Throws:
NotFoundException-messageIdormailboxIdormessageIdnot assigned tomailboxIdNullArgumentException-messageIdormailboxIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
reassignCreditToMailbox
void reassignCreditToMailbox(Id messageId, Id fromMailboxId, Id toMailboxId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Moves aMessagefrom oneMailboxto another. Mappings to otherMailboxesare unaffected.- Parameters:
messageId- theIdof theMessagefromMailboxId- theIdof the currentMailboxtoMailboxId- theIdof the destinationMailbox- Throws:
AlreadyExistsException-messageIdalready assigned tomailboxIdNotFoundException-messageId, fromMailboxId, ortoMailboxIdnot found ormessageIdnot mapped tofromMailboxIdNullArgumentException-messageId, fromMailboxId, ortoMailboxIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-