public interface Persistor
A Persistor is a class that handles callbacks from the Transformers persistence module and acts as a Bridge between Transformer and any Database
When an implementation of PersistedValue
is loaded by Transformer, transformer looks
for a constructor that takes exactly one Argument of type PersistorConfiguration
. If this
constructor is not available, the default constructor gets called
Modifier and Type | Method and Description |
---|---|
void |
onDelete(String key)
Delete a row with the provided key from the Database
|
PersistedValue |
onGet(String key)
Retrieve a row from the Database
|
void |
onInsert(PersistedValue persistedValue)
Implement this method to handle Insert/Put callbacks.
|
PersistedValue[] |
onQuery(String query)
A Query is a prefix match for all keys in the database.
|
void |
onShutdown()
When transformer unloads the module, usually a shutdown.
|
void onInsert(PersistedValue persistedValue)
Implement this method to handle Insert/Put callbacks. An insert is expected to overwrite the previously stored value associated with the provided key
persistedValue
- The PersistedValue
to be storedPersistedValue onGet(String key)
Retrieve a row from the Database
key
- The key associated with the rowPersistedValue
representing the rowPersistedValue[] onQuery(String query)
A Query is a prefix match for all keys in the database.
query
- an arbitrary String, can be empty tooPersistedValue
representing all rows whose key starts with the queryvoid onDelete(String key)
Delete a row with the provided key from the Database
key
- the key of the row to be deletedvoid onShutdown()
When transformer unloads the module, usually a shutdown. This callback is being called, so that open connections can be closed
Please send bug reports and comments to Caplin support