Package com.mysql.cj.jdbc.ha.ca
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 JdbcConnectiongetConnection()Get new connection to a host.intgetConnectionIndex()Get index of newly connected host.booleanisConnected()Checks if process result is successful and new connection to host is established.
-
Constructor Details
-
ReaderFailoverResult
public ReaderFailoverResult(JdbcConnection newConnection, int newConnectionIndex, boolean isConnected)ConnectionAttemptResult constructor.
-
-
Method Details
-
getConnection
Get new connection to a host.- Returns:
JdbcConnectionNew 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.
-