OSID Logo
OSID Specifications
messaging package
Version 3.1.0
Interfaceosid.messaging.ReceiptAdminSession
Implementsosid.OsidSession
Implemented Byosid.messaging.batch.ReceiptBatchAdminSession
Used Byosid.messaging.MessagingManager
osid.messaging.MessagingProxyManager
Description

This session creates, updates, and deletes Receipts. A receipt exists for all messages where receipts are supported. 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 Receipt, a ReceiptForm is requested using getReceiptFormForCreate() specifying the desired Message and record Types or none if no record Types are needed. The returned ReceiptForm will indicate that it is to be used with a create operation and can be used to examine metadata or validate data prior to creation. Once the ReceiptForm is submitted to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each ReceiptForm corresponds to an attempted transaction.

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

The delete operations delete Receipts. These delete operations attempt to remove the Receipt 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.

Like all OsidSessions, ReceiptAdminSessions are dedicated to single processing threads and a single authenticated user.

MethodgetMailboxId
Description

Gets the Mailbox Id associated with this session.

Returnosid.id.Id the Mailbox Id associated with this session
Compliancemandatory This method must be implemented.
MethodgetMailbox
Description

Gets the Mailbox associated with this session.

Returnosid.messaging.Mailbox the Mailbox associated with this session
ErrorsOPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanCreateReceipts
Description

Tests if this user can create Receipts. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Receipt 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 Receipt creation is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodcanCreateReceiptWithRecordTypes
Description

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

Parametersosid.type.Type[]receiptRecordTypes array of receipt record types
Returnboolean true if Receipt creation using the specified Types is supported, false otherwise
ErrorsNULL_ARGUMENT receiptRecordTypes is null
Compliancemandatory This method must be implemented.
MethodgetReceiptFormForCreate
Description

Gets the receipt form for creating new receipts. A new form should be requested for each create transaction.

Parametersosid.id.IdmessageId the Id of the Message
osid.type.Type[]receiptRecordTypes array of receipt record types
Returnosid.messaging.ReceiptForm the receipt form
ErrorsNOT_FOUND messageId is not found
NULL_ARGUMENT messageId or receiptRecordTypes is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED unable to get form for requested record types
Compliancemandatory This method must be implemented.
MethodcreateReceipt
Description

Creates a new Receipt.

Parametersosid.messaging.ReceiptFormreceiptForm the form for this Receipt
Returnosid.messaging.Receipt the new Receipt
ErrorsILLEGAL_STATE receiptForm already used in a create transaction
INVALID_ARGUMENT one or more of the form elements is invalid
NULL_ARGUMENT receiptForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED receiptForm did not originate from getReceiptFormForCreate()
Compliancemandatory This method must be implemented.
MethodcanUpdateReceipts
Description

Tests if this user can update Receipts. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Receipt 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 Receipt modification is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodgetReceiptFormForUpdate
Description

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

Parametersosid.id.IdreceiptId the Id of the Receipt
Returnosid.messaging.ReceiptForm the receipt form
ErrorsNOT_FOUND receiptId is not found
NULL_ARGUMENT receiptId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodupdateReceipt
Description

Updates an existing receipt.

Parametersosid.messaging.ReceiptFormreceiptForm the form containing the elements to be updated
ErrorsILLEGAL_STATE receiptForm already used in an update transaction
INVALID_ARGUMENT the form contains an invalid value
NULL_ARGUMENT receiptForm is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
UNSUPPORTED receiptForm did not originate from getReceiptFormForUpdate()
Compliancemandatory This method must be implemented.
MethodcanDeleteReceipts
Description

Tests if this user can delete Receipts. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Receipt 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 Receipt deletion is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethoddeleteReceipt
Description

Deletes a Receipt.

Parametersosid.id.IdreceiptId the Id of the Receipt to remove
ErrorsNOT_FOUND receiptId not found
NULL_ARGUMENT receiptId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.
MethodcanManageReceiptAliases
Description

Tests if this user can manage Id aliases for Receipts. 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 Receipt aliasing is not authorized, true otherwise
Compliancemandatory This method must be implemented.
MethodaliasReceipt
Description

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

Parametersosid.id.IdreceiptId the Id of a Receipt
osid.id.IdaliasId the alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND receiptId not found
NULL_ARGUMENT aliasId or receiptId is null
OPERATION_FAILED unable to complete request
PERMISSION_DENIED authorization failure
Compliancemandatory This method must be implemented.