Interface HoldAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
HoldBatchAdminSession
This session creates, updates, and deletes Holds . 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
getHoldFormForCreate() specifying the desired relationship peers and
record Types or none if no record Types are needed. The
returned HoldForm 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 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.
For updates, HoldForms are requested to the Hold
Id that is to be updated using getHoldFormForUpdate() .
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.
The delete operations delete Holds . 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.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
getOublietteId
Id getOublietteId()Gets theOublietteIdassociated with this session.- Returns:
- the
Oubliette Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getOubliette
Gets theOublietteassociated with this session.- Returns:
- the oubliette
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateHolds
boolean canCreateHolds()Tests if this user can createHolds. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aHoldwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifHoldcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateHoldWithRecordTypes
Tests if this user can create a singleHoldusing the desired record types. WhileHoldManager.getHoldRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificHold. Providing an empty array tests if aHoldcan be created with no records.- Parameters:
holdRecordTypes- array of hold record types- Returns:
trueifHoldcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-holdRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getHoldFormForCreateForResource
HoldForm getHoldFormForCreateForResource(Id issueId, Id resourceId, Type[] holdRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the hold form for creating new holds. A new form should be requested for each create transaction.- Parameters:
issueId- theIdfor the issueresourceId- theIdfor the resourceholdRecordTypes- array of hold record types- Returns:
- the hold form
- Throws:
NotFoundException-issueIdorresourceIdis not foundNullArgumentException-issueId, resourceIdorholdRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
getHoldFormForCreateForAgent
HoldForm getHoldFormForCreateForAgent(Id issueId, Id agentId, Type[] holdRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the hold form for creating new holds. A new form should be requested for each create transaction.- Parameters:
issueId- theIdfor the issueagentId- theIdfor the agentholdRecordTypes- array of hold record types- Returns:
- the hold form
- Throws:
NotFoundException-issueIdoragentIdis not foundNullArgumentException-issueId, agentIdorholdRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createHold
Creates a newHold.- Parameters:
holdForm- the form for thisHold- Returns:
- the new
Hold - Throws:
IllegalStateException-holdFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-holdFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-holdFormdid not originate fromgetHoldFormForCreateForResource()orgetHoldFormForCreateForAgent()- Compliance:
mandatory- This method must be implemented.
-
canUpdateHolds
boolean canUpdateHolds()Tests if this user can updateHolds. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aHoldwill 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:
falseifHoldmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getHoldFormForUpdate
Gets the hold form for updating an existing hold. A new hold form should be requested for each update transaction.- Parameters:
holdId- theIdof theHold- Returns:
- the hold form
- Throws:
NotFoundException-holdIdis not foundNullArgumentException-holdIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
updateHold
Updates an existing hold.- Parameters:
holdForm- the form containing the elements to be updated- Throws:
IllegalStateException-holdFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-holdIdorholdFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-holdFormdid not originate fromgetHoldFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteHolds
boolean canDeleteHolds()Tests if this user can deleteHolds. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aHoldwill 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:
falseifHolddeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteHold
void deleteHold(Id holdId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aHold.- Parameters:
holdId- theIdof theHoldto remove- Throws:
NotFoundException-holdIdnot foundNullArgumentException-holdIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageHoldAliases
boolean canManageHoldAliases()Tests if this user can manageIdaliases forHolds. 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:
falseifHoldaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasHold
void aliasHold(Id holdId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aHoldfor the purpose of creating compatibility. The primaryIdof theHoldis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another hold, it is reassigned to the given holdId.- Parameters:
holdId- theIdof aHoldaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-holdIdnot foundNullArgumentException-holdIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-