Class PostgresCacheHelper

java.lang.Object
org.fireflyframework.cache.factory.PostgresCacheHelper

public final class PostgresCacheHelper extends Object
Self-contained factory helper that builds a PostgresCacheAdapter.

The fully-qualified class name org.fireflyframework.cache.factory.PostgresCacheHelper is referenced reflectively by the cache core, so it must not be renamed or moved to a different package.

  • Method Details

    • createPostgresCacheAdapter

      public static org.fireflyframework.cache.core.CacheAdapter createPostgresCacheAdapter(String cacheName, String keyPrefix, Duration defaultTtl, Object r2dbcConnectionFactory, org.fireflyframework.cache.properties.CacheProperties properties, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Creates a PostgreSQL cache adapter from the supplied connection factory and cache properties.
      Parameters:
      cacheName - the logical cache name
      keyPrefix - the key prefix applied to all cache keys
      defaultTtl - default TTL applied when no explicit TTL is supplied
      r2dbcConnectionFactory - the R2DBC ConnectionFactory (typed as Object so the cache core never compiles against R2DBC types)
      properties - the cache properties (Postgres config is read from getPostgres())
      objectMapper - the Jackson object mapper used for value serialization
      Returns:
      a configured CacheAdapter backed by PostgreSQL