Interface Listener
-
- All Known Implementing Classes:
AbstractMastersListener,AbstractMastersReplicasListener,AuroraListener,MastersFailoverListener,MastersReplicasListener
public interface Listener
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddToBlacklist(HostAddress hostAddress)booleancanRetryFailLoop()booleancheckMasterStatus(SearchFilter searchFilter)voidfoundActiveMaster(Protocol protocol)java.util.Set<HostAddress>getBlacklistKeys()java.lang.StringgetCatalog()ProtocolgetCurrentProtocol()SearchFiltergetFilterForFailedHost()longgetLastQueryNanos()intgetMajorServerVersion()FailoverProxygetProxy()intgetRetriesAllDown()longgetServerThreadId()intgetTimeout()UrlParsergetUrlParser()HandleErrorResulthandleFailover(java.sql.SQLException qe, java.lang.reflect.Method method, java.lang.Object[] args, Protocol protocol, boolean wasClosed)booleanhasHostFail()voidinitializeConnection()booleaninTransaction()java.lang.Objectinvoke(java.lang.reflect.Method method, java.lang.Object[] args)java.lang.Objectinvoke(java.lang.reflect.Method method, java.lang.Object[] args, Protocol specificProtocol)booleanisAutoReconnect()booleanisClosed()booleanisExplicitClosed()booleanisMasterConnected()booleanisMasterConnection()booleanisMasterHostFail()booleanisReadOnly()booleanisServerMariaDb()booleanisValid(int timeout)booleannoBackslashEscapes()voidpreAbort()voidpreClose()voidpreExecute()HandleErrorResultprimaryFail(java.lang.reflect.Method method, java.lang.Object[] args, boolean killCmd, boolean wasClosed)voidprolog(long maxRows, MariaDbConnection connection, MariaDbStatement statement)voidreconnect()voidreconnectFailedConnection(SearchFilter filter)voidremoveFromBlacklist(HostAddress hostAddress)voidrePrepareOnReplica(ServerPrepareResult oldServerPrepareResult, boolean mustExecuteOnMaster)voidreset()booleansessionStateAware()booleansetMasterHostFail()voidsetProxy(FailoverProxy proxy)voidswitchReadOnlyConnection(java.lang.Boolean readonly)voidsyncConnection(Protocol from, Protocol to)voidthrowFailoverMessage(HostAddress failHostAddress, boolean wasMaster, java.sql.SQLException queryException, boolean reconnected)booleanversionGreaterOrEqual(int major, int minor, int patch)
-
-
-
Method Detail
-
getProxy
FailoverProxy getProxy()
-
setProxy
void setProxy(FailoverProxy proxy)
-
initializeConnection
void initializeConnection() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
preExecute
void preExecute() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
preClose
void preClose()
-
preAbort
void preAbort()
-
getServerThreadId
long getServerThreadId()
-
reconnectFailedConnection
void reconnectFailedConnection(SearchFilter filter) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
switchReadOnlyConnection
void switchReadOnlyConnection(java.lang.Boolean readonly) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
primaryFail
HandleErrorResult primaryFail(java.lang.reflect.Method method, java.lang.Object[] args, boolean killCmd, boolean wasClosed) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
invoke
java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object[] args, Protocol specificProtocol) throws java.lang.Throwable- Throws:
java.lang.Throwable
-
invoke
java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable- Throws:
java.lang.Throwable
-
handleFailover
HandleErrorResult handleFailover(java.sql.SQLException qe, java.lang.reflect.Method method, java.lang.Object[] args, Protocol protocol, boolean wasClosed) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
foundActiveMaster
void foundActiveMaster(Protocol protocol) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getBlacklistKeys
java.util.Set<HostAddress> getBlacklistKeys()
-
addToBlacklist
void addToBlacklist(HostAddress hostAddress)
-
removeFromBlacklist
void removeFromBlacklist(HostAddress hostAddress)
-
syncConnection
void syncConnection(Protocol from, Protocol to) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
getUrlParser
UrlParser getUrlParser()
-
throwFailoverMessage
void throwFailoverMessage(HostAddress failHostAddress, boolean wasMaster, java.sql.SQLException queryException, boolean reconnected) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
isAutoReconnect
boolean isAutoReconnect()
-
getRetriesAllDown
int getRetriesAllDown()
-
isExplicitClosed
boolean isExplicitClosed()
-
reconnect
void reconnect() throws java.sql.SQLException- Throws:
java.sql.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 java.sql.SQLException- Throws:
java.sql.SQLException
-
prolog
void prolog(long maxRows, MariaDbConnection connection, MariaDbStatement statement) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getCatalog
java.lang.String getCatalog() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getTimeout
int getTimeout() throws java.net.SocketException- Throws:
java.net.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 java.sql.SQLException
- Throws:
java.sql.SQLException
-
reset
void reset() throws java.sql.SQLException- Throws:
java.sql.SQLException
-
-