Interface Persistence

All Known Implementing Classes:
PersistenceImpl

public interface Persistence

Interface defining the methods for storing and retrieving values from the Transformers persistence store

The persistence implementation requires the following table to be present in the database the persistence module is configured to connect to.

CREATE TABLE if not exists TF_LEGACY_PERSISTENCE (
  JTM_KEY TEXT PRIMARY KEY NOT NULL,
  JTM_VALUE TEXT
 );
  • Method Details

    • put

      void put(PersistedValue persistedValue)

      Store a value, multiple puts with the same key will override previously stored values

      Parameters:
      persistedValue - value to be stored
    • get

      Parameters:
      key - The key associated with the entry
      Returns:
      The persisted value if it exists, null otherwise
    • query

      PersistedValue[] query(String query)

      Query for all entries whose keys start with the query

      Parameters:
      query - prefix to query for
      Returns:
      Array of PersistedValue objects. Never null
    • delete

      void delete(String key)

      Delete a key from the database

      Parameters:
      key - Key to delete
    • addChangeListener

      @Deprecated void addChangeListener(String prefix, PersistenceChangeListener listener)
      Deprecated.
      This feature was removed in Transformer 7.0

      Does nothing

      Parameters:
      prefix - Prefix of keys we're interested in
      listener - Object to be called when data changes