public class DefaultLowlevelStorage extends Object implements ILowlevelStorage, IListable, ISizable, ICheckable
| Modifier and Type | Field and Description |
|---|---|
static String |
DATASTREAM_REGISTRY_TABLE |
static String |
DATASTREAM_STORE_BASE |
static String |
FILESYSTEM |
static String |
OBJECT_REGISTRY_TABLE |
static String |
OBJECT_STORE_BASE |
static String |
PATH_ALGORITHM |
static String |
PATH_REGISTRY |
static String |
REGISTRY_NAME |
| Constructor and Description |
|---|
DefaultLowlevelStorage(Map<String,Object> configuration) |
| Modifier and Type | Method and Description |
|---|---|
long |
addDatastream(String pid,
InputStream content,
Map<String,String> hints)
Sets the content of a new datastream version.
|
void |
addObject(String pid,
InputStream content,
Map<String,String> hints)
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.
|
boolean |
objectExists(String objectKey) |
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 pid)
Removes the content of an existing datastream version.
|
void |
removeObject(String pid)
Removes an object.
|
long |
replaceDatastream(String pid,
InputStream content,
Map<String,String> hints)
Sets the content of an existing datastream version.
|
void |
replaceObject(String pid,
InputStream content,
Map<String,String> hints)
Replaces an existing object.
|
InputStream |
retrieveDatastream(String pid)
Gets the content of an existing datastream version.
|
InputStream |
retrieveObject(String pid)
Gets an existing object.
|
public static final String REGISTRY_NAME
public static final String OBJECT_REGISTRY_TABLE
public static final String DATASTREAM_REGISTRY_TABLE
public static final String OBJECT_STORE_BASE
public static final String DATASTREAM_STORE_BASE
public static final String FILESYSTEM
public static final String PATH_ALGORITHM
public static final String PATH_REGISTRY
public DefaultLowlevelStorage(Map<String,Object> configuration) throws LowlevelStorageException
LowlevelStorageExceptionpublic void addObject(String pid, InputStream content, Map<String,String> hints) throws LowlevelStorageException
ILowlevelStorageaddObject in interface ILowlevelStoragepid - the pid of the object.content - the serialized object.hints - a map of hints for object storageLowlevelStorageException - if the object already exists or
cannot be added for any other reason.public void replaceObject(String pid, InputStream content, Map<String,String> hints) throws LowlevelStorageException
ILowlevelStoragereplaceObject in interface ILowlevelStoragepid - 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 retrieveObject(String pid) throws LowlevelStorageException
ILowlevelStorageretrieveObject in interface ILowlevelStoragepid - the pid of the object.LowlevelStorageException - if the object does not exist or
cannot be read for any other reason.public void removeObject(String pid) throws LowlevelStorageException
ILowlevelStorageremoveObject in interface ILowlevelStoragepid - the pid of the object.LowlevelStorageException - if the object does not exist or
cannot be removed for any other reason.public void rebuildObject()
throws LowlevelStorageException
ILowlevelStorage
rebuildObject in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents the
index from being rebuilt.public void auditObject()
throws LowlevelStorageException
ILowlevelStorageauditObject in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents the
consistency check from taking place.public long addDatastream(String pid, InputStream content, Map<String,String> hints) throws LowlevelStorageException
ILowlevelStorageaddDatastream in interface ILowlevelStoragepid - 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 long replaceDatastream(String pid, InputStream content, Map<String,String> hints) throws LowlevelStorageException
ILowlevelStoragereplaceDatastream in interface ILowlevelStoragepid - 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 InputStream retrieveDatastream(String pid) throws LowlevelStorageException
ILowlevelStorageretrieveDatastream in interface ILowlevelStoragepid - 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 void removeDatastream(String pid) throws LowlevelStorageException
ILowlevelStorageremoveDatastream in interface ILowlevelStoragepid - 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 rebuildDatastream()
throws LowlevelStorageException
ILowlevelStorage
rebuildDatastream in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents thepublic void auditDatastream()
throws LowlevelStorageException
ILowlevelStorageauditDatastream in interface ILowlevelStorageLowlevelStorageException - if an error occurs that prevents the
consistency check from taking place.public Iterator<String> listObjects()
IListablelistObjects in interface IListablepublic Iterator<String> listDatastreams()
IListablelistDatastreams in interface IListablepublic long getDatastreamSize(String dsKey) throws LowlevelStorageException
ISizablegetDatastreamSize in interface ISizableLowlevelStorageExceptionpublic boolean objectExists(String objectKey)
objectExists in interface ICheckableCopyright © 2013 DuraSpace. All Rights Reserved.