Package com.mysql.cj.jdbc.ha.ca
Class WriterFailoverResult
java.lang.Object
com.mysql.cj.jdbc.ha.ca.WriterFailoverResult
public class WriterFailoverResult
extends java.lang.Object
This class holds results of Writer Failover Process.
-
Constructor Summary
Constructors Constructor Description WriterFailoverResult(boolean isConnected, boolean isNewHost, java.util.List<HostInfo> topology, JdbcConnection newConnection, java.lang.String taskName)ResolvedHostInfo constructor. -
Method Summary
Modifier and Type Method Description JdbcConnectiongetNewConnection()Get the new connection established by the failover procedure if successful.java.lang.StringgetTaskName()Get the name of the writer failover task that created this result.java.util.List<HostInfo>getTopology()Get latest topology.booleanisConnected()Checks if process result is successful and new connection to host is established.booleanisNewHost()Checks if process successfully connected to a new host.
-
Constructor Details
-
WriterFailoverResult
public WriterFailoverResult(boolean isConnected, boolean isNewHost, java.util.List<HostInfo> topology, JdbcConnection newConnection, java.lang.String taskName)ResolvedHostInfo constructor.
-
-
Method Details
-
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.
-
isNewHost
public boolean isNewHost()Checks if process successfully connected to a new host.- Returns:
- True, if process successfully connected to a new host. False, if process successfully re-connected to the same host.
-
getTopology
Get latest topology.- Returns:
- List of hosts that represent the latest topology. Returns null if no connection is established.
-
getNewConnection
Get the new connection established by the failover procedure if successful.- Returns:
JdbcConnectionNew connection to a host. Returns null if the failover pocedure was unsuccessful.
-
getTaskName
public java.lang.String getTaskName()Get the name of the writer failover task that created this result.- Returns:
- The name of the writer failover task that created this result.
-