Interface RequestTransactionBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, RequestTransactionAdminSession
This session creates, updates, and deletes RequestTransactions
in bulk. 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
RequestTransaction a RequestTransactionForm is requested using
getRequestTransactionFormsForCreate() specifying the desired
broker, resource, record Types or none if no record Types
are needed. Each of the returned RequestTransactionForms 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 a
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.
The RequestTransactionForms returned from
getRequestTransactionFormsForCreate() may be linked to the originating
request transaction through the peer Ids of the
RequestTransactionForm . In the case where there may be duplicates, any
RequestTransactionForm of the same peer Ids may be used
for a create operation.
Once a batch of RequestTransactionForms are submitted for
create, a CreateResponse is returned for each
RequestTransactionForm , although the ordering is not defined. Only
errors that pertain to the entire create operation are returned from
createRequestTransactions() , errors specific to an individual
RequestTransactionForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
RequestTransactionForm through the RequestTransactionForm
Id .
For updates, RequestTransactionForms are requested to the
RequestTransaction Id that is to be updated using
getRequestTransactionFormsForUpdate() where the reference Id in
the RequestTransactionForm may be used to link the request
transaction. 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.
Once a batch of RequestTransactionForms are submitted for
update, a UpdateResponse is returned for each
RequestTransactionForm , although the ordering is not defined. Only
errors that pertain to the entire update operation are returned from
updateRequestTransactions() , errors specific to an individual
RequestTransactionForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
RequestTransactionForm through the RequestTransactionForm
Id .
The delete operations delete RequestTransactions in bulk. To
unmap a RequestTransaction from the current Distributor ,
the RequestDistributorAssignmentSession should be used. These
delete operations attempt to remove the Request itself thus
removing it from all known Distributor catalogs. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasRequestTransactionss(AliasRequestList aliasRequests) Adds anIdto aRequestTransactionfor the purpose of creating compatibility.createRequestTransactions(RequestTransactionBatchFormList requestTransactionForms) Creates a new set ofRequestTransactions.Deletes allRequestTransactionsin thisDistributor.Deletes requests expired before the given date.deleteRequestTransactions(IdList requestTransactionIds) Deletes requests for the givenIds.deleteRequestTransactionsForBroker(Id brokerId) Deletes requests for the given broker.deleteRequestTransactionsForResource(Id resourceId) Deletes requests for the given resource.getRequestTransactionFormsForCreate(RequestTransactionPeerList peers, Type[] requestRecordTypes) Gets the request transaction forms for creating a bunch of new requests.getRequestTransactionFormsForUpdate(IdList requestTransactionIds) Gets the request transaction forms for updating an existing set of requests.updateRequestTransactions(RequestTransactionBatchFormList requestTransactionForms) Updates existing requests.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.Methods inherited from interface RequestTransactionAdminSession
aliasRequestTransaction, canCancelRequestTransactions, cancelRequestTransaction, canCreateRequestTransactions, canCreateRequestTransactionsWithRecordTypes, canDeleteRequestTransactions, canManageRequestTransactionAliases, canUpdateRequestTransactions, createRequestTransaction, deleteRequestTransaction, getDistributor, getDistributorId, getRequestTransactionFormForCreate, getRequestTransactionFormForUpdate, submitRequestTransaction, updateRequestTransactionModifier 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.
-
Method Details
-
getRequestTransactionFormsForCreate
RequestTransactionBatchFormList getRequestTransactionFormsForCreate(RequestTransactionPeerList peers, Type[] requestRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request transaction forms for creating a bunch of new requests. A form is returned for each broker and resource pair.- Parameters:
peers- the relationship peersrequestRecordTypes- array of request transaction record types to be included in each create operation or an empty list if none- Returns:
- the request transaction forms
- Throws:
NotFoundException- abrokerIdorresourceIdis not foundNullArgumentException-peersorrequestRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request transaction forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createRequestTransactions
CreateResponseList createRequestTransactions(RequestTransactionBatchFormList requestTransactionForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofRequestTransactions. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
requestTransactionForms- the request transaction forms- Returns:
- the create responses
- Throws:
NullArgumentException-requestTransactionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRequestTransactionFormsForUpdate
RequestTransactionBatchFormList getRequestTransactionFormsForUpdate(IdList requestTransactionIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request transaction forms for updating an existing set of requests. A new request transaction form should be requested for each update transaction.- Parameters:
requestTransactionIds- theIdsof theRequest- Returns:
- the request transaction form
- Throws:
NotFoundException- arequestTransactionIdis not foundNullArgumentException-requestTransactionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRequestTransactions
UpdateResponseList updateRequestTransactions(RequestTransactionBatchFormList requestTransactionForms) throws OperationFailedException, PermissionDeniedException Updates existing requests. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
requestTransactionForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-requestTransactionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllRequestTransactions
DeleteResponseList deleteAllRequestTransactions() throws OperationFailedException, PermissionDeniedExceptionDeletes allRequestTransactionsin thisDistributor.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRequestTransactions
DeleteResponseList deleteRequestTransactions(IdList requestTransactionIds) throws OperationFailedException, PermissionDeniedException Deletes requests for the givenIds.- Parameters:
requestTransactionIds- theIdsof the requests to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-requestTransactionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRequestTransactionsForResource
DeleteResponseList deleteRequestTransactionsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes requests for the given resource.- Parameters:
resourceId- anIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRequestTransactionsForBroker
DeleteResponseList deleteRequestTransactionsForBroker(Id brokerId) throws OperationFailedException, PermissionDeniedException Deletes requests for the given broker.- Parameters:
brokerId- anIdof a broker- Returns:
- the delete responses
- Throws:
NullArgumentException-brokerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveRequestTransactionsByDate
DeleteResponseList deleteIneffectiveRequestTransactionsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes requests expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasRequestTransactionss
AliasResponseList aliasRequestTransactionss(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aRequestTransactionfor the purpose of creating compatibility. The primaryIdof theRequestis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another request transaction, it is reassigned to the given request transactionId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-