Interface MailboxAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
MailboxBatchAdminSession
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 Summary
Modifier and TypeMethodDescriptionvoidaliasMailbox(Id mailboxId, Id aliasId) Adds anIdto aMailboxfor the purpose of creating compatibility.booleanTests if this user can createMailboxes.booleancanCreateMailboxWithRecordTypes(Type[] mailboxRecordTypes) Tests if this user can create a singleMailboxusing the desired record types.booleanTests if this user can deleteMailboxes.booleanTests if this user can manageIdaliases forMailboxes.booleanTests if this user can updateMailboxes.createMailbox(MailboxForm mailboxForm) Creates a newMailbox.voiddeleteMailbox(Id mailboxId) Deletes aMailbox.getMailboxFormForCreate(Type[] mailboxRecordTypes) Gets the mailbox form for creating new mailboxes.getMailboxFormForUpdate(Id mailboxId) Gets the mailbox form for updating an existing mailbox.voidupdateMailbox(MailboxForm mailboxForm) Updates an existing mailbox.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
-
canCreateMailboxes
boolean canCreateMailboxes()Tests if this user can createMailboxes. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aMailboxwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifMailboxcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateMailboxWithRecordTypes
Tests if this user can create a singleMailboxusing the desired record types. WhileMessagingManager.getMailboxRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificMailbox. Providing an empty array tests if aMailboxcan be created with no records.- Parameters:
mailboxRecordTypes- array of mailbox record types- Returns:
trueifMailboxcreation using the specifiedTypesis supported,falseotherwise- Throws:
NullArgumentException-mailboxRecordTypesisnull- 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-mailboxRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createMailbox
Mailbox createMailbox(MailboxForm mailboxForm) throws OperationFailedException, PermissionDeniedException Creates a newMailbox.- Parameters:
mailboxForm- the form for thisMailbox- Returns:
- the new
Mailbox - Throws:
IllegalStateException-mailboxFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-mailboxFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-mailboxFormdid not originate fromgetMailboxFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateMailboxes
boolean canUpdateMailboxes()Tests if this user can updateMailboxes. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aMailboxwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifMailboxmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getMailboxFormForUpdate
MailboxForm getMailboxFormForUpdate(Id mailboxId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the mailbox form for updating an existing mailbox. A new mailbox form should be requested for each update transaction.- Parameters:
mailboxId- theIdof theMailbox- Returns:
- the mailbox form
- Throws:
NotFoundException-mailboxIdis not foundNullArgumentException-mailboxIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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-mailboxFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-mailboxFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-mailboxFormdid not originate fromgetMailboxFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteMailboxes
boolean canDeleteMailboxes()Tests if this user can deleteMailboxes. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aMailboxwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifMailboxdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteMailbox
void deleteMailbox(Id mailboxId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aMailbox.- Parameters:
mailboxId- theIdof theMailboxto remove- Throws:
NotFoundException-mailboxIdnot foundNullArgumentException-mailboxIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageMailboxAliases
boolean canManageMailboxAliases()Tests if this user can manageIdaliases forMailboxes. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifMailboxaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasMailbox
void aliasMailbox(Id mailboxId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aMailboxfor the purpose of creating compatibility. The primaryIdof theMailboxis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another mailbox, it is reassigned to the given mailboxId.- Parameters:
mailboxId- theIdof aMailboxaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-mailboxIdnot foundNullArgumentException-mailboxIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-