Class PersistenceImpl
java.lang.Object
com.caplin.transformer.module.persistence.PersistenceImpl
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChangeListener(String prefix, PersistenceChangeListener listener) Deprecated.voidDelete a key from the databaseRetreive afrom Transformers persistence storevoidput(PersistedValue persistedValue) Store a value, multiple puts with the same key will override previously stored valuesQuery for all entries whose keys start with the query
-
Constructor Details
-
PersistenceImpl
public PersistenceImpl()
-
-
Method Details
-
createMap
-
put
Description copied from interface:PersistenceStore a value, multiple puts with the same key will override previously stored values
- Specified by:
putin interfacePersistence- Parameters:
persistedValue- value to be stored
-
get
Description copied from interface:PersistenceRetreive a
from Transformers persistence store- Specified by:
getin interfacePersistence- Parameters:
key- The key associated with the entry- Returns:
- The persisted value if it exists, null otherwise
-
query
Description copied from interface:PersistenceQuery for all entries whose keys start with the query
- Specified by:
queryin interfacePersistence- Parameters:
query- prefix to query for- Returns:
- Array of
PersistedValueobjects. Never null
-
delete
Description copied from interface:PersistenceDelete a key from the database
- Specified by:
deletein interfacePersistence- Parameters:
key- Key to delete
-
addChangeListener
Deprecated.Description copied from interface:PersistenceDoes nothing
- Specified by:
addChangeListenerin interfacePersistence- Parameters:
prefix- Prefix of keys we're interested inlistener- Object to be called when data changes
-