org.mariadb.jdbc.internal.protocol

## Class MasterProtocol

- java.lang.Object
- - org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol
  - - org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol
    - - org.mariadb.jdbc.internal.protocol.MasterProtocol

All Implemented Interfaces:
  Closeable, AutoCloseable, Protocol

Direct Known Subclasses:
  MastersSlavesProtocol

    public class MasterProtocol
    extends AbstractQueryProtocol
    implements Closeable

### Field Summary

### Fields inherited from class org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol

`readScheduler`

### Fields inherited from class org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol

`activeStreamingResult, autoIncrementIncrement, connected, database, eofDeprecated, explicitClosed, hasWarnings, lock, options, proxy, reader, readOnly, serverCapabilities, serverPrepareStatementCache, serverStatus, serverThreadId, socket, urlParser, writer`

### Constructor Summary

Constructors
Constructor and Description
`MasterProtocol(UrlParser urlParser, ReentrantLock lock)` Get a protocol instance.

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `loop(Listener listener, List<HostAddress> addresses, SearchFilter searchFilter)` loop until found the failed connection.

### Methods inherited from class org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol

`addPrepareInCache, cancelCurrentQuery, closeExplicit, executeBatchClient, executeBatchServer, executeBatchStmt, executePreparedQuery, executeQuery, executeQuery, executeQuery, executeQuery, executeQuery, forceReleasePrepareStatement, forceReleaseWaitingPrepareStatement, getAutocommit, getAutoIncrementIncrement, getCatalog, getMaxRows, getResult, getTimeout, getTransactionIsolationLevel, handleIoException, inTransaction, isInterrupted, isValid, ping, prepare, prolog, prologProxy, releasePrepareStatement, resetStateAfterFailover, rollback, setActiveFutureTask, setCatalog, setInternalMaxRows, setLocalInfileInputStream, setMaxRows, setTimeout, setTransactionIsolation, stopIfInterrupted`

### Methods inherited from class org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol

`changeSocketSoTimeout, changeSocketTcpNoDelay, checkIfMaster, close, connect, connectWithoutProxy, getActiveStreamingResult, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReader, getReadonly, getServerThreadId, getServerVersion, getTimeZone, getTraces, getUrlParser, getUsername, getWriter, hasMoreResults, hasWarnings, isClosed, isConnected, isEofDeprecated, isExplicitClosed, isMasterConnection, isServerMariaDb, mustBeMasterConnection, noBackslashEscapes, prepareStatementCache, readEofPacket, readPipelineCheckMaster, removeActiveStreamingResult, removeHasMoreResults, sessionStateAware, setActiveStreamingResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setProxy, setReadonly, setServerStatus, shouldReconnectWithoutProxy, skip, skipEofPacket, versionGreaterOrEqual`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.io.Closeable

`close`

### Methods inherited from interface org.mariadb.jdbc.internal.protocol.Protocol

`changeSocketSoTimeout, changeSocketTcpNoDelay, checkIfMaster, close, connect, connectWithoutProxy, getActiveStreamingResult, getDatabase, getDataTypeMappingFlags, getHost, getHostAddress, getLock, getMajorServerVersion, getMinorServerVersion, getOptions, getPinGlobalTxToPhysicalConnection, getPort, getProxy, getReader, getReadonly, getServerThreadId, getServerVersion, getTimeZone, getTraces, getUrlParser, getUsername, getWriter, hasMoreResults, hasWarnings, isClosed, isConnected, isEofDeprecated, isExplicitClosed, isMasterConnection, isServerMariaDb, mustBeMasterConnection, noBackslashEscapes, prepareStatementCache, readEofPacket, removeActiveStreamingResult, removeHasMoreResults, sessionStateAware, setActiveStreamingResult, setHasWarnings, setHostAddress, setHostFailedWithoutProxy, setProxy, setReadonly, setServerStatus, shouldReconnectWithoutProxy, skip, skipEofPacket, versionGreaterOrEqual`

### Constructor Detail

#### MasterProtocol

    public MasterProtocol(UrlParser urlParser,
                          ReentrantLock lock)

Get a protocol instance.

Parameters:
  `urlParser` - connection URL infos
  `lock` - the lock for thread synchronisation

### Method Detail

#### loop

    public static void loop(Listener listener,
                            List<HostAddress> addresses,
                            SearchFilter searchFilter)
                     throws SQLException

loop until found the failed connection.

Parameters:
  `listener` - current failover
  `addresses` - list of HostAddress to loop
  `searchFilter` - search parameter
Throws:
  `SQLException` - if not found