Interface MessageMailboxAssignmentSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface MessageMailboxAssignmentSession extends 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 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canAssignMessagesToMailbox

      boolean canAssignMessagesToMailbox(Id mailboxId)
      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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer assignment operations to unauthorized users.
      Parameters:
      mailboxId - the Id of the Mailbox
      Returns:
      false if messaging is not authorized, true otherwise
      Throws:
      NullArgumentException - mailboxId is null
      Compliance:
      mandatory - This method must be implemented.
    • getAssignableMailboxIds

      IdList getAssignableMailboxIds(Id mailboxId) throws OperationFailedException
      Gets a list of mailboxes including and under the given mailbox node in which any message can be assigned.
      Parameters:
      mailboxId - the Id of the Mailbox
      Returns:
      list of assignable mailbox Ids
      Throws:
      NullArgumentException - mailboxId is null
      OperationFailedException - 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 - the Id of the Mailbox
      messageId - the Id of the Message
      Returns:
      list of assignable mailbox Ids
      Throws:
      NullArgumentException - mailboxId or messageId is null
      OperationFailedException - 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 existing Message to a Mailbox .
      Parameters:
      messageId - the Id of the Message
      mailboxId - the Id of the Mailbox
      Throws:
      AlreadyExistsException - messageId is already assigned to mailboxId
      NotFoundException - messageId or mailboxId not found
      NullArgumentException - messageId or mailboxId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignMessageFromMailbox

      void unassignMessageFromMailbox(Id messageId, Id mailboxId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a Message from a Mailbox .
      Parameters:
      messageId - the Id of the Message
      mailboxId - the Id of the Mailbox
      Throws:
      NotFoundException - messageId or mailboxId or messageId not assigned to mailboxId
      NullArgumentException - messageId or mailboxId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • reassignCreditToMailbox

      void reassignCreditToMailbox(Id messageId, Id fromMailboxId, Id toMailboxId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Moves a Message from one Mailbox to another. Mappings to other Mailboxes are unaffected.
      Parameters:
      messageId - the Id of the Message
      fromMailboxId - the Id of the current Mailbox
      toMailboxId - the Id of the destination Mailbox
      Throws:
      AlreadyExistsException - messageId already assigned to mailboxId
      NotFoundException - messageId, fromMailboxId , or toMailboxId not found or messageId not mapped to fromMailboxId
      NullArgumentException - messageId, fromMailboxId , or toMailboxId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.