Package redis.clients.jedis
Class Connection
java.lang.Object
redis.clients.jedis.Connection
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate RedisInputStreamprivate ConnectionPoolprivate RedisOutputStreamprivate Socketprivate final JedisSocketFactoryprivate int -
Constructor Summary
ConstructorsConstructorDescriptionConnection(String host, int port) Connection(HostAndPort hostAndPort) Connection(HostAndPort hostAndPort, JedisClientConfig clientConfig) Connection(JedisSocketFactory socketFactory) Connection(JedisSocketFactory socketFactory, JedisClientConfig clientConfig) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidauth(Supplier<RedisCredentials> credentialsProvider) voidclose()voidconnect()voidClose the socket and disconnect the server.<T> TexecuteCommand(CommandObject<T> commandObject) protected voidflush()byte[]List<byte[]> (package private) final HostAndPortgetMany(int count) getOne()intprivate voidbooleanisBroken()booleanbooleanping()quit()Deprecated.The QUIT command is deprecated, see #11420.protected Objectvoidselect(int index) voidsendCommand(CommandArguments args) voidvoidsendCommand(ProtocolCommand cmd, byte[]... args) voidsendCommand(ProtocolCommand cmd, String... args) voidsendCommand(ProtocolCommand cmd, Rawable keyword) voidfinal voidvoidsetSoTimeout(int soTimeout) voidtoString()private static booleanvalidateClientInfo(String info) Check if the client name libname, libver, characters are legal
-
Field Details
-
memberOf
-
socketFactory
-
socket
-
outputStream
-
inputStream
-
soTimeout
private int soTimeout -
infiniteSoTimeout
private int infiniteSoTimeout -
broken
private boolean broken
-
-
Constructor Details
-
Connection
public Connection() -
Connection
-
Connection
-
Connection
-
Connection
-
Connection
-
-
Method Details
-
toString
-
setHandlingPool
-
getHostAndPort
-
getSoTimeout
public int getSoTimeout() -
setSoTimeout
public void setSoTimeout(int soTimeout) -
setTimeoutInfinite
public void setTimeoutInfinite() -
rollbackTimeout
public void rollbackTimeout() -
executeCommand
-
executeCommand
-
executeCommand
-
sendCommand
-
sendCommand
-
sendCommand
-
sendCommand
-
sendCommand
-
connect
- Throws:
JedisConnectionException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
disconnect
public void disconnect()Close the socket and disconnect the server. -
isConnected
public boolean isConnected() -
isBroken
public boolean isBroken() -
setBroken
public void setBroken() -
getStatusCodeReply
-
getBulkReply
-
getBinaryBulkReply
public byte[] getBinaryBulkReply() -
getIntegerReply
-
getMultiBulkReply
-
getBinaryMultiBulkReply
-
getUnflushedObjectMultiBulkReply
-
getObjectMultiBulkReply
-
getIntegerMultiBulkReply
-
getOne
-
flush
protected void flush() -
readProtocolWithCheckingBroken
-
getMany
-
validateClientInfo
Check if the client name libname, libver, characters are legal- Parameters:
info- the name- Returns:
- Returns true if legal, false throws exception
- Throws:
JedisException- if characters illegal
-
initializeFromClientConfig
-
auth
-
select
-
quit
Deprecated.The QUIT command is deprecated, see #11420.disconnect()can be used instead. -
ping
public boolean ping()
-