Example usage for org.springframework.data.redis.core RedisCallback RedisCallback

List of usage examples for org.springframework.data.redis.core RedisCallback RedisCallback

Introduction

In this page you can find the example usage for org.springframework.data.redis.core RedisCallback RedisCallback.

Prototype

RedisCallback

Source Link

Usage

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

/**
 * Union sorted {@code sets} and store result in destination {@code key}.
 * <p>//  w  w  w  . java2s.c  o  m
 * See http://redis.io/commands/zunionstore
 * 
 * @param destKey destKey
 * @param aggregate aggregate
 * @param weights weights
 * @param sets sets
 * @return Long
 */
public static Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zUnionStore(destKey, aggregate, weights, sets);
        }
    });
}

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

/**
 * Union sorted {@code sets} and store result in destination {@code key}.
 * <p>//from w w w.  j  a v  a  2 s. c  o  m
 * See http://redis.io/commands/zunionstore
 * 
 * @param destKey destKey
 * @param aggregate aggregate
 * @param weights weights
 * @param sets sets
 * @return Long
 */
public Long zUnionStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zUnionStore(destKey, aggregate, weights, sets);
        }
    });
}

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

/**
 * Intersect sorted {@code sets} and store result in destination {@code key}.
 * <p>//from w w w  .j  a  v  a 2s .c  o  m
 * See http://redis.io/commands/zinterstore
 * 
 * @param destKey destKey
 * @param sets sets
 * @return Long
 */
public static Long zInterStore(byte[] destKey, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zInterStore(destKey, sets);
        }
    });
}

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

/**
 * Intersect sorted {@code sets} and store result in destination {@code key}.
 * <p>// w w  w. j  a  v a  2  s .co  m
 * See http://redis.io/commands/zinterstore
 * 
 * @param destKey destKey
 * @param sets sets
 * @return Long
 */
public Long zInterStore(byte[] destKey, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zInterStore(destKey, sets);
        }
    });
}

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

/**
 * Intersect sorted {@code sets} and store result in destination {@code key}.
 * <p>/*from  www  . j  a  v  a2 s  .c om*/
 * See http://redis.io/commands/zinterstore
 * 
 * @param destKey destKey
 * @param aggregate aggregate
 * @param weights weights
 * @param sets sets
 * @return Long
 */
public static Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zInterStore(destKey, aggregate, weights, sets);
        }
    });
}

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

/**
 * Intersect sorted {@code sets} and store result in destination {@code key}.
 * <p>//from   w w w.  java 2  s  . c  o m
 * See http://redis.io/commands/zinterstore
 * 
 * @param destKey destKey
 * @param aggregate aggregate
 * @param weights weights
 * @param sets sets
 * @return Long
 */
public Long zInterStore(byte[] destKey, Aggregate aggregate, int[] weights, byte[]... sets) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zInterStore(destKey, aggregate, weights, sets);
        }
    });
}

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

/**
 * Use a {@link Cursor} to iterate over elements in sorted set at {@code key}.
 * <p>/*  w  ww.  ja va2s . c  om*/
 * See http://redis.io/commands/scan
 * 
 * @since 1.4
 * @param key key
 * @param options options
 * @return Cursor<Tuple>
 */
public static Cursor<Tuple> zScan(byte[] key, ScanOptions options) {
    return redisTemplate.execute(new RedisCallback<Cursor<Tuple>>() {
        @Override
        public Cursor<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zScan(key, options);
        }
    });
}

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

/**
 * Use a {@link Cursor} to iterate over elements in sorted set at {@code key}.
 * <p>//from   w w  w . j av a2s . c  o  m
 * See http://redis.io/commands/scan
 * 
 * @since 1.4
 * @param key key
 * @param options options
 * @return Cursor<Tuple>
 */
public Cursor<Tuple> zScan(byte[] key, ScanOptions options) {
    return redisTemplate.execute(new RedisCallback<Cursor<Tuple>>() {
        @Override
        public Cursor<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zScan(key, options);
        }
    });
}

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

/**
 * Get elements where score is between {@code min} and {@code max} from sorted set.
 * <p>// w w  w  .  j  av a  2  s  .com
 * See http://redis.io/commands/zrangebyscore
 * 
 * @since 1.5
 * @param key key
 * @param min min
 * @param max max
 * @return Set<byte[]>
 */
public static Set<byte[]> zRangeByScore(byte[] key, String min, String max) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRangeByScore(key, min, max);
        }
    });
}

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

/**
 * Get elements where score is between {@code min} and {@code max} from sorted set.
 * <p>/*w w  w.j  a v  a  2s .  c  o  m*/
 * See http://redis.io/commands/zrangebyscore
 * 
 * @since 1.5
 * @param key key
 * @param min min
 * @param max max
 * @return Set<byte[]>
 */
public Set<byte[]> zRangeByScore(byte[] key, String min, String max) {
    return redisTemplate.execute(new RedisCallback<Set<byte[]>>() {
        @Override
        public Set<byte[]> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRangeByScore(key, min, max);
        }
    });
}