Class RedisConfiguration
java.lang.Object
io.github.blyznytsiaorg.bibernate.cache.RedisConfiguration
Configuration class for setting up Redis connections and distributed caching.
It initializes a Jedis instance based on provided database settings and creates a DistributedRedisSet instance.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Field Summary
-
Constructor Summary
ConstructorDescriptionRedisConfiguration
(BibernateDatabaseSettings bibernateDatabaseSettings) Constructs a new RedisConfiguration instance and sets up the Redis connection. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a DistributedSet instance for interacting with the distributed cache.private void
setup
(BibernateDatabaseSettings bibernateDatabaseSettings) Sets up the Redis connection based on the provided database settings.
-
Field Details
-
jedis
private redis.clients.jedis.Jedis jedis
-
-
Constructor Details
-
RedisConfiguration
Constructs a new RedisConfiguration instance and sets up the Redis connection.- Parameters:
bibernateDatabaseSettings
- the database settings containing Redis configuration
-
-
Method Details
-
setup
Sets up the Redis connection based on the provided database settings. If second-level cache is enabled, it initializes a Jedis instance with the specified host and port.- Parameters:
bibernateDatabaseSettings
- the database settings containing Redis configuration
-
getDistributedMap
Retrieves a DistributedSet instance for interacting with the distributed cache. Creates a new DistributedRedisSet instance with the configured Jedis client.- Returns:
- a DistributedSet instance for interacting with the distributed cache
-