Class ReaderFailoverResult

java.lang.Object
com.mysql.cj.jdbc.ha.ca.ReaderFailoverResult

public class ReaderFailoverResult
extends java.lang.Object
This class holds results of Reader Failover Process.
  • Constructor Summary

    Constructors 
    Constructor Description
    ReaderFailoverResult​(JdbcConnection newConnection, int newConnectionIndex, boolean isConnected)
    ConnectionAttemptResult constructor.
  • Method Summary

    Modifier and Type Method Description
    JdbcConnection getConnection()
    Get new connection to a host.
    int getConnectionIndex()
    Get index of newly connected host.
    boolean isConnected()
    Checks if process result is successful and new connection to host is established.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getConnection

      public JdbcConnection getConnection()
      Get new connection to a host.
      Returns:
      JdbcConnection New connection to a host. Returns null if no connection is established.
    • getConnectionIndex

      public int getConnectionIndex()
      Get index of newly connected host.
      Returns:
      Index of connected host in topology Returns -1 (NO_CONNECTION_INDEX) if no connection is established.
    • isConnected

      public boolean isConnected()
      Checks if process result is successful and new connection to host is established.
      Returns:
      True, if process successfully connected to a host.