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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasMailbox(Id mailboxId,
Id aliasId)
Adds an
Id to a Mailbox for the purpose
of creating compatibility. |
boolean |
canCreateMailboxes()
Tests if this user can create
Mailboxes. |
boolean |
canCreateMailboxWithRecordTypes(Type[] mailboxRecordTypes)
Tests if this user can create a single
Mailbox using
the desired record types. |
boolean |
canDeleteMailboxes()
Tests if this user can delete
Mailboxes. |
boolean |
canManageMailboxAliases()
Tests if this user can manage
Id aliases for
Mailboxes. |
boolean |
canUpdateMailboxes()
Tests if this user can update
Mailboxes. |
Mailbox |
createMailbox(MailboxForm mailboxForm)
Creates a new
Mailbox. |
void |
deleteMailbox(Id mailboxId)
Deletes a
Mailbox. |
MailboxForm |
getMailboxFormForCreate(Type[] mailboxRecordTypes)
Gets the mailbox form for creating new mailboxes.
|
MailboxForm |
getMailboxFormForUpdate(Id mailboxId)
Gets the mailbox form for updating an existing mailbox.
|
void |
updateMailbox(MailboxForm mailboxForm)
Updates an existing mailbox.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateMailboxes()
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. false if Mailbox creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateMailboxWithRecordTypes(Type[] mailboxRecordTypes)
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.mailboxRecordTypes - array of mailbox record types true if Mailbox creation using
the specified Types is supported, false
otherwiseNullArgumentException - mailboxRecordTypes
is null mandatory - This method must be implemented. MailboxForm getMailboxFormForCreate(Type[] mailboxRecordTypes) throws OperationFailedException, PermissionDeniedException
mailboxRecordTypes - array of mailbox record typesNullArgumentException - mailboxRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Mailbox createMailbox(MailboxForm mailboxForm) throws OperationFailedException, PermissionDeniedException
Mailbox. mailboxForm - the form for this Mailbox Mailbox IllegalStateException - mailboxForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - mailboxForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - mailboxForm did
not originate from getMailboxFormForCreate() mandatory - This method must be implemented. boolean canUpdateMailboxes()
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. false if Mailbox modification is
not authorized, true otherwisemandatory - This method must be implemented. MailboxForm getMailboxFormForUpdate(Id mailboxId) throws NotFoundException, OperationFailedException, PermissionDeniedException
mailboxId - the Id of the Mailbox NotFoundException - mailboxId is not
foundNullArgumentException - mailboxId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateMailbox(MailboxForm mailboxForm) throws OperationFailedException, PermissionDeniedException
mailboxForm - the form containing the elements to be updatedIllegalStateException - mailboxForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - mailboxForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - mailboxForm did
not originate from getMailboxFormForUpdate() mandatory - This method must be implemented. boolean canDeleteMailboxes()
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. false if Mailbox deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteMailbox(Id mailboxId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Mailbox. mailboxId - the Id of the Mailbox
to removeNotFoundException - mailboxId not foundNullArgumentException - mailboxId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageMailboxAliases()
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. false if Mailbox aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasMailbox(Id mailboxId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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. mailboxId - the Id of a Mailbox aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - mailboxId not foundNullArgumentException - mailboxId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.