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)