Interface ReceiptAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ReceiptBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can updateReceipts.Gets theMailboxassociated with this session.Gets theMailboxIdassociated with this session.getReceiptFormForUpdate(Id receiptId) Gets the receipt form for updating an existing receipt.voidupdateReceipt(ReceiptForm receiptForm) Updates an existing receipt.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
-
getMailboxId
Id getMailboxId()Gets theMailboxIdassociated with this session.- Returns:
- the
Mailbox Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getMailbox
Gets theMailboxassociated with this session.- Returns:
- the
Mailboxassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canUpdateReceipts
boolean canUpdateReceipts()Tests if this user can updateReceipts. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aReceiptwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifReceiptmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getReceiptFormForUpdate
ReceiptForm getReceiptFormForUpdate(Id receiptId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the receipt form for updating an existing receipt. A new receipt form should be requested for each update transaction.- Parameters:
receiptId- theIdof theMessage- Returns:
- the receipt form
- Throws:
NotFoundException-receiptIdis not foundNullArgumentException-receiptIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateReceipt
void updateReceipt(ReceiptForm receiptForm) throws OperationFailedException, PermissionDeniedException Updates an existing receipt.- Parameters:
receiptForm- the form containing the elements to be updated- Throws:
IllegalStateException-receiptFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-receiptFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-receiptFormdid not originate fromgetReceiptFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-