Interface HoldBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, HoldAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Holds 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
Hold , a HoldForm is requested using
getHoldFormsForCreate() specifying the desired issue and record
Types or none if no record Types are needed. Each of the returned
HoldForms 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 HoldForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each HoldForm corresponds to an attempted
transaction.
The HoldForms returned from getHoldFormsForCreate()
may be linked to the originating request through the peer Ids of
the HoldForm . In the case where there may be duplicates, any
HoldForm of the same peer Ids may be used for a create
operation.
Once a batch of HoldForms are submitted for create, a
CreateResponse is returned for each HoldForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createHolds() , errors specific to an
individual HoldForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
HoldForm through the HoldForm Id .
For updates, HoldForms are requested to the Hold
Id that is to be updated using getHoldFormsForUpdate()
where the reference Id in the HoldForm may be used to link
the request. Similarly, the HoldForm has metadata about the data
that can be updated and it can perform validation before submitting the
update. The HoldForm can only be used once for a successful update
and cannot be reused.
Once a batch of HoldForms are submitted for update, an
UpdateResponse is returned for each HoldForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateHolds() , errors specific to an
individual HoldForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
HoldForm through the HoldForm Id .
The delete operations delete Holds in bulk. To unmap a
Hold from the current Oubliette , the
HoldOublietteAssignmentSession should be used. These delete operations
attempt to remove the Hold itself thus removing it from all known
Oubliette catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasHolds(AliasRequestList aliasRequests) Adds anIdto aHoldfor the purpose of creating compatibility.createHolds(HoldBatchFormList holdForms) Creates a new set ofHolds.Deletes allHoldsin thisOubliette.deleteHolds(IdList holdIds) Deletes holds for the givenIds.deleteHoldsForAgent(Id agentId) Deletes holds for the given agent.deleteHoldsForIssue(Id issueId) Deletes holds for the given issue.deleteHoldsForResource(Id resourceId) Deletes holds for the given resource and any holds for agents related to the given resource.Deletes holds expired before the given date.getHoldFormsForCreateForAgents(HoldAgentPeerList peers, Type[] holdRecordTypes) Gets the hold forms for creating a bunch of new holds.getHoldFormsForCreateForResources(HoldResourcePeerList peers, Type[] holdRecordTypes) Gets the hold forms for creating a bunch of new holds.getHoldFormsForUpdate(IdList holdIds) Gets the hold forms for updating an existing set of holds.updateHolds(HoldBatchFormList holdForms) Updates existing holds.Methods inherited from interface HoldAdminSession
aliasHold, canCreateHolds, canCreateHoldWithRecordTypes, canDeleteHolds, canManageHoldAliases, canUpdateHolds, createHold, deleteHold, getHoldFormForCreateForAgent, getHoldFormForCreateForResource, getHoldFormForUpdate, getOubliette, getOublietteId, updateHoldModifier and TypeMethodDescriptionvoidAdds anIdto aHoldfor the purpose of creating compatibility.booleanTests if this user can createHolds.booleancanCreateHoldWithRecordTypes(Type[] holdRecordTypes) Tests if this user can create a singleHoldusing the desired record types.booleanTests if this user can deleteHolds.booleanTests if this user can manageIdaliases forHolds.booleanTests if this user can updateHolds.createHold(HoldForm holdForm) Creates a newHold.voiddeleteHold(Id holdId) Deletes aHold.getHoldFormForCreateForAgent(Id issueId, Id agentId, Type[] holdRecordTypes) Gets the hold form for creating new holds.getHoldFormForCreateForResource(Id issueId, Id resourceId, Type[] holdRecordTypes) Gets the hold form for creating new holds.getHoldFormForUpdate(Id holdId) Gets the hold form for updating an existing hold.Gets theOublietteassociated with this session.Gets theOublietteIdassociated with this session.voidupdateHold(HoldForm holdForm) Updates an existing hold.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
-
getHoldFormsForCreateForAgents
HoldBatchFormList getHoldFormsForCreateForAgents(HoldAgentPeerList peers, Type[] holdRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the hold forms for creating a bunch of new holds. A form is returned for each supplied agent and issue pair.- Parameters:
peers- the hold peersholdRecordTypes- array of hold record types to be included in each create operation or an empty list if none- Returns:
- the hold forms
- Throws:
NotFoundException- anissueIdoragentIdis not foundNullArgumentException-peersorholdRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
getHoldFormsForCreateForResources
HoldBatchFormList getHoldFormsForCreateForResources(HoldResourcePeerList peers, Type[] holdRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the hold forms for creating a bunch of new holds. A form is returned for each supplied resource and issue pair.- Parameters:
peers- the hold peersholdRecordTypes- array of hold record types to be included in each create operation or an empty list if none- Returns:
- the hold forms
- Throws:
NotFoundException- anissueIdorresourceIdis not foundNullArgumentException-peersorholdRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createHolds
CreateResponseList createHolds(HoldBatchFormList holdForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofHolds. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
holdForms- the hold forms- Returns:
- the create responses
- Throws:
NullArgumentException-holdFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getHoldFormsForUpdate
HoldBatchFormList getHoldFormsForUpdate(IdList holdIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the hold forms for updating an existing set of holds. A new hold form should be requested for each update transaction.- Parameters:
holdIds- theIdsof theHold- Returns:
- the hold form
- Throws:
NotFoundException- aholdIdis not foundNullArgumentException-holdIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateHolds
UpdateResponseList updateHolds(HoldBatchFormList holdForms) throws OperationFailedException, PermissionDeniedException Updates existing holds. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
holdForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-holdFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllHolds
Deletes allHoldsin thisOubliette.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteHolds
DeleteResponseList deleteHolds(IdList holdIds) throws OperationFailedException, PermissionDeniedException Deletes holds for the givenIds.- Parameters:
holdIds- theIdsof the holds to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-holdIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteHoldsForIssue
DeleteResponseList deleteHoldsForIssue(Id issueId) throws OperationFailedException, PermissionDeniedException Deletes holds for the given issue.- Parameters:
issueId- theIdof an issue- Returns:
- the delete responses
- Throws:
NullArgumentException-issueIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteHoldsForAgent
DeleteResponseList deleteHoldsForAgent(Id agentId) throws OperationFailedException, PermissionDeniedException Deletes holds for the given agent.- Parameters:
agentId- theIdof an agent- Returns:
- the delete responses
- Throws:
NullArgumentException-agentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteHoldsForResource
DeleteResponseList deleteHoldsForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes holds for the given resource and any holds for agents related to the given resource.- Parameters:
resourceId- theIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveHoldsByDate
DeleteResponseList deleteIneffectiveHoldsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes holds 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.
-
aliasHolds
AliasResponseList aliasHolds(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aHoldfor the purpose of creating compatibility. The primaryIdof theHoldis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another hold, it is reassigned to the given holdId.- 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.
-