public class RedisStandaloneConfiguration extends Object implements RedisConfiguration, RedisConfiguration.WithHostAndPort, RedisConfiguration.WithPassword, RedisConfiguration.WithDatabaseIndex
RedisConnection
via RedisConnectionFactory
using connecting
to a single node Redis installation.RedisConfiguration.ClusterConfiguration, RedisConfiguration.DomainSocketConfiguration, RedisConfiguration.SentinelConfiguration, RedisConfiguration.StaticMasterReplicaConfiguration, RedisConfiguration.WithAuthentication, RedisConfiguration.WithDatabaseIndex, RedisConfiguration.WithDomainSocket, RedisConfiguration.WithHostAndPort, RedisConfiguration.WithPassword
Constructor and Description |
---|
RedisStandaloneConfiguration()
Create a new default
RedisStandaloneConfiguration . |
RedisStandaloneConfiguration(String hostName)
Create a new
RedisStandaloneConfiguration given hostName . |
RedisStandaloneConfiguration(String hostName,
int port)
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getDatabase()
Get the database index to use.
|
String |
getHostName() |
RedisPassword |
getPassword()
Get the RedisPassword to use when connecting.
|
int |
getPort()
Get the Redis server port.
|
String |
getUsername()
Get the username to use when connecting.
|
int |
hashCode() |
void |
setDatabase(int index)
Set the database index to use.
|
void |
setHostName(String hostName)
Set the Redis server hostname
|
void |
setPassword(RedisPassword password)
Create and set a
RedisPassword for given String . |
void |
setPort(int port)
Set the Redis server port.
|
void |
setUsername(String username)
Create and set a username with the given
String . |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getDatabaseOrElse, getDatabaseOrElse, getHostOrElse, getPasswordOrElse, getPasswordOrElse, getPortOrElse, getUsernameOrElse, isAuthenticationAware, isClusterConfiguration, isDatabaseIndexAware, isDomainSocketConfiguration, isHostAndPortAware, isSentinelConfiguration, isStaticMasterReplicaConfiguration
setPassword, setPassword
public RedisStandaloneConfiguration()
RedisStandaloneConfiguration
.public RedisStandaloneConfiguration(String hostName)
RedisStandaloneConfiguration
given hostName
.hostName
- must not be null or empty.public RedisStandaloneConfiguration(String hostName, int port)
hostName
- must not be null or empty.port
- a valid TCP port (1-65535).public String getHostName()
getHostName
in interface RedisConfiguration.WithHostAndPort
public int getPort()
RedisConfiguration.WithHostAndPort
getPort
in interface RedisConfiguration.WithHostAndPort
public void setHostName(String hostName)
RedisConfiguration.WithHostAndPort
setHostName
in interface RedisConfiguration.WithHostAndPort
hostName
- must not be null.public void setPort(int port)
RedisConfiguration.WithHostAndPort
setPort
in interface RedisConfiguration.WithHostAndPort
public int getDatabase()
RedisConfiguration.WithDatabaseIndex
getDatabase
in interface RedisConfiguration.WithDatabaseIndex
zero
by default.public void setDatabase(int index)
RedisConfiguration.WithDatabaseIndex
setDatabase
in interface RedisConfiguration.WithDatabaseIndex
public void setUsername(@Nullable String username)
RedisConfiguration.WithAuthentication
String
. Requires Redis 6 or newer.setUsername
in interface RedisConfiguration.WithAuthentication
username
- the username.@Nullable public String getUsername()
RedisConfiguration.WithAuthentication
getUsername
in interface RedisConfiguration.WithAuthentication
public RedisPassword getPassword()
RedisConfiguration.WithAuthentication
getPassword
in interface RedisConfiguration.WithAuthentication
RedisPassword.none()
if none set.public void setPassword(RedisPassword password)
RedisConfiguration.WithAuthentication
RedisPassword
for given String
.setPassword
in interface RedisConfiguration.WithAuthentication
password
- must not be null use RedisPassword.none()
instead.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.