OSID Logo
OSID Specifications
messaging package
Version 3.0.0
Release Candidate Preview
Interfaceosid.messaging.MailboxAdminSession
Implementsosid.OsidSession
Description

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.

MethodcanCreateMailboxes
Description

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.

Returnboolean false if Mailbox creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateMailboxWithRecordTypes
Description

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.

Parametersosid.type.Type[]mailboxRecordTypesarray of mailbox record types
Returnboolean true if Mailbox creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT mailboxRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetMailboxFormForCreate
Description

Gets the mailbox form for creating new mailboxes.

Parametersosid.type.Type[]mailboxRecordTypesarray of mailbox record types
Returnosid.messaging.MailboxFormthe mailbox form
ErrorsNULL_ARGUMENT mailboxRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateMailbox
Description

Creates a new Mailbox.

Parametersosid.messaging.MailboxFormmailboxFormthe form for this Mailbox
Returnosid.messaging.Mailboxthe new Mailbox
ErrorsILLEGAL_STATE mailboxForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT mailboxForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED mailboxForm did not originate from getMailboxFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateMailboxes
Description

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.

Returnboolean false if Mailbox modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetMailboxFormForUpdate
Description

Gets the mailbox form for updating an existing mailbox. A new mailbox form should be requested for each update transaction.

Parametersosid.id.IdmailboxIdthe Id of the Mailbox
Returnosid.messaging.MailboxFormthe mailbox form
ErrorsNOT_FOUND mailboxId is not found
NULL_ARGUMENT mailboxId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateMailbox
Description

Updates an existing mailbox.

Parametersosid.messaging.MailboxFormmailboxFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE mailboxForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT mailboxForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED mailboxForm did not originate from getMailboxFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteMailboxes
Description

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.

Returnboolean false if Mailbox deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteMailbox
Description

Deletes a Mailbox.

Parametersosid.id.IdmailboxIdthe Id of the Mailbox to remove
ErrorsNOT_FOUND mailboxId not found
NULL_ARGUMENT mailboxId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageMailboxAliases
Description

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.

Returnboolean false if Mailbox aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasMailbox
Description

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.

Parametersosid.id.IdmailboxIdthe Id of a Mailbox
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND mailboxId not found
NULL_ARGUMENT mailboxId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.