Package nl.knaw.dans.layerstore
Interface DatabaseBackedContentManager
- All Known Implementing Classes:
NoopDatabaseBackedContentManager
public interface DatabaseBackedContentManager
Controls selecting and processing content for storage in the database.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
postRetrieve
(String path, byte[] bytes) Process the content after it is retrieved from the database.byte[]
Process the content before it is stored in the database.boolean
Test if the content at the given path should be stored in the database.
-
Method Details
-
test
Test if the content at the given path should be stored in the database.- Parameters:
path
- the path of the content relative to the root of store- Returns:
- true if the content should be stored in the database, false otherwise
-
preStore
Process the content before it is stored in the database. The path of the file is also provided, so that the processor can decide to process the content based on the path. Note that the implementation should take care to select the same paths as inpostRetrieve(String, byte[])
The most important use case for this method is to compress the content before it is stored in the database.
- Parameters:
path
- the path of the content relative to the root of storebytes
- the content to be stored- Returns:
- the processed content
-
postRetrieve
Process the content after it is retrieved from the database. The path of the file is also provided, so that the processor can decide to process the content based on the path. Note that the implementation should take care to select the same paths as inpreStore(String, byte[])
The most important use case for this method is to decompress the content after it is retrieved from the database (assuming it was compressed before it was stored).
- Parameters:
path
- the path of the content relative to the root of storebytes
- the content to be processed- Returns:
- the processed content
-