クラス 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) 指定されたhostPortSE の組み合わせに対して新しいRedisClusterConfigurationを作成します。RedisClusterConfiguration(PropertySource<?> propertySource) 使用すべきではありません。メソッドのサマリー
修飾子と型メソッド説明voidaddClusterNode(RedisNode node) クラスターノードを構成に追加します。clusterNode(StringSE host, IntegerSE port) clusterNode(RedisNode node) booleanSetSE またはcluster nodesを返します。接続時に使用する RedisPassword を取得します。接続時に使用するユーザー名を取得します。inthashCode()static RedisClusterConfigurationof(PropertySource<?> propertySource) 指定されたPropertySourceから構成値を検索して新しいRedisClusterConfigurationを作成します。voidsetClusterNodes(IterableSE<RedisNode> nodes) 接続するクラスターノードを設定します。voidsetMaxRedirects(int maxRedirects) voidsetPassword(RedisPassword password) 指定されたStringSE に対してRedisPasswordを作成および設定します。voidsetUsername(StringSE username) 指定されたStringSE を使用してユーザー名を作成および設定します。クラス 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
指定されたhostPortSE の組み合わせに対して新しい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.ClusterConfigurationSetSE またはcluster nodesを返します。- 次で指定:
- インターフェース
RedisConfiguration.ClusterConfigurationのgetClusterNodes - 戻り値:
SetSE の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指定されたStringSE を使用してユーザー名を作成および設定します。Redis 6 以降が必要です。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthenticationのsetUsername - パラメーター:
username- ユーザー名。
getUsername
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication接続時に使用するユーザー名を取得します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthenticationのgetUsername - 戻り値:
- 何も設定されていない場合は null。
setPassword
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication指定されたStringSE に対して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)を使用してください。