Class Connection

java.lang.Object
redis.clients.jedis.Connection
All Implemented Interfaces:
Closeable, AutoCloseable

public class Connection extends Object implements Closeable
  • Field Details

    • memberOf

      private ConnectionPool memberOf
    • socketFactory

      private final JedisSocketFactory socketFactory
    • socket

      private Socket socket
    • outputStream

      private RedisOutputStream outputStream
    • inputStream

      private RedisInputStream inputStream
    • soTimeout

      private int soTimeout
    • infiniteSoTimeout

      private int infiniteSoTimeout
    • broken

      private boolean broken
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setHandlingPool

      public final void setHandlingPool(ConnectionPool pool)
    • getHostAndPort

      final HostAndPort getHostAndPort()
    • getSoTimeout

      public int getSoTimeout()
    • setSoTimeout

      public void setSoTimeout(int soTimeout)
    • setTimeoutInfinite

      public void setTimeoutInfinite()
    • rollbackTimeout

      public void rollbackTimeout()
    • executeCommand

      public Object executeCommand(ProtocolCommand cmd)
    • executeCommand

      public Object executeCommand(CommandArguments args)
    • executeCommand

      public <T> T executeCommand(CommandObject<T> commandObject)
    • sendCommand

      public void sendCommand(ProtocolCommand cmd)
    • sendCommand

      public void sendCommand(ProtocolCommand cmd, Rawable keyword)
    • sendCommand

      public void sendCommand(ProtocolCommand cmd, String... args)
    • sendCommand

      public void sendCommand(ProtocolCommand cmd, byte[]... args)
    • sendCommand

      public void sendCommand(CommandArguments args)
    • connect

      public void connect() throws JedisConnectionException
      Throws:
      JedisConnectionException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • disconnect

      public void disconnect()
      Close the socket and disconnect the server.
    • isConnected

      public boolean isConnected()
    • isBroken

      public boolean isBroken()
    • setBroken

      public void setBroken()
    • getStatusCodeReply

      public String getStatusCodeReply()
    • getBulkReply

      public String getBulkReply()
    • getBinaryBulkReply

      public byte[] getBinaryBulkReply()
    • getIntegerReply

      public Long getIntegerReply()
    • getMultiBulkReply

      public List<String> getMultiBulkReply()
    • getBinaryMultiBulkReply

      public List<byte[]> getBinaryMultiBulkReply()
    • getUnflushedObjectMultiBulkReply

      public List<Object> getUnflushedObjectMultiBulkReply()
    • getObjectMultiBulkReply

      public List<Object> getObjectMultiBulkReply()
    • getIntegerMultiBulkReply

      public List<Long> getIntegerMultiBulkReply()
    • getOne

      public Object getOne()
    • flush

      protected void flush()
    • readProtocolWithCheckingBroken

      protected Object readProtocolWithCheckingBroken()
    • getMany

      public List<Object> getMany(int count)
    • validateClientInfo

      private static boolean validateClientInfo(String info)
      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

      private void initializeFromClientConfig(JedisClientConfig config)
    • auth

      private void auth(Supplier<RedisCredentials> credentialsProvider)
    • select

      public String select(int index)
    • quit

      @Deprecated public String quit()
      Deprecated.
      The QUIT command is deprecated, see #11420. disconnect() can be used instead.
    • ping

      public boolean ping()