Interface Client

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
MultiPrimaryClient, MultiPrimaryReplicaClient, ReplayClient, StandardClient

public interface Client extends AutoCloseable
Client interface
  • Method Details

    • execute

      List<Completion> execute(ClientMessage message, boolean canRedo) throws SQLException
      Send client message and read result
      Parameters:
      message - client message
      canRedo - can client message be redone in case of failover
      Returns:
      results
      Throws:
      SQLException - if execution fails
    • execute

      List<Completion> execute(ClientMessage message, Statement stmt, boolean canRedo) throws SQLException
      Send client message and read result
      Parameters:
      message - client message
      stmt - statement
      canRedo - can client message be redone in case of failover
      Returns:
      results
      Throws:
      SQLException - if execution fails
    • execute

      List<Completion> execute(ClientMessage message, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo) throws SQLException
      Send client message and read result
      Parameters:
      message - client message
      stmt - statement
      fetchSize - fetch size
      maxRows - maximum number of rows. 0 = all
      resultSetConcurrency - concurrency
      resultSetType - result-set type
      closeOnCompletion - close statement on completion
      canRedo - can client message be redone in case of failover
      Returns:
      results
      Throws:
      SQLException - if any error occurs
    • executePipeline

      List<Completion> executePipeline(ClientMessage[] messages, Statement stmt, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion, boolean canRedo) throws SQLException
      Send client messages pipelining and read result
      Parameters:
      messages - client message
      stmt - statement
      fetchSize - fetch size
      maxRows - maximum number of rows. 0 = all
      resultSetConcurrency - concurrency
      resultSetType - result-set type
      closeOnCompletion - close statement on completion
      canRedo - can client message be redone in case of failover
      Returns:
      results
      Throws:
      SQLException - if any error occurs
    • readStreamingResults

      void readStreamingResults(List<Completion> completions, int fetchSize, long maxRows, int resultSetConcurrency, int resultSetType, boolean closeOnCompletion) throws SQLException
      Read results
      Parameters:
      completions - List that will have the new results
      fetchSize - fetch size
      maxRows - maximum number of rows. 0 = all
      resultSetConcurrency - concurrency
      resultSetType - result-set type
      closeOnCompletion - close statement on completion
      Throws:
      SQLException - if any error occurs
    • closePrepare

      void closePrepare(Prepare prepare) throws SQLException
      Close prepare command
      Parameters:
      prepare - prepare command
      Throws:
      SQLException - if any error occurs
    • abort

      void abort(Executor executor) throws SQLException
      Abort current connection
      Parameters:
      executor - executor
      Throws:
      SQLException - if any error occurs
    • close

      void close() throws SQLException
      Close client
      Specified by:
      close in interface AutoCloseable
      Throws:
      SQLException - if any error occurs
    • setReadOnly

      void setReadOnly(boolean readOnly) throws SQLException
      Switch to a writer/read-only connection, no effet on mono-connection
      Parameters:
      readOnly - must use read-only connection
      Throws:
      SQLException - if any error occurs
    • getSocketTimeout

      int getSocketTimeout()
      get socket timeout
      Returns:
      socket timeout
    • setSocketTimeout

      void setSocketTimeout(int milliseconds) throws SQLException
      Set socket timeout
      Parameters:
      milliseconds - timeout
      Throws:
      SQLException - if any error occurs
    • isClosed

      boolean isClosed()
      Is client closed
      Returns:
      close flag
    • reset

      void reset()
      Reset connection
    • isPrimary

      boolean isPrimary()
      is current client writer or read-only
      Returns:
      is primary
    • getContext

      Context getContext()
      Get connection context
      Returns:
      connection context
    • getExceptionFactory

      ExceptionFactory getExceptionFactory()
      Get connection exception factory
      Returns:
      connection exception factory
    • getHostAddress

      HostAddress getHostAddress()
      Get connection host
      Returns:
      connection host
    • getSocketIp

      String getSocketIp()
      Get current socket IP or null (for Pipe / unix socket)
      Returns:
      Socket current IP