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

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

Introduction

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

Prototype

@Nullable
Boolean move(byte[] key, int dbIndex);

Source Link

Document

Move given key to database with index .

Usage

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

/**
 * Move given {@code key} to database with {@code index}.
 * <p>/* w w w.j a v a  2 s  .  c  o  m*/
 * See http://redis.io/commands/move
 * 
 * @param key key
 * @param dbIndex dbIndex
 * @return Boolean
 */
public static Boolean move(byte[] key, int dbIndex) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.move(key, dbIndex);
        }
    });
}

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

/**
 * Move given {@code key} to database with {@code index}.
 * <p>/*  ww w . ja v a2s . co  m*/
 * See http://redis.io/commands/move
 * 
 * @param key key
 * @param dbIndex dbIndex
 * @return Boolean
 */
public Boolean move(byte[] key, int dbIndex) {
    return redisTemplate.execute(new RedisCallback<Boolean>() {
        @Override
        public Boolean doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.move(key, dbIndex);
        }
    });
}