public interface ReceiptAdminSession extends OsidSession
This session updates Receipts.
A receipt exists for all
messages where receipts are supported. The data for the update is provided
by the consumer via the form object. OsidForms
are
requested for each update and may not be reused.
ReciptForms
are requested to the Receipt
Id
that is to be updated using
getReciptFormForUpdate().
Similarly, the ReceiptForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The RecieptForm
can only be used once for a successful update and cannot be reused.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
boolean |
canUpdateReceipts()
Tests if this user can update
Receipts. |
Mailbox |
getMailbox()
Gets the
Mailbox associated with this session. |
Id |
getMailboxId()
Gets the
Mailbox Id associated with this
session. |
ReceiptForm |
getReceiptFormForUpdate(Id receiptId)
Gets the receipt form for updating an existing receipt.
|
void |
updateReceipt(ReceiptForm receiptForm)
Updates an existing receipt.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getMailboxId()
Mailbox
Id
associated with this
session. Mailbox Id
associated with this sessionmandatory
- This method must be implemented. Mailbox getMailbox() throws OperationFailedException, PermissionDeniedException
Mailbox
associated with this session. Mailbox
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canUpdateReceipts()
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. false
if Receipt
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. ReceiptForm getReceiptFormForUpdate(Id receiptId) throws NotFoundException, OperationFailedException, PermissionDeniedException
receiptId
- the Id
of the Message
NotFoundException
- receiptId
is not
foundNullArgumentException
- receiptId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateReceipt(ReceiptForm receiptForm) throws OperationFailedException, PermissionDeniedException
receiptForm
- the form containing the elements to be updatedIllegalStateException
- receiptForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- receiptForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- receiptForm
did
not originate from getReceiptFormForUpdate()
mandatory
- This method must be implemented.