diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java index 085339916..c0b833872 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisCommands.java @@ -20,7 +20,7 @@ import java.util.Collection; import java.util.List; /** - * Commands supported by Redis . + * Interface for the commands supported by Redis. * * @author Costin Leau */ diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnection.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnection.java index 558ee4e06..40403b6b2 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnection.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnection.java @@ -19,23 +19,35 @@ package org.springframework.data.keyvalue.redis.connection; import org.springframework.data.keyvalue.redis.UncategorizedRedisException; /** - * A connection to a Redis server. + * A connection to a Redis server. Acts as an common abstraction across various + * Redis client libraries (or drivers). Additionally performs exception translation + * between the underlying Redis client library and Spring DAO exceptions. + * + * The methods follow as much as possible the Redis names and conventions. * - * The methods follow as much as possible the Redis names and conventions. - * * @author Costin Leau */ public interface RedisConnection extends RedisCommands { /** - * Close (or quit) the connection. + * Closes (or quits) the connection. * - * @throws UncategorizedRedisException + * @throws UncategorizedRedisException in case of exceptions */ void close() throws UncategorizedRedisException; + /** + * Indicates whether the underlying connection is closed or not. + * + * @return true if the connection is closed, false otherwise. + */ boolean isClosed(); + /** + * Returns the native connection (the underlying library/driver object). + * + * @return underlying, native object + */ Object getNativeConnection(); /** diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionFactory.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionFactory.java index e6bc5724e..0dfd7a207 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionFactory.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisConnectionFactory.java @@ -19,12 +19,16 @@ package org.springframework.data.keyvalue.redis.connection; import org.springframework.dao.support.PersistenceExceptionTranslator; /** - * Thread-safe factory of Redis connections. Additionally performs exception translation - * between the underlying Redis connection library and Spring DAO exceptions. + * Thread-safe factory of Redis connections. * * @author Costin Leau */ public interface RedisConnectionFactory extends PersistenceExceptionTranslator { + /** + * Provides a suitable connection for interacting with Redis. + * + * @return connection for interacting with Redis. + */ RedisConnection getConnection(); } diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java index 49fc1d5ab..757dd1ba9 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisStringCommands.java @@ -20,7 +20,7 @@ import java.util.List; import java.util.Map; /** - * String specific commands supported by Redis. + * String/Value-specific commands supported by Redis. * * @author Costin Leau */ diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisTxCommands.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisTxCommands.java index 82aec4fc6..9ec36ff1c 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisTxCommands.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/RedisTxCommands.java @@ -19,7 +19,7 @@ import java.util.List; /** - * Redis transaction (aka batch) commands. + * Transaction/Batch specific commands supported by Redis. * * @author Costin Leau */ diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/SortParameters.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/SortParameters.java index ec6cf7d42..b898b1dfb 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/SortParameters.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/SortParameters.java @@ -49,13 +49,42 @@ public interface SortParameters { } } + /** + * Returns the sorting order. Can be null if nothing is specified. + * + * @return sorting order + */ Order getOrder(); + /** + * Indicates if the sorting is numeric (default) or alphabetical (lexicographical). + * Can be null if nothing is specified. + * + * @return the type of sorting + */ Boolean isAlphabetic(); + /** + * Returns the pattern (if set) for sorting by external keys (BY). + * Can be null if nothing is specified. + * + * @return BY pattern. + */ byte[] getByPattern(); + /** + * Returns the pattern (if set) for retrieving external keys (GET). + * Can be null if nothing is specified. + * + * @return GET pattern. + */ byte[] getGetPattern(); + /** + * Returns the sorting limit (range or pagination). + * Can be null if nothing is specified. + * + * @return sorting limit/range + */ Range getLimit(); -} +} \ No newline at end of file