From 1770462ae241655f0315affb5bd8effcd3b5b65e Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 9 Nov 2010 19:00:42 +0200 Subject: [PATCH] + renamed some methods for consistency and clarity --- .../datastore/redis/connection/RedisCommands.java | 2 +- .../datastore/redis/connection/RedisConnection.java | 3 +-- .../datastore/redis/connection/jedis/JedisConnection.java | 2 +- .../datastore/redis/connection/jredis/JredisConnection.java | 2 +- .../datastore/redis/util/DefaultRedisSortedSet.java | 4 ++-- .../springframework/datastore/redis/util/RedisSortedSet.java | 4 ++-- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisCommands.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisCommands.java index ed2018aca..74d284309 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisCommands.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisCommands.java @@ -38,7 +38,7 @@ public interface RedisCommands extends RedisTxCommands, RedisStringCommands, Red void rename(String oldName, String newName); - Boolean renameNx(String oldName, String newName); + Boolean renameNX(String oldName, String newName); Integer dbSize(); diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisConnection.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisConnection.java index 5dbc1fbb9..ce94a9911 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisConnection.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/RedisConnection.java @@ -24,8 +24,7 @@ import org.springframework.datastore.redis.UncategorizedRedisException; * * @author Costin Leau */ -public interface RedisConnection extends RedisCommands, RedisHashCommands, RedisListCommands, RedisSetCommands, - RedisStringCommands, RedisZSetCommands { +public interface RedisConnection extends RedisCommands { /** * Close (or quit) the connection. diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jedis/JedisConnection.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jedis/JedisConnection.java index f54e3d6aa..075e15542 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jedis/JedisConnection.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jedis/JedisConnection.java @@ -241,7 +241,7 @@ public class JedisConnection implements RedisConnection { } @Override - public Boolean renameNx(String oldName, String newName) { + public Boolean renameNX(String oldName, String newName) { try { if (isQueueing()) { transaction.renamenx(oldName, newName); diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jredis/JredisConnection.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jredis/JredisConnection.java index c9be89247..371ba1876 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jredis/JredisConnection.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/connection/jredis/JredisConnection.java @@ -163,7 +163,7 @@ public class JredisConnection implements RedisConnection { } @Override - public Boolean renameNx(String oldName, String newName) { + public Boolean renameNX(String oldName, String newName) { try { return jredis.renamenx(oldName, newName); } catch (RedisException ex) { diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSortedSet.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSortedSet.java index 56b892122..4343b8b1d 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSortedSet.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSortedSet.java @@ -62,13 +62,13 @@ class DefaultRedisSortedSet extends AbstractRedisCollection implements RedisSort } @Override - public RedisSortedSet trim(int start, int end) { + public RedisSortedSet remove(int start, int end) { commands.zRemRange(key, start, end); return this; } @Override - public RedisSortedSet trimByScore(double min, double max) { + public RedisSortedSet removeByScore(double min, double max) { commands.zRemRangeByScore(key, min, max); return this; } diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSortedSet.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSortedSet.java index 0e4acf169..b38baebd2 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSortedSet.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSortedSet.java @@ -34,7 +34,7 @@ public interface RedisSortedSet extends RedisStore, SortedSet { Set rangeByScore(double min, double max); - RedisSortedSet trim(int start, int end); + RedisSortedSet remove(int start, int end); - RedisSortedSet trimByScore(double min, double max); + RedisSortedSet removeByScore(double min, double max); }