クラス RedisStaticMasterReplicaConfiguration
java.lang.ObjectSE
org.springframework.data.redis.connection.RedisStaticMasterReplicaConfiguration
- 実装されたすべてのインターフェース:
RedisConfiguration
、RedisConfiguration.StaticMasterReplicaConfiguration
、RedisConfiguration.WithAuthentication
、RedisConfiguration.WithDatabaseIndex
、RedisConfiguration.WithPassword
public class RedisStaticMasterReplicaConfiguration
extends ObjectSE
implements RedisConfiguration, RedisConfiguration.StaticMasterReplicaConfiguration
アドレスを変更しないことを認識しているノードに提供されたマスター / レプリカ構成を使用して、
また、マスター / レプリカ接続は Pub/Sub 操作には使用できないことに注意してください。
RedisConnectionFactory
経由で RedisConnection
をセットアップするために使用される構成クラス。例: リードレプリカを使用した AWS ElastiCache に接続する場合。また、マスター / レプリカ接続は Pub/Sub 操作には使用できないことに注意してください。
- 導入:
- 2.1
- 作成者:
- Mark Paluch, Christoph Strobl, Tamer Soliman
ネストされたクラスのサマリー
インターフェース org.springframework.data.redis.connection.RedisConfiguration から継承されたネストクラス / インターフェース
RedisConfiguration.ClusterConfiguration, RedisConfiguration.DomainSocketConfiguration, RedisConfiguration.SentinelConfiguration, RedisConfiguration.StaticMasterReplicaConfiguration, RedisConfiguration.WithAuthentication, RedisConfiguration.WithDatabaseIndex, RedisConfiguration.WithDomainSocket, RedisConfiguration.WithHostAndPort, RedisConfiguration.WithPassword
コンストラクターのサマリー
コンストラクターコンストラクター説明hostName
を指定して新しいRedisConfiguration.StaticMasterReplicaConfiguration
を作成します。RedisStaticMasterReplicaConfiguration
(StringSE hostName, int port) メソッドのサマリー
修飾子と型メソッド説明void
hostName
を指定したノードのリストにnode
を追加します。boolean
int
使用するデータベースインデックスを取得します。getNodes()
接続時に使用する RedisPassword を取得します。接続時に使用するユーザー名を取得します。int
hashCode()
hostName
を指定したノードのリストにnode
を追加します。void
setDatabase
(int index) 使用するデータベースインデックスを設定します。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
コンストラクターの詳細
RedisStaticMasterReplicaConfiguration
hostName
を指定して新しいRedisConfiguration.StaticMasterReplicaConfiguration
を作成します。- パラメーター:
hostName
- null または空であってはなりません。
RedisStaticMasterReplicaConfiguration
- パラメーター:
hostName
- null または空であってはなりません。port
- 有効な TCP ポート(1-65535)。
メソッドの詳細
addNode
hostName
を指定したノードのリストにnode
を追加します。- パラメーター:
hostName
- null または空であってはなりません。port
- 有効な TCP ポート(1-65535)。
node
hostName
を指定したノードのリストにnode
を追加します。- パラメーター:
hostName
- null または空であってはなりません。- 戻り値:
this
RedisConfiguration.StaticMasterReplicaConfiguration
。
node
- パラメーター:
hostName
- null または空であってはなりません。port
- 有効な TCP ポート(1-65535)。- 戻り値:
this
RedisConfiguration.StaticMasterReplicaConfiguration
。
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()
を使用してください。
getNodes
- 次で指定:
- インターフェース
RedisConfiguration.StaticMasterReplicaConfiguration
のgetNodes
- 戻り値:
nodes
の変更不可能なList
SE。
equals
hashCode
public int hashCode()