Class PostgresCacheHelper
java.lang.Object
org.fireflyframework.cache.factory.PostgresCacheHelper
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 Summary
Modifier and TypeMethodDescriptionstatic org.fireflyframework.cache.core.CacheAdaptercreatePostgresCacheAdapter(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.
-
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 namekeyPrefix- the key prefix applied to all cache keysdefaultTtl- default TTL applied when no explicit TTL is suppliedr2dbcConnectionFactory- the R2DBCConnectionFactory(typed as Object so the cache core never compiles against R2DBC types)properties- the cache properties (Postgres config is read fromgetPostgres())objectMapper- the Jackson object mapper used for value serialization- Returns:
- a configured
CacheAdapterbacked by PostgreSQL
-