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

This session creates, updates, and deletes Messages. 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 Message, a MessageForm is requested using getMessageFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned MessageForm 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 MessageForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each MessageForm corresponds to an attempted transaction.

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

The delete operations delete Messages. To unmap a Message from the current Mailbox, the MessageMailboxAssignmentSession should be used. These delete operations attempt to remove the Message itself thus removing it from all known Mailbox catalogs.

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

MethodgetMailboxId
Description

Gets the Mailbox Id associated with this session.

Returnosid.id.Idthe Mailbox Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetMailbox
Description

Gets the Mailbox associated with this session.

Returnosid.messaging.Mailboxthe Mailbox associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateMessages
Description

Tests if this user can create Messages. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Message will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

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

Tests if this user can create a single Message using the desired record types. While MessagingManager.getMessageRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Message. Providing an empty array tests if a Message can be created with no records.

Parametersosid.type.Type[]messageRecordTypesarray of message record types
Returnboolean true if Message creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT messageRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetMessageFormForCreate
Description

Gets the message form for creating new messages. A new form should be requested for each create transaction.

Parametersosid.type.Type[]messageRecordTypesarray of message record types
Returnosid.messaging.MessageFormthe message form
ErrorsNULL_ARGUMENT messageRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form for requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateMessage
Description

Creates a new Message.

Parametersosid.messaging.MessageFormmessageFormthe form for this Message
Returnosid.messaging.Messagethe new Message
ErrorsILLEGAL_STATE messageForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT messageForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED messageForm did not originate from getMessageFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateMessages
Description

Tests if this user can update Messages. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Message will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

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

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

Parametersosid.id.IdmessageIdthe Id of the Message
Returnosid.messaging.MessageFormthe message form
ErrorsNOT_FOUND messageId is not found
NULL_ARGUMENT messageId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateMessage
Description

Updates an existing message.

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

Tests if this user can delete Messages. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Message will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

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

Deletes a Message.

Parametersosid.id.IdmessageIdthe Id of the Message to remove
ErrorsNOT_FOUND messageId not found
NULL_ARGUMENT messageId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageMessageAliases
Description

Tests if this user can manage Id aliases for Messages. 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 Message aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasMessage
Description

Adds an Id to a Message for the purpose of creating compatibility. The primary Id of the Message is determined by the provider. The new Id performs as an alias to the primary Id. If the alias is a pointer to another message, it is reassigned to the given message Id.

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