Class InventoryValidator
- java.lang.Object
-
- edu.wisc.library.ocfl.core.validation.InventoryValidator
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidvalidateCompatibleInventories(Inventory currentInventory, Inventory previousInventory)Validates that the currentInventory is a valid next inventory state from the previousInventory.static InventoryvalidateDeep(Inventory inventory)Validates the entireInventory.static InventoryvalidateShallow(Inventory inventory)Validates that anInventorymeets the minimum requirements to be serialized as valid OCFL inventory.static voidvalidateVersionStates(Inventory currentInventory, Inventory previousInventory)Validates that the two inventories contain the same version states, excluding the version in the current that is not in the previous.
-
-
-
Method Detail
-
validateShallow
public static Inventory validateShallow(Inventory inventory)
Validates that anInventorymeets the minimum requirements to be serialized as valid OCFL inventory. Only the HEAD version is validated.- Parameters:
inventory- the inventory to validate- Returns:
- the same inventory
- Throws:
InvalidInventoryException- when validation fails
-
validateDeep
public static Inventory validateDeep(Inventory inventory)
Validates the entireInventory. This is VERY SLOW.- Parameters:
inventory- the inventory to validate- Returns:
- the same inventory
- Throws:
InvalidInventoryException- when validation fails
-
validateVersionStates
public static void validateVersionStates(Inventory currentInventory, Inventory previousInventory)
Validates that the two inventories contain the same version states, excluding the version in the current that is not in the previous.- Parameters:
currentInventory- current inventorypreviousInventory- inventory immediately prior to the current inventory
-
validateCompatibleInventories
public static void validateCompatibleInventories(Inventory currentInventory, Inventory previousInventory)
Validates that the currentInventory is a valid next inventory state from the previousInventory. The must have the same id, type, digestAlgorithm, and contentDirectory values. Additionally, the currentInventory must be one version later than the previous, and all of the versions they have in common must be identical.- Parameters:
currentInventory- current inventorypreviousInventory- inventory immediately prior to the current inventory
-
-