クラス RedisSentinelConfiguration
java.lang.ObjectSE
org.springframework.data.redis.connection.RedisSentinelConfiguration
- 実装されているすべてのインターフェース:
RedisConfiguration、RedisConfiguration.SentinelConfiguration、RedisConfiguration.WithAuthentication、RedisConfiguration.WithDatabaseIndex、RedisConfiguration.WithPassword
public class RedisSentinelConfiguration
extends ObjectSE
implements RedisConfiguration, RedisConfiguration.SentinelConfiguration
Configuration クラスは、Redis Sentinel に接続するために RedisConnectionFactory を備えた RedisConnection をセットアップするために使用されます。高可用性 Redis 環境をセットアップする場合に役立ちます。- 導入:
- 1.4
- 作成者:
- Christoph Strobl, Thomas Darimont, Mark Paluch, Vikas Garg, John Blum, Samuel Klose, Mustapha Zorgati
ネストされたクラスの要約
インターフェース org.springframework.data.redis.connection.RedisConfiguration から継承されたネストクラス / インターフェース
RedisConfiguration.ClusterConfiguration, RedisConfiguration.DomainSocketConfiguration, RedisConfiguration.SentinelConfiguration, RedisConfiguration.StaticMasterReplicaConfiguration, RedisConfiguration.WithAuthentication, RedisConfiguration.WithDatabaseIndex, RedisConfiguration.WithDomainSocket, RedisConfiguration.WithHostAndPort, RedisConfiguration.WithPasswordコンストラクターの概要
コンストラクターコンストラクター説明新しいデフォルトのRedisSentinelConfigurationを作成します。RedisSentinelConfiguration(StringSE master, SetSE<StringSE> sentinelHostAndPorts) 指定されたhostPortSE の組み合わせに対して新しいRedisSentinelConfigurationを作成します。RedisSentinelConfiguration(PropertySource<?> propertySource) 使用すべきではありません。メソッドのサマリー
修飾子と型メソッド説明voidaddSentinel(RedisNode sentinel) sentinel を追加します。booleanint使用するデータベースインデックスを取得します。Sentinel マスターノードを取得します。接続時に使用する RedisPassword を取得します。Redis Sentinel に接続するときに使用するRedisPasswordを返します。センチネルのCollections.unmodifiableSet(Set)SE を返します。接続時に使用するユーザー名を取得します。接続時に使用するユーザー名を取得します。inthashCode()static RedisSentinelConfigurationof(PropertySource<?> propertySource) 指定されたPropertySourceから新しいRedisSentinelConfigurationを構築します。voidsetDatabase(int index) 使用するデータベースインデックスを設定します。voidマスターノードを設定します。voidsetPassword(RedisPassword password) 指定されたStringSE に対してRedisPasswordを作成および設定します。voidsetSentinelPassword(RedisPassword sentinelPassword) Redis Sentinel で認証するときに使用するRedisPasswordを設定します。voidsetSentinels(IterableSE<RedisNode> sentinels) 接続するセンチネルを設定します。voidsetSentinelUsername(StringSE sentinelUsername) 指定されたStringSE を使用してユーザー名を作成および設定します。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.SentinelConfiguration から継承されたメソッド
getDataNodePassword, getDataNodeUsername, setMaster, setSentinelPassword, setSentinelPasswordインターフェース org.springframework.data.redis.connection.RedisConfiguration.WithAuthentication から継承されたメソッド
setPassword, setPassword
コンストラクターの詳細
RedisSentinelConfiguration
public RedisSentinelConfiguration()新しいデフォルトのRedisSentinelConfigurationを作成します。RedisSentinelConfiguration
指定されたhostPortSE の組み合わせに対して新しいRedisSentinelConfigurationを作成します。sentinelHostAndPorts[0] = 127.0.0.1:23679 sentinelHostAndPorts[1] = 127.0.0.1:23680 ...
- パラメーター:
sentinelHostAndPorts- null であってはなりません。- 導入:
- 1.5
RedisSentinelConfiguration
使用すべきではありません。3.3 以降では、代わりにof(PropertySource)を使用してください。このコンストラクターは、次のメジャーリリースで非公開になります。指定されたPropertySourceから構成値を検索して新しいRedisSentinelConfigurationを作成します。spring.redis.sentinel.master=myMaster spring.redis.sentinel.nodes=127.0.0.1:23679,127.0.0.1:23680,127.0.0.1:23681
- パラメーター:
propertySource- null であってはなりません。- 導入:
- 1.5
メソッドの詳細
of
指定されたPropertySourceから新しいRedisSentinelConfigurationを構築します。- パラメーター:
propertySource- null であってはなりません。- 戻り値:
- 指定された
PropertySourceから構成された新しいRedisSentinelConfiguration。 - 導入:
- 3.3
setSentinels
接続するセンチネルを設定します。- パラメーター:
sentinels- null であってはなりません。
getSentinels
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfigurationセンチネルのCollections.unmodifiableSet(Set)SE を返します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfigurationのgetSentinels - 戻り値:
- センチネルの
SetSE。null になることはありません。
addSentinel
sentinel を追加します。- パラメーター:
sentinel- null であってはなりません。
setMaster
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfigurationマスターノードを設定します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfigurationのsetMaster - パラメーター:
master- null であってはなりません。
getMaster
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfigurationSentinel マスターノードを取得します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfigurationのgetMaster - 戻り値:
- マスターノードを取得するか、設定されていない場合は null を取得します。
master
- パラメーター:
master- マスターノード名。- 戻り値:
- this。
- 関連事項:
master
- パラメーター:
master- マスターノード- 戻り値:
- this。
- 関連事項:
sentinel
- パラメーター:
sentinel- sentinel として追加するノード。- 戻り値:
- this。
- 関連事項:
sentinel
- パラメーター:
host- redis sentinel ノードのホスト名または IP。port- redis sentinel ポート。- 戻り値:
- this。
- 関連事項:
getDatabase
public int getDatabase()インターフェースからコピーされた説明:RedisConfiguration.WithDatabaseIndex使用するデータベースインデックスを取得します。- 次で指定:
- インターフェース
RedisConfiguration.WithDatabaseIndexのgetDatabase - 戻り値:
- デフォルトでは
zero。
setDatabase
public void setDatabase(int index) インターフェースからコピーされた説明:RedisConfiguration.WithDatabaseIndex使用するデータベースインデックスを設定します。- 次で指定:
- インターフェース
RedisConfiguration.WithDatabaseIndexのsetDatabase
setUsername
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication指定されたStringSE を使用してユーザー名を作成および設定します。Redis 6 以降が必要です。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthenticationのsetUsername - パラメーター:
username- ユーザー名。
getUsername
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication接続時に使用するユーザー名を取得します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthenticationのgetUsername - 戻り値:
- 何も設定されていない場合は null。
getPassword
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication接続時に使用する RedisPassword を取得します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthenticationのgetPassword - 戻り値:
- 何も設定されていない場合は
RedisPassword.none()。
setPassword
インターフェースからコピーされた説明:RedisConfiguration.WithAuthentication指定されたStringSE に対してRedisPasswordを作成および設定します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthenticationのsetPassword - パラメーター:
password- null であってはならず、代わりにRedisPassword.none()を使用してください。
getSentinelUsername
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration接続時に使用するユーザー名を取得します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfigurationのgetSentinelUsername - 戻り値:
- 何も設定されていない場合は null。
setSentinelUsername
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration指定されたStringSE を使用してユーザー名を作成および設定します。Redis 6 以降が必要です。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfigurationのsetSentinelUsername - パラメーター:
sentinelUsername- sentinel のユーザー名。
setSentinelPassword
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfigurationRedis Sentinel で認証するときに使用するRedisPasswordを設定します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfigurationのsetSentinelPassword - パラメーター:
sentinelPassword- null であってはならず、代わりにRedisPassword.none()を使用してください。
getSentinelPassword
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfigurationRedis Sentinel に接続するときに使用するRedisPasswordを返します。
パスワードが設定されていない場合は、RedisConfiguration.SentinelConfiguration.setSentinelPassword(RedisPassword)またはRedisPassword.none()を介して設定できます。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfigurationのgetSentinelPassword - 戻り値:
- Redis Sentinel で認証するための
RedisPassword。
equals
hashCode
public int hashCode()
of(PropertySource)を使用してください。