Class BaseRedisDLock

    • Field Detail

      • myOwnRedis

        protected boolean myOwnRedis
        Flag to mark if the Redis resource (e.g. Redis client pool) is created and handled by the lock instance.
    • Constructor Detail

      • BaseRedisDLock

        public BaseRedisDLock​(String name)
    • Method Detail

      • getJedisConnector

        public com.github.ddth.commons.redis.JedisConnector getJedisConnector()
        Returns:
      • setJedisConnector

        public BaseRedisDLock setJedisConnector​(com.github.ddth.commons.redis.JedisConnector jedisConnector)
        Parameters:
        jedisConnector -
        Returns:
      • getRedisPassword

        public String getRedisPassword()
        Password to connect to Redis server/cluster.
        Returns:
      • setRedisPassword

        public BaseRedisDLock setRedisPassword​(String redisPassword)
        Password to connect to Redis server/cluster.
        Parameters:
        redisPassword -
        Returns:
      • buildJedisConnector

        protected abstract com.github.ddth.commons.redis.JedisConnector buildJedisConnector()
        Build a JedisConnector instance for my own use.
        Returns:
        Since:
        0.1.1.2
      • getScriptLock

        protected String getScriptLock()
      • getScriptUnlock

        protected String getScriptUnlock()
      • updateLockHolder

        protected void updateLockHolder​(redis.clients.jedis.commands.JedisClusterCommands jedisClusterCommands)
        Update current lock's holder info.
        Parameters:
        jedisClusterCommands -
        Since:
        1.0.0
      • updateLockHolder

        protected void updateLockHolder​(redis.clients.jedis.commands.JedisCommands jedisCommands)
        Update current lock's holder info.
        Parameters:
        jedisCommands -
        Since:
        0.1.1
      • getZsetName

        protected String getZsetName()
        Get name of the ZSET to store clientId's score.
        Returns:
        Since:
        0.1.2
      • unlockResult

        protected LockResult unlockResult​(Object response)
        Convenient method to build result for IDLock.unlock(String)} method with result from Redis server.
        Parameters:
        response -
        Returns:
        Since:
        1.0.0