public final class ClientSetInfoConfig
extends java.lang.Object
This class supports two modes of operation:
withLibNameSuffix(String) for advanced suffix customization,
where the provided string is already preformatted according to the rules of the `CLIENT SETINFO`
commandClientSetInfoConfig(DriverInfo) used when the command parameter
will be built by the driver based on the DriverInfo provided
For backward compatibility, getUpstreamDrivers() returns the upstream drivers string
when using driver info mode.
DriverInfo,
CLIENT SETINFO| Modifier and Type | Field and Description |
|---|---|
static ClientSetInfoConfig |
DEFAULT
Default configuration that uses the Jedis library name without any upstream drivers.
|
static ClientSetInfoConfig |
DISABLED
Configuration that disables CLIENT SETINFO command.
|
| Constructor and Description |
|---|
ClientSetInfoConfig()
Creates a new ClientSetInfoConfig with default settings.
|
ClientSetInfoConfig(boolean disabled)
Creates a new ClientSetInfoConfig with the specified disabled state.
|
ClientSetInfoConfig(DriverInfo driverInfo)
Creates a new ClientSetInfoConfig with the specified driver information.
|
ClientSetInfoConfig(java.lang.String libNameSuffix)
Creates a new ClientSetInfoConfig with a library name suffix.
|
| Modifier and Type | Method and Description |
|---|---|
DriverInfo |
getDriverInfo() |
java.lang.String |
getUpstreamDrivers()
Returns the formatted upstream drivers string.
|
boolean |
isDisabled() |
static ClientSetInfoConfig |
withLibNameSuffix(java.lang.String suffix)
Creates a new ClientSetInfoConfig with a library name suffix.
|
public static final ClientSetInfoConfig DEFAULT
public static final ClientSetInfoConfig DISABLED
public ClientSetInfoConfig()
The default configuration uses the "jedis" library name without any upstream drivers.
public ClientSetInfoConfig(boolean disabled)
When disabled, the CLIENT SETINFO command will not be sent to Redis.
disabled - true to disable CLIENT SETINFO, false otherwisepublic ClientSetInfoConfig(java.lang.String libNameSuffix)
This constructor is for legacy compatibility. The suffix will be appended to "jedis" in
parentheses, resulting in a format like: jedis(suffix).
For adding upstream driver information, use ClientSetInfoConfig(DriverInfo) with a
DriverInfo that has upstream drivers.
libNameSuffix - the suffix to append to "jedis" (will be placed in parentheses)JedisValidationException - if libNameSuffix contains bracespublic ClientSetInfoConfig(DriverInfo driverInfo)
This is the recommended constructor for setting up driver information with upstream drivers. The driver information can optionally override the library name completely.
driverInfo - the driver information, must not be nullJedisValidationException - if driverInfo is nullpublic boolean isDisabled()
true if CLIENT SETINFO is disabled, false otherwisepublic DriverInfo getDriverInfo()
public java.lang.String getUpstreamDrivers()
Multiple drivers are separated by semicolons, with the most recently added driver appearing first.
Examples:
"spring-data-redis_v3.2.0" - single upstream driver"lettuce-core_v6.4.1;spring-data-redis_v3.2.0" - multiple upstream driversnull if no upstream drivers are setpublic static ClientSetInfoConfig withLibNameSuffix(java.lang.String suffix)
This is the legacy method for simple name customization. The provided suffix will be appended
to "jedis" in parentheses, resulting in a format like: jedis(suffix). For adding
upstream driver information, use ClientSetInfoConfig(DriverInfo) with a *
DriverInfo that has upstream drivers.
suffix - the suffix to append to "jedis" (will be placed in parentheses)Copyright © 2025. All rights reserved.