# Interface Listener

All Known Implementing Classes:
  `AbstractMastersListener, AbstractMastersReplicasListener, AuroraListener, MastersFailoverListener, MastersReplicasListener`

public interface Listener

## Method Summary

Modifier and Type
Method
Description
`void`
`addToBlacklist(HostAddress hostAddress)`
`boolean`
`canRetryFailLoop()`
`boolean`
`checkMasterStatus(SearchFilter searchFilter)`
`void`
`foundActiveMaster(Protocol protocol)`
`Set<HostAddress>`
`getBlacklistKeys()`
`String`
`getCatalog()`
`Protocol`
`getCurrentProtocol()`
`SearchFilter`
`getFilterForFailedHost()`
`long`
`getLastQueryNanos()`
`int`
`getMajorServerVersion()`
`FailoverProxy`
`getProxy()`
`int`
`getRetriesAllDown()`
`long`
`getServerThreadId()`
`int`
`getTimeout()`
`UrlParser`
`getUrlParser()`
`HandleErrorResult`
`handleFailover(SQLException qe, Method method, Object[] args, Protocol protocol, boolean wasClosed)`
`boolean`
`hasHostFail()`
`void`
`initializeConnection()`
`boolean`
`inTransaction()`
`Object`
`invoke(Method method, Object[] args)`
`Object`
`invoke(Method method, Object[] args, Protocol specificProtocol)`
`boolean`
`isAutoReconnect()`
`boolean`
`isClosed()`
`boolean`
`isExplicitClosed()`
`boolean`
`isMasterConnected()`
`boolean`
`isMasterConnection()`
`boolean`
`isMasterHostFail()`
`boolean`
`isReadOnly()`
`boolean`
`isServerMariaDb()`
`boolean`
`isValid(int timeout)`
`boolean`
`noBackslashEscapes()`
`void`
`preAbort()`
`void`
`preClose()`
`void`
`preExecute()`
`HandleErrorResult`
`primaryFail(Method method, Object[] args, boolean killCmd, boolean wasClosed)`
`void`
`prolog(long maxRows, MariaDbConnection connection, MariaDbStatement statement)`
`void`
`reconnect()`
`void`
`reconnectFailedConnection(SearchFilter filter)`
`void`
`removeFromBlacklist(HostAddress hostAddress)`
`void`
`rePrepareOnReplica(ServerPrepareResult oldServerPrepareResult, boolean mustExecuteOnMaster)`
`void`
`reset()`
`boolean`
`sessionStateAware()`
`boolean`
`setMasterHostFail()`
`void`
`setProxy(FailoverProxy proxy)`
`void`
`switchReadOnlyConnection(Boolean readonly)`
`void`
`syncConnection(Protocol from, Protocol to)`
`void`
`throwFailoverMessage(HostAddress failHostAddress, boolean wasMaster, SQLException queryException, boolean reconnected)`
`boolean`
`versionGreaterOrEqual(int major, int minor, int patch)`

## Method Details

### getProxy

FailoverProxy getProxy()

### setProxy

void setProxy(FailoverProxy proxy)

### initializeConnection

void initializeConnection() throws SQLException

Throws:
  `SQLException`

### preExecute

void preExecute() throws SQLException

Throws:
  `SQLException`

### preClose

void preClose()

### preAbort

void preAbort()

### getServerThreadId

long getServerThreadId()

### reconnectFailedConnection

void reconnectFailedConnection(SearchFilter filter) throws SQLException

Throws:
  `SQLException`

### switchReadOnlyConnection

void switchReadOnlyConnection(Boolean readonly) throws SQLException

Throws:
  `SQLException`

### primaryFail

HandleErrorResult primaryFail(Method method, Object[] args, boolean killCmd, boolean wasClosed) throws SQLException

Throws:
  `SQLException`

### invoke

Object invoke(Method method, Object[] args, Protocol specificProtocol) throws Throwable

Throws:
  `Throwable`

### invoke

Object invoke(Method method, Object[] args) throws Throwable

Throws:
  `Throwable`

### handleFailover

HandleErrorResult handleFailover(SQLException qe, Method method, Object[] args, Protocol protocol, boolean wasClosed) throws Throwable

Throws:
  `Throwable`

### foundActiveMaster

void foundActiveMaster(Protocol protocol) throws SQLException

Throws:
  `SQLException`

### getBlacklistKeys

Set<HostAddress> getBlacklistKeys()

### addToBlacklist

void addToBlacklist(HostAddress hostAddress)

### removeFromBlacklist

void removeFromBlacklist(HostAddress hostAddress)

### syncConnection

void syncConnection(Protocol from, Protocol to) throws SQLException

Throws:
  `SQLException`

### getUrlParser

UrlParser getUrlParser()

### throwFailoverMessage

void throwFailoverMessage(HostAddress failHostAddress, boolean wasMaster, SQLException queryException, boolean reconnected) throws SQLException

Throws:
  `SQLException`

### isAutoReconnect

boolean isAutoReconnect()

### getRetriesAllDown

int getRetriesAllDown()

### isExplicitClosed

boolean isExplicitClosed()

### reconnect

void reconnect() throws SQLException

Throws:
  `SQLException`

### isReadOnly

boolean isReadOnly()

### inTransaction

boolean inTransaction()

### getMajorServerVersion

int getMajorServerVersion()

### isMasterConnection

boolean isMasterConnection()

### isClosed

boolean isClosed()

### versionGreaterOrEqual

boolean versionGreaterOrEqual(int major, int minor, int patch)

### isServerMariaDb

boolean isServerMariaDb()

### sessionStateAware

boolean sessionStateAware()

### noBackslashEscapes

boolean noBackslashEscapes()

### isValid

boolean isValid(int timeout) throws SQLException

Throws:
  `SQLException`

### prolog

void prolog(long maxRows, MariaDbConnection connection, MariaDbStatement statement) throws SQLException

Throws:
  `SQLException`

### getCatalog

String getCatalog() throws SQLException

Throws:
  `SQLException`

### getTimeout

int getTimeout() throws SocketException

Throws:
  `SocketException`

### getCurrentProtocol

Protocol getCurrentProtocol()

### hasHostFail

boolean hasHostFail()

### canRetryFailLoop

boolean canRetryFailLoop()

### getFilterForFailedHost

SearchFilter getFilterForFailedHost()

### isMasterConnected

boolean isMasterConnected()

### setMasterHostFail

boolean setMasterHostFail()

### isMasterHostFail

boolean isMasterHostFail()

### getLastQueryNanos

long getLastQueryNanos()

### checkMasterStatus

boolean checkMasterStatus(SearchFilter searchFilter)

### rePrepareOnReplica

void rePrepareOnReplica(ServerPrepareResult oldServerPrepareResult, boolean mustExecuteOnMaster) throws SQLException

Throws:
  `SQLException`

### reset

void reset() throws SQLException

Throws:
  `SQLException`