public interface StoragePlugin
AbstractStorageHandler
and don't implement this interface directly.
In order to enable a storage access check during the system check's StorageAccessChecker, override the method:
public boolean isAvailable()
Modifier and Type | Method and Description |
---|---|
boolean |
checkFixity(java.util.List<Fixity> fixities,
java.lang.String storedEntityIdentifier)
Calculates the fixities and checks that the file fixity hasn't changed.
The check is made against the union of the fixities list and the fixities the plugin implementation supports, for example: if the list contains SHA1 and MD5 but the plugin supports only MD5, than the SHA1 entry would be ignored. |
boolean |
deleteEntity(java.lang.String storedEntityIdentifier)
Deletes the entity from the storage
|
java.lang.String |
getFullFilePath(java.lang.String storedEntityIdentifier)
This method should return a full path that would be stored in the METS.
|
java.lang.String |
getLocalFilePath(java.lang.String storedEntityIdentifier)
Returns a local NFS path which can be used to access the file directly.
|
java.io.InputStream |
retrieveEntity(java.lang.String storedEntityIdentifier)
Used to read the entity data.
|
byte[] |
retrieveEntityByRange(java.lang.String storedEntityIdentifier,
long start,
long end)
This method returns an array of bytes containing the content of the StoredEntityIdentifier file within the defined Byte range.
|
java.lang.String |
storeEntity(java.io.InputStream is,
StoredEntityMetaData storedEntityMetadata)
Stores the entity sent to the function.
|
java.lang.String storeEntity(java.io.InputStream is, StoredEntityMetaData storedEntityMetadata) throws java.lang.Exception
is
- an input stream to read from, if necessary (the input steam isn't used when storedEntityMetadata.getCurrentFilePath isn't null and can be used instead).storedEntityMetadata
- some metadata about the entity, like its type (IE, FILE, MD, SIP) & location. See StoredEntityMetaData
.java.lang.Exception
- on any error when saving the entity.java.io.InputStream retrieveEntity(java.lang.String storedEntityIdentifier) throws java.io.IOException
storedEntityIdentifier
- the identifier returned by storeEntity.java.io.IOException
- when failing to get an input stream.boolean deleteEntity(java.lang.String storedEntityIdentifier) throws java.io.IOException
storedEntityIdentifier
- the identifier returned by storeEntity.java.io.IOException
- when an unexpected error occurs.boolean checkFixity(java.util.List<Fixity> fixities, java.lang.String storedEntityIdentifier) throws java.lang.Exception
AbstractStorageHandler.getChecksumUsingPlugin(String, String, String)
.fixities
- a list of the known file fixities to be compared with.
When the method is completed each element of the list should have its result set:
null if this fixity was ignored, True if the validation succeeded, False if the fixity value that was calculated doesn't match the value sent.
In the case of a failure, the value in a fixity element should be set to the new value.storedEntityIdentifier
- the identifier returned by storeEntity.java.lang.Exception
- on any unexpected error.java.lang.String getFullFilePath(java.lang.String storedEntityIdentifier)
storedEntityIdentifier
- the identifier returned by storeEntity.java.lang.String getLocalFilePath(java.lang.String storedEntityIdentifier)
AbstractStorageHandler.getTempStorageDirectory()
.
storedEntityIdentifier
- the identifier returned by storeEntity.byte[] retrieveEntityByRange(java.lang.String storedEntityIdentifier, long start, long end) throws java.lang.Exception
storedEntityIdentifier
- the identifier returned by storeEntity.start
- the starting Byte location of the desired range.end
- the ending Byte location of the desired range.java.lang.Exception