public class PersistenceImpl extends Object implements Persistence
Class that provides access to the Transformer persistence service.
If a module uses the persistence service any data persisted is saved over restarts of Transformer and is also available on multiple Transformers is they are clustered together.
Constructor and Description |
---|
PersistenceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(String prefix,
PersistenceChangeListener listener)
Register a change listener with transformers persistence module.
|
void |
delete(String key)
Delete a key from the database
|
PersistedValue |
get(String key)
Retreive a
from Transformers persistence store |
void |
put(PersistedValue value)
Put the supplied value into persistence.
|
PersistedValue[] |
query(String queryPrefix)
Query for all entries whose keys start with the query
|
public void put(PersistedValue value)
Put the supplied value into persistence.
put
in interface Persistence
value
- The value to be persisted.
Should a value with the same key be already persisted it will be overwritten and replaced with the value supplied to this function.
public void delete(String key)
Persistence
Delete a key from the database
delete
in interface Persistence
key
- Key to deletepublic PersistedValue get(String key)
Persistence
Retreive a from Transformers persistence store
get
in interface Persistence
key
- The key associated with the entrypublic PersistedValue[] query(String queryPrefix)
Persistence
Query for all entries whose keys start with the query
query
in interface Persistence
queryPrefix
- prefix to query forPersistedValue
objects. Never nullpublic void addChangeListener(String prefix, PersistenceChangeListener listener)
Persistence
Register a change listener with transformers persistence module. Will only get called if the change originates on either another cluster node or a monitoring module
addChangeListener
in interface Persistence
prefix
- Prefix of keys we're interested inlistener
- Object to be called when data changesPlease send bug reports and comments to Caplin support