Class OcflExtensionRegistry
- java.lang.Object
-
- edu.wisc.library.ocfl.core.extension.OcflExtensionRegistry
-
public final class OcflExtensionRegistry extends Object
Registry for mapping extensions to their implementations. The following out-of-the-box extensions are pre-registered with a default implementation:- 0002-flat-direct-storage-layout:
FlatLayoutExtension - 0003-hash-and-id-n-tuple-storage-layout:
HashedNTupleIdEncapsulationLayoutExtension - 0004-hashed-n-tuple-storage-layout:
HashedNTupleLayoutExtension
- 0002-flat-direct-storage-layout:
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends OcflExtension>
Optional<T>lookup(String extensionName)Returns a registered extension implementation, if one exists.static voidregister(String extensionId, Class<? extends OcflExtension> extensionClass)Registers a new extension implementation.static voidremove(String extensionName)Removes an extension from the registry.
-
-
-
Method Detail
-
register
public static void register(String extensionId, Class<? extends OcflExtension> extensionClass)
Registers a new extension implementation.- Parameters:
extensionId- the id of the extension to registerextensionClass- the class that implements the
-
remove
public static void remove(String extensionName)
Removes an extension from the registry.- Parameters:
extensionName- the name of the extension to remove
-
lookup
public static <T extends OcflExtension> Optional<T> lookup(String extensionName)
Returns a registered extension implementation, if one exists.- Type Parameters:
T- the extension class- Parameters:
extensionName- the name of the extension to load- Returns:
- the extension
-
-