Interface RequestBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, RequestAdminSession
This session creates, updates, and deletes Requests 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 an
Request , an RequestForm is requested using
getRequestFormsForCreate() specifying the desired queue, resource, record
Types or none if no record Types are needed. Each of the
returned RequestForms 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 an RequestForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each RequestForm corresponds to
an attempted transaction.
The RequestForms returned from
getRequestFormsForCreate() may be linked to the originating request
through the peer Ids of the RequestForm . In the case
where there may be duplicates, any RequestForm of the same peer
Ids may be used for a create operation.
Once a batch of RequestForms are submitted for create, a
CreateResponse is returned for each RequestForm , although
the ordering is not defined. Only errors that pertain to the entire create
operation are returned from createRequests() , errors specific to
an individual RequestForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the
originating RequestForm through the RequestForm Id
.
For updates, RequestForms are requested to the Request
Id that is to be updated using getRequestFormsForUpdate()
where the reference Id in the RequestForm may be used to
link the request. Similarly, the RequestForm has metadata about
the data that can be updated and it can perform validation before
submitting the update. The RequestForm can only be used once for a
successful update and cannot be reused.
Once a batch of RequestForms are submitted for update, an
UpdateResponse is returned for each RequestForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateRequests() , errors specific to
an individual RequestForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the
originating RequestForm through the RequestForm Id
.
The delete operations delete Requests in bulk. To unmap an
Request 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 TypeMethodDescriptionaliasRequests(AliasRequestList aliasRequests) Adds anIdto anRequestfor the purpose of creating compatibility.createRequests(RequestBatchFormList requestForms) Creates a new set ofRequests.Deletes allRequestsin thisDistributor.Deletes requests expired before the given date.deleteRequests(IdList requestIds) Deletes requests for the givenIds.deleteRequestsForQueue(Id queueId) Deletes requests for the given queue.deleteRequestsForResource(Id resourceId) Deletes requests for the given resource.getRequestFormsForCreate(RequestPeerList peers, Type[] requestRecordTypes) Gets the request forms for creating a bunch of new requests.getRequestFormsForUpdate(IdList requestIds) Gets the request forms for updating an existing set of requests.updateRequests(RequestBatchFormList requestForms) 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 RequestAdminSession
aliasRequest, canCancelRequests, cancelRequest, canCreateRequests, canCreateRequestWithRecordTypes, canDeleteRequests, canManageRequestAliases, canUpdateRequests, createRequest, deleteRequest, getDistributor, getDistributorId, getRequestFormForCreate, getRequestFormForUpdate, submitRequest, updateRequestModifier and TypeMethodDescriptionvoidaliasRequest(Id requestId, Id aliasId) Adds anIdto aRequestfor the purpose of creating compatibility.booleanTests if this user can cancelRequests.voidcancelRequest(Id requestId) Cancels aRequest.booleanTests if this user can createRequests.booleancanCreateRequestWithRecordTypes(Type[] requestRecordTypes) Tests if this user can create a singleRequestusing the desired record types.booleanTests if this user can deleteRequests.booleanTests if this user can manageIdaliases forRequests.booleanTests if this user can updateRequests.createRequest(RequestForm requestForm) Creates a newRequest.voiddeleteRequest(Id requestId) Deletes aRequest.Gets theDistributorassociated with this session.Gets theDistributorIdassociated with this session.getRequestFormForCreate(Id resourceId, Id queueId, Type[] requestRecordTypes) Gets the request form for creating new requests.getRequestFormForUpdate(Id requestId) Gets the request form for updating an existing request.voidsubmitRequest(Id requestId) Submits aRequest.voidupdateRequest(RequestForm requestForm) Updates an existing request.
-
Method Details
-
getRequestFormsForCreate
RequestBatchFormList getRequestFormsForCreate(RequestPeerList peers, Type[] requestRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request forms for creating a bunch of new requests. A form is returned for each queue and resource pair.- Parameters:
peers- the relationship peersrequestRecordTypes- array of request record types to be included in each create operation or an empty list if none- Returns:
- the request forms
- Throws:
NotFoundException- aqueueIdorresourceIdis not foundNullArgumentException-peersorrequestRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createRequests
CreateResponseList createRequests(RequestBatchFormList requestForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofRequests. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
requestForms- the request forms- Returns:
- the create responses
- Throws:
NullArgumentException-requestFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRequestFormsForUpdate
RequestBatchFormList getRequestFormsForUpdate(IdList requestIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request forms for updating an existing set of requests. A new request form should be requested for each update transaction.- Parameters:
requestIds- theIdsof theRequest- Returns:
- the request form
- Throws:
NotFoundException- anrequestIdis not foundNullArgumentException-requestIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRequests
UpdateResponseList updateRequests(RequestBatchFormList requestForms) 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:
requestForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-requestFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllRequests
Deletes allRequestsin thisDistributor.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRequests
DeleteResponseList deleteRequests(IdList requestIds) throws OperationFailedException, PermissionDeniedException Deletes requests for the givenIds.- Parameters:
requestIds- theIdsof the requests to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-requestIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteRequestsForResource
DeleteResponseList deleteRequestsForResource(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.
-
deleteRequestsForQueue
DeleteResponseList deleteRequestsForQueue(Id queueId) throws OperationFailedException, PermissionDeniedException Deletes requests for the given queue.- Parameters:
queueId- anIdof a queue- Returns:
- the delete responses
- Throws:
NullArgumentException-queueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveRequestsByDate
DeleteResponseList deleteIneffectiveRequestsByDate(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.
-
aliasRequests
AliasResponseList aliasRequests(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anRequestfor 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, it is reassigned to the given requestId.- 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.
-