Example usage for org.springframework.data.redis.connection RedisConnection persist

List of usage examples for org.springframework.data.redis.connection RedisConnection persist

Introduction

In this page you can find the example usage for org.springframework.data.redis.connection RedisConnection persist.

Prototype

@Nullable
Boolean persist(byte[] key);

Source Link

Document

Remove the expiration from given key .

Usage

From source file:com.zxy.commons.cache.RedisUtils.java

/**
 * Remove the expiration from given {@code key}.
 * <p>//from  w w w.  j a va2s.co  m
 * See http://redis.io/commands/persist
 * 
 * @param key key
 * @return Boolean
 */
public static Boolean persist(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.persist(key);
        }
    });
}

From source file:com.zxy.commons.cache.RedisHelper.java

/**
 * Remove the expiration from given {@code key}.
 * <p>/* ww w  .ja v  a 2 s. com*/
 * See http://redis.io/commands/persist
 * 
 * @param key key
 * @return Boolean
 */
public Boolean persist(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.persist(key);
        }
    });
}