クラス RedisClusterConfiguration
java.lang.ObjectSE
org.springframework.data.redis.connection.RedisClusterConfiguration
- 実装されたすべてのインターフェース:
RedisConfiguration
、RedisConfiguration.ClusterConfiguration
、RedisConfiguration.WithAuthentication
、RedisConfiguration.WithPassword
public class RedisClusterConfiguration
extends ObjectSE
implements RedisConfiguration, RedisConfiguration.ClusterConfiguration
Redis クラスターに接続するために
RedisConnectionFactory
経由で RedisConnection
をセットアップするために使用される構成クラス。高可用性 Redis 環境をセットアップする場合に役立ちます。- 導入:
- 1.7
- 作成者:
- Christoph Strobl, Mark Paluch, John Blum
ネストされたクラスのサマリー
インターフェース org.springframework.data.redis.connection.RedisConfiguration から継承されたネストクラス / インターフェース
RedisConfiguration.ClusterConfiguration, RedisConfiguration.DomainSocketConfiguration, RedisConfiguration.SentinelConfiguration, RedisConfiguration.StaticMasterReplicaConfiguration, RedisConfiguration.WithAuthentication, RedisConfiguration.WithDatabaseIndex, RedisConfiguration.WithDomainSocket, RedisConfiguration.WithHostAndPort, RedisConfiguration.WithPassword
コンストラクターの概要
コンストラクターコンストラクター説明新しいデフォルトのRedisClusterConfiguration
を作成します。RedisClusterConfiguration
(CollectionSE<StringSE> clusterNodes) 指定されたhostPort
SE の組み合わせに対して新しいRedisClusterConfiguration
を作成します。RedisClusterConfiguration
(PropertySource<?> propertySource) 使用すべきではありません。メソッドのサマリー
修飾子と型メソッド説明void
addClusterNode
(RedisNode node) クラスターノードを構成に追加します。clusterNode
(StringSE host, IntegerSE port) clusterNode
(RedisNode node) boolean
Set
SE またはcluster nodes
を返します。接続時に使用する RedisPassword を取得します。接続時に使用するユーザー名を取得します。int
hashCode()
static RedisClusterConfiguration
of
(PropertySource<?> propertySource) 指定されたPropertySource
から構成値を検索して新しいRedisClusterConfiguration
を作成します。void
setClusterNodes
(IterableSE<RedisNode> nodes) 接続するクラスターノードを設定します。void
setMaxRedirects
(int maxRedirects) void
setPassword
(RedisPassword password) 指定されたString
SE に対してRedisPassword
を作成および設定します。void
setUsername
(StringSE username) 指定されたString
SE を使用してユーザー名を作成および設定します。クラス java.lang.ObjectSE から継承されたメソッド
clone, finalize, getClass, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.data.redis.connection.RedisConfiguration から継承されたメソッド
getDatabaseOrElse, getPasswordOrElse
インターフェース org.springframework.data.redis.connection.RedisConfiguration.WithAuthentication から継承されたメソッド
setPassword, setPassword
コンストラクターの詳細
RedisClusterConfiguration
public RedisClusterConfiguration()新しいデフォルトのRedisClusterConfiguration
を作成します。RedisClusterConfiguration
指定されたhostPort
SE の組み合わせに対して新しいRedisClusterConfiguration
を作成します。clusterHostAndPorts[0] = 127.0.0.1:23679 clusterHostAndPorts[1] = 127.0.0.1:23680 ...
- パラメーター:
clusterNodes
- null であってはなりません。
RedisClusterConfiguration
使用すべきではありません。3.3 以降では、代わりにRedisSentinelConfiguration.of(PropertySource)
を使用してください。このコンストラクターは、次のメジャーリリースで非公開になります。指定されたPropertySource
から構成値を検索して新しいRedisClusterConfiguration
を作成します。spring.redis.cluster.nodes=127.0.0.1:23679,127.0.0.1:23680,127.0.0.1:23681 spring.redis.cluster.max-redirects=3
- パラメーター:
propertySource
- null であってはなりません。
メソッドの詳細
of
指定されたPropertySource
から構成値を検索して新しいRedisClusterConfiguration
を作成します。spring.redis.cluster.nodes=127.0.0.1:23679,127.0.0.1:23680,127.0.0.1:23681 spring.redis.cluster.max-redirects=3
- パラメーター:
propertySource
- null であってはなりません。- 戻り値:
- 指定された
PropertySource
から構成された新しいRedisClusterConfiguration
。 - 導入:
- 3.3
setClusterNodes
接続するクラスターノードを設定します。- パラメーター:
nodes
- null であってはなりません。
getClusterNodes
インターフェースからコピーされた説明:RedisConfiguration.ClusterConfiguration
Set
SE またはcluster nodes
を返します。- 次で指定:
- インターフェース
RedisConfiguration.ClusterConfiguration
のgetClusterNodes
- 戻り値:
Set
SE のcluster nodes
。決して null ではありません。
addClusterNode
クラスターノードを構成に追加します。- パラメーター:
node
- null であってはなりません。
clusterNode
- パラメーター:
host
- Redis クラスターノードのホスト名または IP アドレス。port
- Redis クラスターノードポート。- 戻り値:
- this。
clusterNode
- 戻り値:
- this。
setMaxRedirects
public void setMaxRedirects(int maxRedirects) - パラメーター:
maxRedirects
- 従うリダイレクトの最大数。
getMaxRedirects
- 次で指定:
- インターフェース
RedisConfiguration.ClusterConfiguration
のgetMaxRedirects
- 戻り値:
- フォローするリダイレクトの最大数。設定されていない場合は null。
setUsername
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication
指定されたString
SE を使用してユーザー名を作成および設定します。Redis 6 以降が必要です。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthentication
のsetUsername
- パラメーター:
username
- ユーザー名。
getUsername
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication
接続時に使用するユーザー名を取得します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthentication
のgetUsername
- 戻り値:
- 何も設定されていない場合は null。
setPassword
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication
指定されたString
SE に対してRedisPassword
を作成および設定します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthentication
のsetPassword
- パラメーター:
password
- null であってはならず、代わりにRedisPassword.none()
を使用してください。
getPassword
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication
接続時に使用する RedisPassword を取得します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthentication
のgetPassword
- 戻り値:
- 何も設定されていない場合は
RedisPassword.none()
。
equals
hashCode
public int hashCode()
RedisSentinelConfiguration.of(PropertySource)
を使用してください。