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

/**
 * Get set of {@link Tuple} where score is between {@code Range#min} and {@code Range#max} from sorted set ordered
 * from high to low./*from  w w  w .ja v  a  2s  .co  m*/
 * 
 * @param key key
 * @param range range
 * @return Set<Tuple>
 * @since 1.6
 */
public static Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, range);
        }
    });
}

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

/**
 * Get set of {@link Tuple} where score is between {@code Range#min} and {@code Range#max} from sorted set ordered
 * from high to low./*from ww  w . ja  v a 2 s .c  o m*/
 * 
 * @param key key
 * @param range range
 * @return Set<Tuple>
 * @since 1.6
 */
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, range);
        }
    });
}

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

/**
 * Get set of {@link Tuple} in range from {@code Limit#offset} to {@code Limit#count} where score is between
 * {@code Range#min} and {@code Range#max} from sorted set ordered high -> low.
 * //w w w  .ja  v  a2 s. c o m
 * @param key key
 * @param range range
 * @param limit limit
 * @return Set<Tuple>
 * @since 1.6
 */
public static Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, range, limit);
        }
    });
}

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

/**
 * Get set of {@link Tuple} in range from {@code Limit#offset} to {@code Limit#count} where score is between
 * {@code Range#min} and {@code Range#max} from sorted set ordered high -> low.
 * /*  w ww.j a  v  a  2s.  c om*/
 * @param key key
 * @param range range
 * @param limit limit
 * @return Set<Tuple>
 * @since 1.6
 */
public Set<Tuple> zRevRangeByScoreWithScores(byte[] key, Range range, Limit limit) {
    return redisTemplate.execute(new RedisCallback<Set<Tuple>>() {
        @Override
        public Set<Tuple> doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zRevRangeByScoreWithScores(key, range, limit);
        }
    });
}

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

/**
 * Count number of elements within sorted set with scores between {@code min} and {@code max}.
 * <p>//  w ww .j a v  a2s .co m
 * See http://redis.io/commands/zcount
 * 
 * @param key key
 * @param min min
 * @param max max
 * @return Long
 */
public static Long zCount(byte[] key, double min, double max) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zCount(key, min, max);
        }
    });
}

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

/**
 * Count number of elements within sorted set with scores between {@code min} and {@code max}.
 * <p>//from  www.ja  v a 2 s .  c om
 * See http://redis.io/commands/zcount
 * 
 * @param key key
 * @param min min
 * @param max max
 * @return Long
 */
public Long zCount(byte[] key, double min, double max) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zCount(key, min, max);
        }
    });
}

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

/**
 * Count number of elements within sorted set with scores between {@code Range#min} and {@code Range#max}.
 * //  www .  ja  va  2  s  . c o  m
 * @param key key
 * @param range range
 * @return Long
 * @since 1.6
 */
public static Long zCount(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zCount(key, range);
        }
    });
}

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

/**
 * Count number of elements within sorted set with scores between {@code Range#min} and {@code Range#max}.
 * //from  w w w.  j  a v a  2 s  . c o  m
 * @param key key
 * @param range range
 * @return Long
 * @since 1.6
 */
public Long zCount(byte[] key, Range range) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zCount(key, range);
        }
    });
}

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

/**
 * Get the size of sorted set with {@code key}.
 * <p>//w w  w  .ja va  2 s. c  o m
 * See http://redis.io/commands/zcard
 * 
 * @param key key
 * @return Long
 */
public static Long zCard(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zCard(key);
        }
    });
}

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

/**
 * Get the size of sorted set with {@code key}.
 * <p>/*ww  w  .  ja v  a 2  s  .  c  o  m*/
 * See http://redis.io/commands/zcard
 * 
 * @param key key
 * @return Long
 */
public Long zCard(byte[] key) {
    return redisTemplate.execute(new RedisCallback<Long>() {
        @Override
        public Long doInRedis(RedisConnection redis) throws DataAccessException {
            return redis.zCard(key);
        }
    });
}