org.fcrepo.server.storage.lowlevel
Interface ILowlevelStorage

All Known Implementing Classes:
AkubraLowlevelStorage, AkubraLowlevelStorageModule, DefaultLowlevelStorage, DefaultLowlevelStorageModule

public interface ILowlevelStorage

Provides read/write access to all serialized objects and managed datastream content within Fedora.

Author:
Bill Niebel

Method Summary
 long addDatastream(String dsKey, InputStream content)
          Sets the content of a new datastream version.
 void addObject(String objectKey, InputStream content)
          Adds a new object.
 void auditDatastream()
          Performs a consistency check against the datastream index if such an index exists.
 void auditObject()
          Performs a consistency check against the object index if such an index exists.
 void rebuildDatastream()
          Reconstructs the datastream index if such an index exists.
 void rebuildObject()
          Reconstructs the object index if such an index exists.
 void removeDatastream(String dsKey)
          Removes the content of an existing datastream version.
 void removeObject(String objectKey)
          Removes an object.
 long replaceDatastream(String dsKey, InputStream content)
          Sets the content of an existing datastream version.
 void replaceObject(String objectKey, InputStream content)
          Replaces an existing object.
 InputStream retrieveDatastream(String dsKey)
          Gets the content of an existing datastream version.
 InputStream retrieveObject(String objectKey)
          Gets an existing object.
 

Method Detail

addObject

void addObject(String objectKey,
               InputStream content)
               throws LowlevelStorageException
Adds a new object.

Parameters:
objectKey - the pid of the object.
content - the serialized object.
Throws:
LowlevelStorageException - if the object already exists or cannot be added for any other reason.

replaceObject

void replaceObject(String objectKey,
                   InputStream content)
                   throws LowlevelStorageException
Replaces an existing object.

Parameters:
objectKey - the pid of the object.
content - the serialized object.
Throws:
LowlevelStorageException - if the object does not already exist or cannot be replaced for any other reason.

retrieveObject

InputStream retrieveObject(String objectKey)
                           throws LowlevelStorageException
Gets an existing object.

Parameters:
objectKey - the pid of the object.
Returns:
the serialized form of the object, as stored.
Throws:
LowlevelStorageException - if the object does not exist or cannot be read for any other reason.

removeObject

void removeObject(String objectKey)
                  throws LowlevelStorageException
Removes an object.

Parameters:
objectKey - the pid of the object.
Throws:
LowlevelStorageException - if the object does not exist or cannot be removed for any other reason.

rebuildObject

void rebuildObject()
                   throws LowlevelStorageException
Reconstructs the object index if such an index exists. The object index associates an object with a stored location. If the implementation does not use an index, this is a no-op.

Warning

Rebuilding the object index is not expected to be an atomic operation and should only be run while the system is offline or reads and writes are otherwise prevented.

Throws:
LowlevelStorageException - if an error occurs that prevents the index from being rebuilt.

auditObject

void auditObject()
                 throws LowlevelStorageException
Performs a consistency check against the object index if such an index exists. The object index associates an object with a stored location. If the implementation does not use an index, this is a no-op. If any inconsistencies are found, they will be reported to the system logger.

Throws:
LowlevelStorageException - if an error occurs that prevents the consistency check from taking place.

addDatastream

long addDatastream(String dsKey,
                   InputStream content)
                   throws LowlevelStorageException
Sets the content of a new datastream version.

Parameters:
dsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely identifies the datastream version.
content - the content.
Throws:
LowlevelStorageException - if the datastream version already exists or cannot be added for any other reason.

replaceDatastream

long replaceDatastream(String dsKey,
                       InputStream content)
                       throws LowlevelStorageException
Sets the content of an existing datastream version.

Parameters:
dsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely identifies the datastream version.
content - the content.
Throws:
LowlevelStorageException - if the datastream version does not already exist or cannot be replaced for any other reason.

retrieveDatastream

InputStream retrieveDatastream(String dsKey)
                               throws LowlevelStorageException
Gets the content of an existing datastream version.

Parameters:
dsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely identifies the datastream version.
Returns:
the content.
Throws:
LowlevelStorageException - if the datastream version does not exist or cannot be read for any other reason.

removeDatastream

void removeDatastream(String dsKey)
                      throws LowlevelStorageException
Removes the content of an existing datastream version.

Parameters:
dsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely identifies the datastream version.
Throws:
LowlevelStorageException - if the datastream version does not exist or cannot be removed for any other reason.

rebuildDatastream

void rebuildDatastream()
                       throws LowlevelStorageException
Reconstructs the datastream index if such an index exists. The datastream index associates a datastream version with a stored location. If the implementation does not use an index, this is a no-op.

Warning

Rebuilding the datastream index is not expected to be an atomic operation and should only be run while the system is offline or reads and writes are otherwise prevented.

Throws:
LowlevelStorageException - if an error occurs that prevents the

auditDatastream

void auditDatastream()
                     throws LowlevelStorageException
Performs a consistency check against the datastream index if such an index exists. The datastream index associates a datastream version with a stored location. If the implementation does not use an index, this is a no-op. If any inconsistencies are found, they will be reported to the system logger.

Throws:
LowlevelStorageException - if an error occurs that prevents the consistency check from taking place.


Copyright © 2011 DuraSpace. All Rights Reserved.