1515 */
1616package org .springframework .data .redis .connection ;
1717
18- import static org .springframework .util .StringUtils .* ;
18+ import static org .springframework .util .StringUtils .commaDelimitedListToSet ;
1919
2020import java .util .Collections ;
2121import java .util .HashMap ;
3232import org .springframework .util .StringUtils ;
3333
3434/**
35- * Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using connecting
36- * to <a href="https://redis.io/topics/sentinel">Redis Sentinel(s)</a>. Useful when setting up a high availability Redis
35+ * Configuration class used to set up a {@link RedisConnection} with {@link RedisConnectionFactory} for connecting
36+ * to <a href="https://redis.io/topics/sentinel">Redis Sentinel(s)</a>. Useful when setting up a highly available Redis
3737 * environment.
3838 *
3939 * @author Christoph Strobl
4040 * @author Thomas Darimont
4141 * @author Mark Paluch
4242 * @author Vikas Garg
43+ * @author John Blum
4344 * @since 1.4
4445 */
4546public class RedisSentinelConfiguration implements RedisConfiguration , SentinelConfiguration {
@@ -49,24 +50,27 @@ public class RedisSentinelConfiguration implements RedisConfiguration, SentinelC
4950 private static final String REDIS_SENTINEL_USERNAME_CONFIG_PROPERTY = "spring.redis.sentinel.username" ;
5051 private static final String REDIS_SENTINEL_PASSWORD_CONFIG_PROPERTY = "spring.redis.sentinel.password" ;
5152
52- private @ Nullable NamedNode master ;
53- private Set <RedisNode > sentinels ;
5453 private int database ;
5554
56- private @ Nullable String dataNodeUsername = null ;
57- private @ Nullable String sentinelUsername = null ;
55+ private @ Nullable NamedNode master ;
56+
5857 private RedisPassword dataNodePassword = RedisPassword .none ();
5958 private RedisPassword sentinelPassword = RedisPassword .none ();
6059
60+ private final Set <RedisNode > sentinels ;
61+
62+ private @ Nullable String dataNodeUsername = null ;
63+ private @ Nullable String sentinelUsername = null ;
64+
6165 /**
62- * Creates new {@link RedisSentinelConfiguration}.
66+ * Creates a new, default {@link RedisSentinelConfiguration}.
6367 */
6468 public RedisSentinelConfiguration () {
6569 this (new MapPropertySource ("RedisSentinelConfiguration" , Collections .emptyMap ()));
6670 }
6771
6872 /**
69- * Creates {@link RedisSentinelConfiguration} for given hostPort combinations.
73+ * Creates a new {@link RedisSentinelConfiguration} for given {@link String hostPort} combinations.
7074 *
7175 * <pre>
7276 * sentinelHostAndPorts[0] = 127.0.0.1:23679 sentinelHostAndPorts[1] = 127.0.0.1:23680 ...
@@ -80,7 +84,8 @@ public RedisSentinelConfiguration(String master, Set<String> sentinelHostAndPort
8084 }
8185
8286 /**
83- * Creates {@link RedisSentinelConfiguration} looking up values in given {@link PropertySource}.
87+ * Creates a new {@link RedisSentinelConfiguration} looking up configuration values from the given
88+ * {@link PropertySource}.
8489 *
8590 * <pre>
8691 * <code>
0 commit comments