From 346a9ce33866f24b7af676878768a9e6618e36e2 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 9 Nov 2010 11:25:08 +0200 Subject: [PATCH] + add Redis ZSet commands --- .../redis/connection/RedisZSetCommands.java | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisZSetCommands.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisZSetCommands.java index 0a06436e6..e70374ca1 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisZSetCommands.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisZSetCommands.java @@ -16,6 +16,9 @@ package org.springframework.datastore.redis.connection; +import java.util.List; + + /** * ZSet(SortedSet)-specific commands supported by Redis. * @@ -23,4 +26,41 @@ package org.springframework.datastore.redis.connection; */ public interface RedisZSetCommands { -} + public enum AGGREGATE { + SUM, MIN, MAX; + } + + Boolean zAdd(String key, double score, String value); + + Boolean zRem(String key, String value); + + Double zIncrBy(String key, double increment, String value); + + Integer zRank(String key, String value); + + Integer zRevRank(String key, String value); + + List zRange(String key, int start, int end); + + List zRevRange(String key, int start, int end); + + List zRangeByScore(String key, double min, double max); + + Integer zCount(String key, double min, double max); + + Integer zCard(String key); + + Double zScore(String key, String value); + + Integer zRemRange(String key, int start, int end); + + Integer zRemRangeByScore(String key, double min, double max); + + Integer zUnionStore(String destKey, String... sets); + + Integer zUnionStore(String destKey, AGGREGATE aggregate, double[] weights, String... sets); + + Integer zInterStore(String destKey, String... sets); + + Integer zInterStore(String destKey, AGGREGATE aggregate, double[] weights, String... sets); +} \ No newline at end of file