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. In order for this persistence API to work properly, the following table needs to exist in the database the persistence service is configured to connect to:
CREATE TABLE if not exists TF_LEGACY_PERSISTENCE (
JTM_KEY TEXT PRIMARY KEY NOT NULL
JTM_VALUE TEXT
);
Constructor and Description |
---|
PersistenceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(String prefix,
PersistenceChangeListener listener)
Deprecated.
|
static Map<String,String> |
createMap(String... keyValues) |
void |
delete(String key)
Delete a key from the database
|
PersistedValue |
get(String key)
Retreive a
from Transformers persistence store |
void |
put(PersistedValue persistedValue)
Store a value, multiple puts with the same key will override previously stored values
|
PersistedValue[] |
query(String query)
Query for all entries whose keys start with the query
|
public void put(PersistedValue persistedValue)
Persistence
Store a value, multiple puts with the same key will override previously stored values
put
in interface Persistence
persistedValue
- value to be storedpublic 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 query)
Persistence
Query for all entries whose keys start with the query
query
in interface Persistence
query
- prefix to query forPersistedValue
objects. Never nullpublic void delete(String key)
Persistence
Delete a key from the database
delete
in interface Persistence
key
- Key to delete@Deprecated public void addChangeListener(String prefix, PersistenceChangeListener listener)
Persistence
Does nothing
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