Class LettuceClientConfiguration.LettuceClientConfigurationBuilder
java.lang.Object
org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration.LettuceClientConfigurationBuilder
- Direct Known Subclasses:
LettucePoolingClientConfiguration.LettucePoolingClientConfigurationBuilder
- Enclosing interface:
- LettuceClientConfiguration
- Author:
- Mark Paluch, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionapply
(io.lettuce.core.RedisURI redisUri) Apply SSL settings, command timeout, and client name from aRedisURI
.build()
Build theLettuceClientConfiguration
with the configuration applied from this builder.clientName
(String clientName) Configure aclientName
to be set withCLIENT SETNAME
.clientOptions
(io.lettuce.core.ClientOptions clientOptions) ConfigureClientOptions
.clientResources
(io.lettuce.core.resource.ClientResources clientResources) ConfigureClientResources
.commandTimeout
(Duration timeout) Configure a command timeout.readFrom
(io.lettuce.core.ReadFrom readFrom) ConfigureReadFrom
.redisCredentialsProviderFactory
(RedisCredentialsProviderFactory redisCredentialsProviderFactory) Configure aRedisCredentialsProviderFactory
to obtainRedisCredentialsProvider
instances to support credential rotation.shutdownQuietPeriod
(Duration shutdownQuietPeriod) Configure the shutdown quiet period.shutdownTimeout
(Duration shutdownTimeout) Configure a shutdown timeout.useSsl()
Enable SSL connections.
-
Method Details
-
apply
public LettuceClientConfiguration.LettuceClientConfigurationBuilder apply(io.lettuce.core.RedisURI redisUri) Apply SSL settings, command timeout, and client name from aRedisURI
.- Parameters:
redisUri
- the connection URI.- Returns:
- this builder.
- Since:
- 2.5.3
-
useSsl
Enable SSL connections. -
clientResources
public LettuceClientConfiguration.LettuceClientConfigurationBuilder clientResources(io.lettuce.core.resource.ClientResources clientResources) ConfigureClientResources
.- Parameters:
clientResources
- must not be null.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if clientResources is null.
-
clientOptions
public LettuceClientConfiguration.LettuceClientConfigurationBuilder clientOptions(io.lettuce.core.ClientOptions clientOptions) ConfigureClientOptions
.- Parameters:
clientOptions
- must not be null.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if clientOptions is null.
-
readFrom
public LettuceClientConfiguration.LettuceClientConfigurationBuilder readFrom(io.lettuce.core.ReadFrom readFrom) ConfigureReadFrom
. Enables Master/Replica operations if configured.- Parameters:
readFrom
- must not be null.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if readFrom is null.- Since:
- 2.1
-
redisCredentialsProviderFactory
public LettuceClientConfiguration.LettuceClientConfigurationBuilder redisCredentialsProviderFactory(RedisCredentialsProviderFactory redisCredentialsProviderFactory) Configure aRedisCredentialsProviderFactory
to obtainRedisCredentialsProvider
instances to support credential rotation.- Parameters:
redisCredentialsProviderFactory
- must not be null.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if redisCredentialsProviderFactory is null.- Since:
- 3.0
-
clientName
Configure aclientName
to be set withCLIENT SETNAME
.- Parameters:
clientName
- must not be null or empty.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if clientName is null or empty.- Since:
- 2.1
-
commandTimeout
public LettuceClientConfiguration.LettuceClientConfigurationBuilder commandTimeout(Duration timeout) Configure a command timeout.- Parameters:
timeout
- must not be null.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if timeout is null.
-
shutdownTimeout
public LettuceClientConfiguration.LettuceClientConfigurationBuilder shutdownTimeout(Duration shutdownTimeout) Configure a shutdown timeout.- Parameters:
shutdownTimeout
- must not be null.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if shutdownTimeout is null.
-
shutdownQuietPeriod
public LettuceClientConfiguration.LettuceClientConfigurationBuilder shutdownQuietPeriod(Duration shutdownQuietPeriod) Configure the shutdown quiet period.- Parameters:
shutdownQuietPeriod
- must not be null.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if shutdownQuietPeriod is null.- Since:
- 2.2
-
build
Build theLettuceClientConfiguration
with the configuration applied from this builder.- Returns:
- a new
LettuceClientConfiguration
object.
-