public abstract class DataStore
extends java.lang.Object
This is a simple interface for persisting data. The underlying implementation is reponsible for handling stuff like locks and other stuff
An object within the datastore is considered to be uniquely defined by its "id" and "type".
SimpleDataStore
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logR |
Constructor and Description |
---|
DataStore() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
exists(java.lang.String id,
java.lang.String type)
Check if the data exists in the store.
|
java.util.Properties |
getConfiguration()
Get the configuration for this datastore.
|
abstract void |
persist(java.lang.String id,
java.lang.String type,
java.lang.Object obj)
Persist the data to the store.
|
abstract void |
remove(java.lang.String id,
java.lang.String type)
Remove the data from the datastore.
|
abstract java.lang.Object |
retrieve(java.lang.String id,
java.lang.String type)
Retrieve the data from the datastore.
|
void |
setConfiguration(java.util.Properties p)
Set the configuration for this datastore.
|
public void setConfiguration(java.util.Properties p) throws DataStoreException
p
- the configurationDataStoreException
- if there was an error.public java.util.Properties getConfiguration()
public abstract void persist(java.lang.String id, java.lang.String type, java.lang.Object obj) throws DataStoreException
id
- the idtype
- the typeobj
- object stored in the datastoreDataStoreException
- if an error is encounteredpublic abstract java.lang.Object retrieve(java.lang.String id, java.lang.String type) throws DataStoreException
id
- the idtype
- the typeDataStoreException
- if an error is encounteredpublic abstract void remove(java.lang.String id, java.lang.String type) throws DataStoreException
id
- the idtype
- the typeDataStoreException
- if an error is encounteredpublic abstract boolean exists(java.lang.String id, java.lang.String type) throws DataStoreException
id
- the idtype
- the typeDataStoreException
- if an error is encountered