Interface RequestTransactionAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RequestTransactionBatchAdminSession
This session creates, updates, and deletes RequestTransactions
. 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. Once a Request is created, it has not been
submitted. submitRequestTransaction submits a
RequesTransactiont for processing. Constraints on update and delete may
vary between creation and submission.
Create and update operations differ in their usage. To create a
RequestTransaction , a RequestTransactionForm is requested using
getRequestTransactionFormForCreate() specifying the desired record
Types or none if no record Types are needed. The returned
RequestTransactionForm 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 RequestTransactionForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each RequestTransactionForm
corresponds to an attempted transaction.
For updates, RequestTransactionForms are requested to the
RequestTransaction Id that is to be updated using
getRequestTransactionFormForUpdate() . Similarly, the
RequestTransactionForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
RequestTransactionForm can only be used once for a successful update and
cannot be reused.
The delete operations delete RequestTransactions . To unmap a
RequestTransaction from the current Distributor , the
RequestTransactionDistributorAssignmentSession should be used.
These delete operations attempt to remove the ReqeustTransaction
itself thus removing it from all known Distributor catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasRequestTransaction(Id requestTransactionId, Id aliasId) Adds anIdto aRequestTransactionfor the purpose of creating compatibility.booleanTests if this user can cancelRequestTransactions.voidcancelRequestTransaction(Id requestTransactionId) Cancels aRequestTransactionand the related requests.booleanTests if this user can createRequestTransactions.booleancanCreateRequestTransactionsWithRecordTypes(Type[] requestTransactionRecordTypes) Tests if this user can create a singleRequestTransactionusing the desired record types.booleanTests if this user can deleteRequestTransactions.booleanTests if this user can manageIdaliases forRequestTransactionss.booleanTests if this user can updateRequestTransactions.createRequestTransaction(RequestTransactionForm requestTransactionForm) Creates a newRequestTransaction.voiddeleteRequestTransaction(Id requestTransactionId) Deletes aRequestTransactionand the related requests.Gets theDistributorassociated with this session.Gets theDistributorIdassociated with this session.getRequestTransactionFormForCreate(Id brokerId, Id resourceId, Type[] requestTransactionRecordTypes) Gets the request transaction form for creating new request transactionss.getRequestTransactionFormForUpdate(Id requestTransactionId) Gets the request transaction form for updating an existing request.voidsubmitRequestTransaction(Id requestTransactionId) Submits aRequestTransactionand the related requests.voidupdateRequestTransaction(RequestTransactionForm requestTransactionForm) Updates an existing request transaction.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
-
getDistributorId
Id getDistributorId()Gets theDistributorIdassociated with this session.- Returns:
- the
Distributor Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getDistributor
Gets theDistributorassociated with this session.- Returns:
- the distributor
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRequestTransactions
boolean canCreateRequestTransactions()Tests if this user can createRequestTransactions. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRequestwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer transaction operations to an unauthorized user.- Returns:
falseifRequestTransactioncreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRequestTransactionsWithRecordTypes
Tests if this user can create a singleRequestTransactionusing the desired record types. WhileProvisioningManager.getRequestTransactionRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRequestTransaction. Providing an empty array tests if aRequestTransactioncan be created with no records.- Parameters:
requestTransactionRecordTypes- array of request transaction record types- Returns:
trueifRequestTransactioncreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-requestTransactionRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRequestTransactionFormForCreate
RequestTransactionForm getRequestTransactionFormForCreate(Id brokerId, Id resourceId, Type[] requestTransactionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request transaction form for creating new request transactionss. A new form should be requested for each create transaction.- Parameters:
brokerId- a brokerIdresourceId- a resourceIdrequestTransactionRecordTypes- array of request transaction record types- Returns:
- the request transaction form
- Throws:
NotFoundException-brokerIdorresourceIdis not foundNullArgumentException-brokerId, resourceId, orrequestTransactionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRequestTransaction
RequestTransaction createRequestTransaction(RequestTransactionForm requestTransactionForm) throws OperationFailedException, PermissionDeniedException Creates a newRequestTransaction.- Parameters:
requestTransactionForm- the form for thisRequestTransaction- Returns:
- the new
RequestTransaction - Throws:
IllegalStateException-requestTransactionFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-requestTransactionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-requestFormdid not originate fromgetRequestTransactionFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRequestTransactions
boolean canUpdateRequestTransactions()Tests if this user can updateRequestTransactions. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRequestTransactionwill 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:
falseifRequestTransactionmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRequestTransactionFormForUpdate
RequestTransactionForm getRequestTransactionFormForUpdate(Id requestTransactionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request transaction form for updating an existing request. A new request transaction form should be requested for each update transaction.- Parameters:
requestTransactionId- theIdof theRequestTransaction- Returns:
- the request transaction form
- Throws:
NotFoundException-requestTransactionIdis not foundNullArgumentException-requestTransactionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRequestTransaction
void updateRequestTransaction(RequestTransactionForm requestTransactionForm) throws OperationFailedException, PermissionDeniedException Updates an existing request transaction.- Parameters:
requestTransactionForm- the form containing the elements to be updated- Throws:
IllegalStateException-requestTransactionFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-requestTransactionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-requestFormdid not originate fromgetRequestTransactionFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
submitRequestTransaction
void submitRequestTransaction(Id requestTransactionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Submits aRequestTransactionand the related requests.- Parameters:
requestTransactionId- theIdof the request transaction to submit- Throws:
NotFoundException-requestTransactionIdis not foundNullArgumentException-requestTransactionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCancelRequestTransactions
boolean canCancelRequestTransactions()Tests if this user can cancelRequestTransactions. A return of true does not guarantee successful authorization. A return of false indicates that it is known canceling aRequestTransactionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer cancel operations to an unauthorized user.- Returns:
falseifRequestTransactioncancelation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
cancelRequestTransaction
void cancelRequestTransaction(Id requestTransactionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Cancels aRequestTransactionand the related requests.- Parameters:
requestTransactionId- theIdof the request transaction to cancel- Throws:
NotFoundException-requestTransactionIdis not foundNullArgumentException-requestTransactionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canDeleteRequestTransactions
boolean canDeleteRequestTransactions()Tests if this user can deleteRequestTransactions. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRequestTransactionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifRequestTransactiondeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRequestTransaction
void deleteRequestTransaction(Id requestTransactionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRequestTransactionand the related requests.- Parameters:
requestTransactionId- theIdof the request transaction to delete- Throws:
NotFoundException-requestTransactionIdis not foundNullArgumentException-requestTransactionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRequestTransactionAliases
boolean canManageRequestTransactionAliases()Tests if this user can manageIdaliases forRequestTransactionss. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifRequestTransactionaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRequestTransaction
void aliasRequestTransaction(Id requestTransactionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRequestTransactionfor the purpose of creating compatibility. The primaryIdof theRequestTransactionis determined by the provider. The newIdperforms as an alias to the primaryId.If the alias is a pointer to another request, it is reassigned to the given requestId.- Parameters:
requestTransactionId- theIdof aRequestTransactionaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-requestTransactionIdnot foundNullArgumentException-requestTransactionIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-