Package nl.knaw.dans.layerstore
Class LayerManagerImpl
java.lang.Object
nl.knaw.dans.layerstore.LayerManagerImpl
- All Implemented Interfaces:
LayerManager
-
Constructor Summary
ConstructorsConstructorDescriptionLayerManagerImpl
(@NonNull Path stagingRoot, @NonNull ArchiveProvider archiveProvider, @NonNull LayerArchiver layerArchiver) Creates a new LayerManagerImpl. -
Method Summary
Modifier and TypeMethodDescriptiongetLayer
(long id) Returns the layer with the given id.Returns the current top layer.Lists all layer IDs that are currently managed.Closes the current top layer (if present) and creates a new top layer.
-
Constructor Details
-
LayerManagerImpl
public LayerManagerImpl(@NonNull @NonNull Path stagingRoot, @NonNull @NonNull ArchiveProvider archiveProvider, @NonNull @NonNull LayerArchiver layerArchiver) throws IOException Creates a new LayerManagerImpl.- Parameters:
stagingRoot
- the root directory for staging layers.archiveProvider
- the archive provider to use.layerArchiver
- the layer archiver to use.- Throws:
IOException
- if the staging root directory cannot be created.
-
-
Method Details
-
newTopLayer
Description copied from interface:LayerManager
Closes the current top layer (if present) and creates a new top layer. The old top layer will be scheduled for archiving.- Specified by:
newTopLayer
in interfaceLayerManager
- Throws:
IOException
-
listLayerIds
Description copied from interface:LayerManager
Lists all layer IDs that are currently managed.- Specified by:
listLayerIds
in interfaceLayerManager
- Returns:
- a list of layer IDs
- Throws:
IOException
- if an I/O error occurs
-
getLayer
Description copied from interface:LayerManager
Returns the layer with the given id.- Specified by:
getLayer
in interfaceLayerManager
- Parameters:
id
- the id of the layer- Returns:
- the layer
-
getTopLayer
Description copied from interface:LayerManager
Returns the current top layer.- Specified by:
getTopLayer
in interfaceLayerManager
- Returns:
- the current top layer
-