public class HoldsAPI extends RMModelRequest
Holds REST API Wrapper
Author:
Damian Ujma
  • Constructor Details

    • HoldsAPI

      public HoldsAPI(RMRestWrapper rmRestWrapper)
      Parameters:
      rmRestWrapper -
  • Method Details

    • getHold

      public Hold getHold(String holdId, String parameters)
      Gets a hold.
      Parameters:
      holdId - The identifier of a hold
      parameters - The URL parameters to add
      Returns:
      The Hold for the given holdId
      Throws:
      RuntimeException - for the following cases:
      • holdId is not a valid format
      • authentication fails
      • current user does not have permission to read holdId
      • holdId does not exist
    • getHold

      public Hold getHold(String holdId)
    • updateHold

      public Hold updateHold(Hold holdModel, String holdId, String parameters)
      Updates a hold.
      Parameters:
      holdModel - The hold model which holds the information
      holdId - The identifier of the hold
      parameters - The URL parameters to add
      Throws:
      RuntimeException - for the following cases:
      • the update request is invalid or holdId is not a valid format or holdModel is invalid
      • authentication fails
      • current user does not have permission to update holdId
      • holdId does not exist
    • updateHold

      public Hold updateHold(Hold holdModel, String holdId)
    • deleteHold

      public void deleteHold(String holdId)
      Deletes a hold.
      Parameters:
      holdId - The identifier of a hold
      Throws:
      RuntimeException - for the following cases:
      • holdId is not a valid format
      • authentication fails
      • current user does not have permission to delete holdId
      • holdId does not exist
    • deleteHoldWithReason

      public HoldDeletionReason deleteHoldWithReason(HoldDeletionReason reason, String holdId)
      Deletes a hold and stores a reason for deletion in the audit log.
      Parameters:
      reason - The reason for hold deletion
      holdId - The identifier of a hold
      Throws:
      RuntimeException - for the following cases:
      • holdId is not a valid format or reason is invalid
      • authentication fails
      • current user does not have permission to delete holdId
      • holdId does not exist
    • addChildToHold

      public HoldChild addChildToHold(HoldChild holdChild, String holdId, String parameters)
      Adds the relationship between a child and a parent hold.
      Parameters:
      holdChild - The hold child model
      holdId - The identifier of a hold
      parameters - The URL parameters to add
      Returns:
      The created Hold
      Throws:
      RuntimeException - for the following cases:
      • holdId is not a valid format or holdId is invalid
      • authentication fails
      • current user does not have permission to add children to holdId
      • holdId does not exist
    • addChildToHold

      public HoldChild addChildToHold(HoldChild holdChild, String holdId)
    • getChildren

      public HoldChildCollection getChildren(String holdId, String parameters)
      Gets the children of a hold.
      Parameters:
      holdId - The identifier of a hold
      parameters - The URL parameters to add
      Returns:
      The HoldChildCollection for the given holdId
      Throws:
      RuntimeException - for the following cases:
      • authentication fails
      • current user does not have permission to read holdId
      • holdId does not exist
    • getChildren

      public HoldChildCollection getChildren(String holdId)
    • deleteHoldChild

      public void deleteHoldChild(String holdId, String holdChildId, String parameters)
      Deletes the relationship between a child and a parent hold.
      Parameters:
      holdChildId - The identifier of hold child
      holdId - The identifier of a hold
      parameters - The URL parameters to add
      Throws:
      RuntimeException - for the following cases:
      • holdId or holdChildId is invalid
      • authentication fails
      • current user does not have permission to delete children from holdId
      • holdId does not exist
    • deleteHoldChild

      public void deleteHoldChild(String holdId, String holdChildId)
    • startBulkProcess

      public HoldBulkOperationEntry startBulkProcess(HoldBulkOperation holdBulkOperation, String hold, String parameters)
      Starts a bulk process for a hold.
      Parameters:
      holdBulkOperation - The bulk operation details
      hold - The identifier of a hold
      parameters - The URL parameters to add
      Returns:
      The HoldBulkOperationEntry for the started bulk process
      Throws:
      RuntimeException - for the following cases:
      • hold or holdBulkOperation is invalid
      • authentication fails
      • current user does not have permission to start a bulk process for hold
      • hold does not exist
    • startBulkProcess

      public HoldBulkOperationEntry startBulkProcess(HoldBulkOperation holdBulkOperation, String hold)
    • getBulkStatus

      public HoldBulkStatus getBulkStatus(String holdId, String holdBulkStatusId, String parameters)
      Gets the status of a bulk process for a hold.
      Parameters:
      holdId - The identifier of a hold
      holdBulkStatusId - The identifier of a bulk status operation
      parameters - The URL parameters to add
      Returns:
      The HoldBulkStatus for the given holdId and holdBulkStatusId
      Throws:
      RuntimeException - for the following cases:
      • holdId or holdBulkStatusId is invalid
      • authentication fails
      • current user does not have permission to get the bulk status for holdId
      • holdId or holdBulkStatusId does not exist
    • getBulkStatus

      public HoldBulkStatus getBulkStatus(String holdId, String holdBulkStatusId)
    • getBulkStatuses

      public HoldBulkStatusCollection getBulkStatuses(String holdId, String parameters)
      Gets the statuses of all bulk processes for a hold.
      Parameters:
      holdId - The identifier of a hold
      parameters - The URL parameters to add
      Returns:
      The HoldBulkStatusCollection for the given holdId
      Throws:
      RuntimeException - for the following cases:
      • holdId is invalid
      • authentication fails
      • current user does not have permission to get the bulk statuses for holdId
      • holdId does not exist
    • getBulkStatuses

      public HoldBulkStatusCollection getBulkStatuses(String holdId)
    • cancelBulkOperation

      public void cancelBulkOperation(String holdId, String bulkStatusId, BulkBodyCancel bulkBodyCancel, String parameters)
      Cancels a bulk operation for a hold.
      Parameters:
      holdId - The identifier of a hold
      bulkStatusId - The identifier of a bulk status operation
      bulkBodyCancel - The bulk body cancel model
      parameters - The URL parameters to add
      Throws:
      RuntimeException - for the following cases:
      • holdId, bulkStatusId or bulkBodyCancel is invalid
      • authentication fails
      • current user does not have permission to cancel the bulk operation for bulkStatusId
      • holdId or bulkStatusId does not exist
    • cancelBulkOperation

      public void cancelBulkOperation(String holdId, String bulkStatusId, BulkBodyCancel bulkBodyCancel)