From 9b1f5464ba2cefa99c73baa5f99d44c393020519 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Tue, 19 Apr 2011 19:56:10 +0300 Subject: [PATCH] DATAKV-66 + add getter for database index on ConnectionFactories + update javadoc --- .../connection/jedis/JedisConnectionFactory.java | 12 +++++++++++- .../connection/jredis/JredisConnectionFactory.java | 9 +++++++++ .../redis/connection/rjc/RjcConnectionFactory.java | 9 +++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java index 51f326a39..1f41fbb6b 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jedis/JedisConnectionFactory.java @@ -280,9 +280,19 @@ public class JedisConnectionFactory implements InitializingBean, DisposableBean, this.poolConfig = poolConfig; } + + /** + * Returns the index of the database. + * + * @return Returns the database index + */ + public int getDatabase() { + return dbIndex; + } + /** * Sets the index of the database used by this connection factory. - * Can be between 0 (default) and 15. + * Default is 0. * * @param index database index */ diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnectionFactory.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnectionFactory.java index 87ae5c1a5..a52d377a1 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnectionFactory.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/jredis/JredisConnectionFactory.java @@ -224,6 +224,15 @@ public class JredisConnectionFactory implements InitializingBean, DisposableBean usePool = true; } + /** + * Returns the index of the database. + * + * @return Returns the database index + */ + public int getDatabase() { + return dbIndex; + } + /** * Sets the index of the database used by this connection factory. * Can be between 0 (default) and 15. diff --git a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionFactory.java b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionFactory.java index 5c149f107..641c9c61f 100644 --- a/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionFactory.java +++ b/spring-data-redis/src/main/java/org/springframework/data/keyvalue/redis/connection/rjc/RjcConnectionFactory.java @@ -196,6 +196,15 @@ public class RjcConnectionFactory implements InitializingBean, DisposableBean, R this.usePool = usePool; } + /** + * Returns the index of the database. + * + * @return Returns the database index + */ + public int getDatabase() { + return dbIndex; + } + /** * Sets the index of the database used by this connection factory. * Can be between 0 (default) and 15.