|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DataStore
Append-only store for binary streams. A data store consists of a number of identifiable data records that each contain a distinct binary stream. New binary streams can be added to the data store, but existing streams are never removed or modified.
A data store should be fully thread-safe, i.e. it should be possible to add and access data records concurrently. Optimally even separate processes should be able to concurrently access the data store with zero interprocess synchronization.
Method Summary | |
---|---|
DataRecord |
addRecord(InputStream stream)
Creates a new data record. |
void |
clearInUse()
Clear the in-use list. |
void |
close()
Close the data store |
int |
deleteAllOlderThan(long min)
Delete objects that have a modified date older than the specified date. |
Iterator |
getAllIdentifiers()
Get all identifiers. |
int |
getMinRecordLength()
Get the minimum size of an object that should be stored in this data store. |
DataRecord |
getRecord(DataIdentifier identifier)
Returns the identified data record. |
void |
init(String homeDir)
Initialized the data store |
void |
updateModifiedDateOnAccess(long before)
From now on, update the modified date of an object even when accessing it. |
Method Detail |
---|
DataRecord getRecord(DataIdentifier identifier) throws DataStoreException
identifier
- data identifier
DataStoreException
- if the data store could not be accessed,
or if the given identifier is invalidDataRecord addRecord(InputStream stream) throws DataStoreException
The given stream is consumed and not closed by this method. It is the responsibility of the caller to close the stream. A typical call pattern would be:
InputStream stream = ...; try { record = store.addRecord(stream); } finally { stream.close(); }
stream
- binary stream
DataStoreException
- if the data store could not be accessedvoid updateModifiedDateOnAccess(long before)
before
- - update the modified date to the current time if it is older than this valueint deleteAllOlderThan(long min) throws DataStoreException
min
- the minimum time
DataStoreException
Iterator getAllIdentifiers() throws DataStoreException
DataStoreException
- if the list could not be readvoid init(String homeDir) throws RepositoryException
homeDir
- the home directory of the repository
RepositoryException
int getMinRecordLength()
void close() throws DataStoreException
DataStoreException
- if a problem occuredvoid clearInUse()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |