Edit class Javadoc in Redis*Configuration classes.
Additionally, fix a few commpiler warnings and organize instance variables by type. Closes #2586
This commit is contained in:
@@ -35,12 +35,13 @@ import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using connecting
|
||||
* to <a href="https://redis.io/topics/cluster-spec">Redis Cluster</a>. Useful when setting up a high availability Redis
|
||||
* Configuration class used to set up a {@link RedisConnection} via {@link RedisConnectionFactory} for connecting
|
||||
* to <a href="https://redis.io/topics/cluster-spec">Redis Cluster</a>. Useful when setting up a highly available Redis
|
||||
* environment.
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @author Mark Paluch
|
||||
* @author John Blum
|
||||
* @since 1.7
|
||||
*/
|
||||
public class RedisClusterConfiguration implements RedisConfiguration, ClusterConfiguration {
|
||||
@@ -57,14 +58,14 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon
|
||||
private @Nullable String username = null;
|
||||
|
||||
/**
|
||||
* Creates new {@link RedisClusterConfiguration}.
|
||||
* Creates a new, default {@link RedisClusterConfiguration}.
|
||||
*/
|
||||
public RedisClusterConfiguration() {
|
||||
this(new MapPropertySource("RedisClusterConfiguration", Collections.emptyMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates {@link RedisClusterConfiguration} for given hostPort combinations.
|
||||
* Creates a new {@link RedisClusterConfiguration} for given {@link String hostPort} combinations.
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
@@ -80,7 +81,8 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates {@link RedisClusterConfiguration} looking up values in given {@link PropertySource}.
|
||||
* Creates a new {@link RedisClusterConfiguration} looking up configuration values from the given
|
||||
* {@link PropertySource}.
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.redis.connection;
|
||||
|
||||
import static org.springframework.util.StringUtils.*;
|
||||
import static org.springframework.util.StringUtils.commaDelimitedListToSet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -32,14 +32,15 @@ import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using connecting
|
||||
* to <a href="https://redis.io/topics/sentinel">Redis Sentinel(s)</a>. Useful when setting up a high availability Redis
|
||||
* Configuration class used to set up a {@link RedisConnection} with {@link RedisConnectionFactory} for connecting
|
||||
* to <a href="https://redis.io/topics/sentinel">Redis Sentinel(s)</a>. Useful when setting up a highly available Redis
|
||||
* environment.
|
||||
*
|
||||
* @author Christoph Strobl
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
* @author Vikas Garg
|
||||
* @author John Blum
|
||||
* @since 1.4
|
||||
*/
|
||||
public class RedisSentinelConfiguration implements RedisConfiguration, SentinelConfiguration {
|
||||
@@ -49,24 +50,27 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC
|
||||
private static final String REDIS_SENTINEL_USERNAME_CONFIG_PROPERTY = "spring.redis.sentinel.username";
|
||||
private static final String REDIS_SENTINEL_PASSWORD_CONFIG_PROPERTY = "spring.redis.sentinel.password";
|
||||
|
||||
private @Nullable NamedNode master;
|
||||
private Set<RedisNode> sentinels;
|
||||
private int database;
|
||||
|
||||
private @Nullable String dataNodeUsername = null;
|
||||
private @Nullable String sentinelUsername = null;
|
||||
private @Nullable NamedNode master;
|
||||
|
||||
private RedisPassword dataNodePassword = RedisPassword.none();
|
||||
private RedisPassword sentinelPassword = RedisPassword.none();
|
||||
|
||||
private final Set<RedisNode> sentinels;
|
||||
|
||||
private @Nullable String dataNodeUsername = null;
|
||||
private @Nullable String sentinelUsername = null;
|
||||
|
||||
/**
|
||||
* Creates new {@link RedisSentinelConfiguration}.
|
||||
* Creates a new, default {@link RedisSentinelConfiguration}.
|
||||
*/
|
||||
public RedisSentinelConfiguration() {
|
||||
this(new MapPropertySource("RedisSentinelConfiguration", Collections.emptyMap()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates {@link RedisSentinelConfiguration} for given hostPort combinations.
|
||||
* Creates a new {@link RedisSentinelConfiguration} for given {@link String hostPort} combinations.
|
||||
*
|
||||
* <pre>
|
||||
* sentinelHostAndPorts[0] = 127.0.0.1:23679 sentinelHostAndPorts[1] = 127.0.0.1:23680 ...
|
||||
@@ -80,7 +84,8 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates {@link RedisSentinelConfiguration} looking up values in given {@link PropertySource}.
|
||||
* Creates a new {@link RedisSentinelConfiguration} looking up configuration values from the given
|
||||
* {@link PropertySource}.
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
|
||||
@@ -23,25 +23,29 @@ import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using connecting
|
||||
* to a single node <a href="https://redis.io/">Redis</a> installation.
|
||||
* Configuration class used to set up a {@link RedisConnection} with {@link RedisConnectionFactory} for connecting
|
||||
* to a single node <a href="https://redis.io/">Redis</a> instance.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Strobl
|
||||
* @author John Blum
|
||||
* @since 2.0
|
||||
*/
|
||||
public class RedisStandaloneConfiguration
|
||||
implements RedisConfiguration, WithHostAndPort, WithPassword, WithDatabaseIndex {
|
||||
|
||||
private static final String DEFAULT_HOST = "localhost";
|
||||
private static final int DEFAULT_PORT = 6379;
|
||||
|
||||
private String hostName = DEFAULT_HOST;
|
||||
private int port = DEFAULT_PORT;
|
||||
private static final String DEFAULT_HOST = "localhost";
|
||||
|
||||
private int database;
|
||||
private @Nullable String username = null;
|
||||
private int port = DEFAULT_PORT;
|
||||
|
||||
private RedisPassword password = RedisPassword.none();
|
||||
|
||||
private String hostName = DEFAULT_HOST;
|
||||
private @Nullable String username = null;
|
||||
|
||||
/**
|
||||
* Create a new default {@link RedisStandaloneConfiguration}.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user