クラス 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) 指定されたhostPort
SE の組み合わせに対して新しいRedisSentinelConfiguration
を作成します。RedisSentinelConfiguration
(PropertySource<?> propertySource) 使用すべきではありません。メソッドのサマリー
修飾子と型メソッド説明void
addSentinel
(RedisNode sentinel) sentinel を追加します。boolean
int
使用するデータベースインデックスを取得します。Sentinel マスターノードを取得します。接続時に使用する RedisPassword を取得します。Redis Sentinel に接続するときに使用するRedisPassword
を返します。センチネルのCollections.unmodifiableSet(Set)
SE を返します。接続時に使用するユーザー名を取得します。接続時に使用するユーザー名を取得します。int
hashCode()
static RedisSentinelConfiguration
of
(PropertySource<?> propertySource) 指定されたPropertySource
から新しいRedisSentinelConfiguration
を構築します。void
setDatabase
(int index) 使用するデータベースインデックスを設定します。void
マスターノードを設定します。void
setPassword
(RedisPassword password) 指定されたString
SE に対してRedisPassword
を作成および設定します。void
setSentinelPassword
(RedisPassword sentinelPassword) Redis Sentinel で認証するときに使用するRedisPassword
を設定します。void
setSentinels
(IterableSE<RedisNode> sentinels) 接続するセンチネルを設定します。void
setSentinelUsername
(StringSE sentinelUsername) 指定されたString
SE を使用してユーザー名を作成および設定します。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.SentinelConfiguration から継承されたメソッド
getDataNodePassword, getDataNodeUsername, setMaster, setSentinelPassword, setSentinelPassword
インターフェース org.springframework.data.redis.connection.RedisConfiguration.WithAuthentication から継承されたメソッド
setPassword, setPassword
コンストラクターの詳細
RedisSentinelConfiguration
public RedisSentinelConfiguration()新しいデフォルトのRedisSentinelConfiguration
を作成します。RedisSentinelConfiguration
指定されたhostPort
SE の組み合わせに対して新しい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
- 戻り値:
- センチネルの
Set
SE。null になることはありません。
addSentinel
sentinel を追加します。- パラメーター:
sentinel
- null であってはなりません。
setMaster
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration
マスターノードを設定します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfiguration
のsetMaster
- パラメーター:
master
- null であってはなりません。
getMaster
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration
Sentinel マスターノードを取得します。- 次で指定:
- インターフェース
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
指定されたString
SE を使用してユーザー名を作成および設定します。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
指定されたString
SE に対してRedisPassword
を作成および設定します。- 次で指定:
- インターフェース
RedisConfiguration.WithAuthentication
のsetPassword
- パラメーター:
password
- null であってはならず、代わりにRedisPassword.none()
を使用してください。
getSentinelUsername
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration
接続時に使用するユーザー名を取得します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfiguration
のgetSentinelUsername
- 戻り値:
- 何も設定されていない場合は null。
setSentinelUsername
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration
指定されたString
SE を使用してユーザー名を作成および設定します。Redis 6 以降が必要です。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfiguration
のsetSentinelUsername
- パラメーター:
sentinelUsername
- sentinel のユーザー名。
setSentinelPassword
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration
Redis Sentinel で認証するときに使用するRedisPassword
を設定します。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfiguration
のsetSentinelPassword
- パラメーター:
sentinelPassword
- null であってはならず、代わりにRedisPassword.none()
を使用してください。
getSentinelPassword
インターフェースからコピーされた説明:RedisConfiguration.SentinelConfiguration
Redis Sentinel に接続するときに使用するRedisPassword
を返します。
パスワードが設定されていない場合は、RedisConfiguration.SentinelConfiguration.setSentinelPassword(RedisPassword)
またはRedisPassword.none()
を介して設定できます。- 次で指定:
- インターフェース
RedisConfiguration.SentinelConfiguration
のgetSentinelPassword
- 戻り値:
- Redis Sentinel で認証するための
RedisPassword
。
equals
hashCode
public int hashCode()
of(PropertySource)
を使用してください。