Skip to content

Commit

Permalink
Deprecate helper methods in DefaultJedisClientConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Dec 24, 2024
1 parent 8fbadc2 commit 25e65d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ public Builder from(JedisClientConfig instance) {
}
}

/**
* @deprecated Use {@link redis.clients.jedis.DefaultJedisClientConfig.Builder}.
*/
@Deprecated
public static DefaultJedisClientConfig create(int connectionTimeoutMillis, int soTimeoutMillis,
int blockingSocketTimeoutMillis, String user, String password, int database, String clientName,
boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters,
Expand All @@ -335,6 +339,10 @@ public static DefaultJedisClientConfig create(int connectionTimeoutMillis, int s
return builder.build();
}

/**
* @deprecated Use
* {@link redis.clients.jedis.DefaultJedisClientConfig.Builder#from(redis.clients.jedis.JedisClientConfig)}.
*/
@Deprecated
public static DefaultJedisClientConfig copyConfig(JedisClientConfig copy) {
Builder builder = builder();
Expand Down
19 changes: 12 additions & 7 deletions src/main/java/redis/clients/jedis/JedisPooled.java
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,12 @@ public JedisPooled(final GenericObjectPoolConfig<Connection> poolConfig, final S
}

public JedisPooled(final GenericObjectPoolConfig<Connection> poolConfig, final String host, int port,
final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout,
final String user, final String password, final int database, final String clientName) {
this(new HostAndPort(host, port), DefaultJedisClientConfig.create(connectionTimeout, soTimeout,
infiniteSoTimeout, user, password, database, clientName, false, null, null, null, null),
final int connectionTimeout, final int soTimeout, final int infiniteSoTimeout, final String user,
final String password, final int database, final String clientName) {
this(new HostAndPort(host, port),
DefaultJedisClientConfig.builder().connectionTimeoutMillis(connectionTimeout).socketTimeoutMillis(soTimeout)
.blockingSocketTimeoutMillis(infiniteSoTimeout).user(user).password(password).database(database)
.clientName(clientName).build(),
poolConfig);
}

Expand All @@ -304,9 +306,12 @@ public JedisPooled(final GenericObjectPoolConfig<Connection> poolConfig, final S
final String password, final int database, final String clientName, final boolean ssl,
final SSLSocketFactory sslSocketFactory, final SSLParameters sslParameters,
final HostnameVerifier hostnameVerifier) {
this(new HostAndPort(host, port), DefaultJedisClientConfig.create(connectionTimeout, soTimeout,
infiniteSoTimeout, user, password, database, clientName, ssl, sslSocketFactory, sslParameters,
hostnameVerifier, null), poolConfig);
this(new HostAndPort(host, port),
DefaultJedisClientConfig.builder().connectionTimeoutMillis(connectionTimeout).socketTimeoutMillis(soTimeout)
.blockingSocketTimeoutMillis(infiniteSoTimeout).user(user).password(password).database(database)
.clientName(clientName).ssl(ssl).sslSocketFactory(sslSocketFactory).sslParameters(sslParameters)
.hostnameVerifier(hostnameVerifier).build(),
poolConfig);
}

public JedisPooled(final URI uri) {
Expand Down

0 comments on commit 25e65d3

Please sign in to comment.