Interface MailboxAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
MailboxBatchAdminSession

public interface MailboxAdminSession extends OsidSession

This session creates, updates, and deletes Mailboxes . The data for create and update is provided by the consumer via the form object. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create a Mailbox , a MailboxForm is requested using getMailboxFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned MailboxForm will indicate that it is to be used with a create operation and can be used to examine metdata or validate data prior to creation. Once the MailboxForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each MailboxForm corresponds to an attempted transaction.

For updates, MailboxForms are requested to the Mailbox Id that is to be updated using getMailboxFormForUpdate() . Similarly, the MailboxForm has metadata about the data that can be updated and it can perform validation before submitting the update. The MailboxForm can only be used once for a successful update and cannot be reused.

The delete operations delete Mailboxes .

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • canCreateMailboxes

      boolean canCreateMailboxes()
      Tests if this user can create Mailboxes . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Mailbox will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if Mailbox creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateMailboxWithRecordTypes

      boolean canCreateMailboxWithRecordTypes(Type[] mailboxRecordTypes)
      Tests if this user can create a single Mailbox using the desired record types. While MessagingManager.getMailboxRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Mailbox . Providing an empty array tests if a Mailbox can be created with no records.
      Parameters:
      mailboxRecordTypes - array of mailbox record types
      Returns:
      true if Mailbox creation using the specified Types is supported, false otherwise
      Throws:
      NullArgumentException - mailboxRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getMailboxFormForCreate

      MailboxForm getMailboxFormForCreate(Type[] mailboxRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the mailbox form for creating new mailboxes.
      Parameters:
      mailboxRecordTypes - array of mailbox record types
      Returns:
      the mailbox form
      Throws:
      NullArgumentException - mailboxRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createMailbox

      Creates a new Mailbox .
      Parameters:
      mailboxForm - the form for this Mailbox
      Returns:
      the new Mailbox
      Throws:
      IllegalStateException - mailboxForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - mailboxForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - mailboxForm did not originate from getMailboxFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateMailboxes

      boolean canUpdateMailboxes()
      Tests if this user can update Mailboxes . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Mailbox will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Mailbox modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getMailboxFormForUpdate

      Gets the mailbox form for updating an existing mailbox. A new mailbox form should be requested for each update transaction.
      Parameters:
      mailboxId - the Id of the Mailbox
      Returns:
      the mailbox form
      Throws:
      NotFoundException - mailboxId is not found
      NullArgumentException - mailboxId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateMailbox

      void updateMailbox(MailboxForm mailboxForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing mailbox.
      Parameters:
      mailboxForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - mailboxForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - mailboxForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - mailboxForm did not originate from getMailboxFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteMailboxes

      boolean canDeleteMailboxes()
      Tests if this user can delete Mailboxes . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Mailbox will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Returns:
      false if Mailbox deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteMailbox

      Deletes a Mailbox .
      Parameters:
      mailboxId - the Id of the Mailbox to remove
      Throws:
      NotFoundException - mailboxId not found
      NullArgumentException - mailboxId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageMailboxAliases

      boolean canManageMailboxAliases()
      Tests if this user can manage Id aliases for Mailboxes . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if Mailbox aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasMailbox

      Adds an Id to a Mailbox for the purpose of creating compatibility. The primary Id of the Mailbox is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another mailbox, it is reassigned to the given mailbox Id .
      Parameters:
      mailboxId - the Id of a Mailbox
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - mailboxId not found
      NullArgumentException - mailboxId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.