Interface HoldAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
HoldBatchAdminSession

public interface HoldAdminSession extends OsidSession

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 Details

    • getOublietteId

      Id getOublietteId()
      Gets the Oubliette Id associated with this session.
      Returns:
      the Oubliette Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getOubliette

      Gets the Oubliette associated with this session.
      Returns:
      the oubliette
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateHolds

      boolean canCreateHolds()
      Tests if this user can create Holds . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Hold will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if Hold creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateHoldWithRecordTypes

      boolean canCreateHoldWithRecordTypes(Type[] holdRecordTypes)
      Tests if this user can create a single Hold using the desired record types. While HoldManager.getHoldRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Hold . Providing an empty array tests if a Hold can be created with no records.
      Parameters:
      holdRecordTypes - array of hold record types
      Returns:
      true if Hold creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - holdRecordTypes is null
      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 - the Id for the issue
      resourceId - the Id for the resource
      holdRecordTypes - array of hold record types
      Returns:
      the hold form
      Throws:
      NotFoundException - issueId or resourceId is not found
      NullArgumentException - issueId, resourceId or holdRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - 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 - the Id for the issue
      agentId - the Id for the agent
      holdRecordTypes - array of hold record types
      Returns:
      the hold form
      Throws:
      NotFoundException - issueId or agentId is not found
      NullArgumentException - issueId, agentId or holdRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createHold

      Creates a new Hold .
      Parameters:
      holdForm - the form for this Hold
      Returns:
      the new Hold
      Throws:
      IllegalStateException - holdForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - holdForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - holdForm did not originate from getHoldFormForCreateForResource() or getHoldFormForCreateForAgent()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateHolds

      boolean canUpdateHolds()
      Tests if this user can update Holds . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Hold will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if Hold modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getHoldFormForUpdate

      HoldForm getHoldFormForUpdate(Id holdId) throws NotFoundException, OperationFailedException
      Gets the hold form for updating an existing hold. A new hold form should be requested for each update transaction.
      Parameters:
      holdId - the Id of the Hold
      Returns:
      the hold form
      Throws:
      NotFoundException - holdId is not found
      NullArgumentException - holdId is null
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • updateHold

      void updateHold(HoldForm holdForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing hold.
      Parameters:
      holdForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - holdForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - holdId or holdForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - holdForm did not originate from getHoldFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteHolds

      boolean canDeleteHolds()
      Tests if this user can delete Holds . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Hold will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if Hold deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteHold

      Deletes a Hold .
      Parameters:
      holdId - the Id of the Hold to remove
      Throws:
      NotFoundException - holdId not found
      NullArgumentException - holdId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageHoldAliases

      boolean canManageHoldAliases()
      Tests if this user can manage Id aliases for Holds . A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if Hold aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasHold

      Adds an Id to a Hold for the purpose of creating compatibility. The primary Id of the Hold is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another hold, it is reassigned to the given hold Id .
      Parameters:
      holdId - the Id of a Hold
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - holdId not found
      NullArgumentException - holdId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.