|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.server.storage.lowlevel.akubra.AkubraLowlevelStorage
public class AkubraLowlevelStorage
Akubra-backed implementation of ILowlevelStorage.
This implementation uses two Akubra BlobStores; one for
objects and another for datastreams.
| Constructor Summary | |
|---|---|
AkubraLowlevelStorage(org.akubraproject.BlobStore objectStore,
org.akubraproject.BlobStore datastreamStore,
boolean forceSafeObjectOverwrites,
boolean forceSafeDatastreamOverwrites)
Creates an instance using the given blob stores. |
|
| 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. |
long |
getDatastreamSize(String dsKey)
Return the size of a datastream in bytes |
Iterator<String> |
listDatastreams()
Lists all stored datastreams in no particular order. |
Iterator<String> |
listObjects()
Lists all stored objects in no particular order. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AkubraLowlevelStorage(org.akubraproject.BlobStore objectStore,
org.akubraproject.BlobStore datastreamStore,
boolean forceSafeObjectOverwrites,
boolean forceSafeDatastreamOverwrites)
The blob stores MUST:
info:fedora/ URIs as blob ids.
The blob stores MAY:
forceSafe..Overwrites MUST be given as
true and the blob store MUST support
org.akubraproject.core.Blob#renameTo
objectStore - the store for serialized objects.datastreamStore - the store for datastream content.forceSafeObjectOverwrites - if true, replaceObject calls will
be done in a way that ensures the old content is not deleted
until the new content is safely written. If the objectStore
already does this, this should be given as false.forceSafeDatastreamOverwrites - same as above, but for
replaceDatastream calls.| Method Detail |
|---|
public long addDatastream(String dsKey,
InputStream content)
throws LowlevelStorageException
ILowlevelStorage
addDatastream in interface ILowlevelStoragedsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely
identifies the datastream version.content - the content.
LowlevelStorageException - if the datastream version already
exists or cannot be added for any other reason.
public void addObject(String objectKey,
InputStream content)
throws LowlevelStorageException
ILowlevelStorage
addObject in interface ILowlevelStorageobjectKey - the pid of the object.content - the serialized object.
LowlevelStorageException - if the object already exists or
cannot be added for any other reason.
public void auditDatastream()
throws LowlevelStorageException
ILowlevelStorage
auditDatastream in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents the
consistency check from taking place.
public void auditObject()
throws LowlevelStorageException
ILowlevelStorage
auditObject in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents the
consistency check from taking place.
public void rebuildDatastream()
throws LowlevelStorageException
ILowlevelStorage
rebuildDatastream in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents the
public void rebuildObject()
throws LowlevelStorageException
ILowlevelStorage
rebuildObject in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents the
index from being rebuilt.
public void removeDatastream(String dsKey)
throws LowlevelStorageException
ILowlevelStorage
removeDatastream in interface ILowlevelStoragedsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely
identifies the datastream version.
LowlevelStorageException - if the datastream version does not
exist or cannot be removed for any other reason.
public void removeObject(String objectKey)
throws LowlevelStorageException
ILowlevelStorage
removeObject in interface ILowlevelStorageobjectKey - the pid of the object.
LowlevelStorageException - if the object does not exist or
cannot be removed for any other reason.
public long replaceDatastream(String dsKey,
InputStream content)
throws LowlevelStorageException
ILowlevelStorage
replaceDatastream in interface ILowlevelStoragedsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely
identifies the datastream version.content - the content.
LowlevelStorageException - if the datastream version does not
already exist or cannot be replaced for any other reason.
public void replaceObject(String objectKey,
InputStream content)
throws LowlevelStorageException
ILowlevelStorage
replaceObject in interface ILowlevelStorageobjectKey - the pid of the object.content - the serialized object.
LowlevelStorageException - if the object does not already exist
or cannot be replaced for any other reason.
public InputStream retrieveDatastream(String dsKey)
throws LowlevelStorageException
ILowlevelStorage
retrieveDatastream in interface ILowlevelStoragedsKey - the $pid "+" $dsId "+" $dsVersionId string that uniquely
identifies the datastream version.
LowlevelStorageException - if the datastream version does not
exist or cannot be read for any other reason.
public InputStream retrieveObject(String objectKey)
throws LowlevelStorageException
ILowlevelStorage
retrieveObject in interface ILowlevelStorageobjectKey - the pid of the object.
LowlevelStorageException - if the object does not exist or
cannot be read for any other reason.public Iterator<String> listDatastreams()
IListable
listDatastreams in interface IListablepublic Iterator<String> listObjects()
IListable
listObjects in interface IListable
public long getDatastreamSize(String dsKey)
throws LowlevelStorageException
ISizable
getDatastreamSize in interface ISizableLowlevelStorageException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||