
redis.clients.jedis.JedisClientConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis Show documentation
Show all versions of jedis Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis;
import java.util.function.Supplier;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocketFactory;
import redis.clients.jedis.authentication.AuthXManager;
public interface JedisClientConfig {
default RedisProtocol getRedisProtocol() {
return null;
}
/**
* @return Connection timeout in milliseconds
*/
default int getConnectionTimeoutMillis() {
return Protocol.DEFAULT_TIMEOUT;
}
/**
* @return Socket timeout in milliseconds
*/
default int getSocketTimeoutMillis() {
return Protocol.DEFAULT_TIMEOUT;
}
/**
* @return Socket timeout (in milliseconds) to use during blocking operation. Default is '0',
* which means to block forever.
*/
default int getBlockingSocketTimeoutMillis() {
return 0;
}
/**
* @return Redis ACL user
*/
default String getUser() {
return null;
}
default String getPassword() {
return null;
}
default Supplier getCredentialsProvider() {
return new DefaultRedisCredentialsProvider(
new DefaultRedisCredentials(getUser(), getPassword()));
}
default AuthXManager getAuthXManager() {
return null;
}
default int getDatabase() {
return Protocol.DEFAULT_DATABASE;
}
default String getClientName() {
return null;
}
/**
* @return {@code true} - to create TLS connection(s). {@code false} - otherwise.
*/
default boolean isSsl() {
return false;
}
default SSLSocketFactory getSslSocketFactory() {
return null;
}
default SSLParameters getSslParameters() {
return null;
}
default HostnameVerifier getHostnameVerifier() {
return null;
}
default HostAndPortMapper getHostAndPortMapper() {
return null;
}
/**
* Execute READONLY command to connections.
*
* READONLY command is specific to Redis Cluster replica nodes. So this config param is only
* intended for Redis Cluster connections.
* @return {@code true} - to execute READONLY command to connection(s). {@code false} - otherwise.
*/
default boolean isReadOnlyForRedisClusterReplicas() {
return false;
}
/**
* Modify the behavior of internally executing CLIENT SETINFO command.
* @return CLIENT SETINFO config
*/
default ClientSetInfoConfig getClientSetInfoConfig() {
return ClientSetInfoConfig.DEFAULT;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy