Class RedisConfiguration

java.lang.Object
io.github.blyznytsiaorg.bibernate.cache.RedisConfiguration

public class RedisConfiguration extends Object
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 Details

    • jedis

      private redis.clients.jedis.Jedis jedis
  • Constructor Details

    • RedisConfiguration

      public RedisConfiguration(BibernateDatabaseSettings bibernateDatabaseSettings)
      Constructs a new RedisConfiguration instance and sets up the Redis connection.
      Parameters:
      bibernateDatabaseSettings - the database settings containing Redis configuration
  • Method Details

    • setup

      private void setup(BibernateDatabaseSettings bibernateDatabaseSettings)
      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

      public DistributedSet 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