org.mariadb.jdbc.internal.failover.impl

## Class AuroraListener

- java.lang.Object
- - org.mariadb.jdbc.internal.failover.AbstractMastersListener
  - - org.mariadb.jdbc.internal.failover.AbstractMastersSlavesListener
    - - org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener
      - - org.mariadb.jdbc.internal.failover.impl.AuroraListener

All Implemented Interfaces:
  Listener

    public class AuroraListener
    extends MastersSlavesListener

### Field Summary

### Fields inherited from class org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener

`masterProtocol, secondaryProtocol`

### Fields inherited from class org.mariadb.jdbc.internal.failover.AbstractMastersSlavesListener

`waitNewMasterProtocol, waitNewSecondaryProtocol`

### Fields inherited from class org.mariadb.jdbc.internal.failover.AbstractMastersListener

`currentConnectionAttempts, currentProtocol, currentReadOnlyAsked, explicitClosed, lastQueryNanos, lastRetry, proxy, urlParser`

### Constructor Summary

Constructors
Constructor and Description
`AuroraListener(UrlParser urlParser)` Constructor for Aurora.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `checkMasterStatus(SearchFilter searchFilter)` Check master status.
`void` `reconnectFailedConnection(SearchFilter searchFilter)` Search a valid connection for failed one.
`HostAddress` `searchByStartName(Protocol secondaryProtocol, List<HostAddress> loopAddress)` Aurora replica doesn't have the master endpoint but the master instance name.

### Methods inherited from class org.mariadb.jdbc.internal.failover.impl.MastersSlavesListener

`checkInitialConnection, checkWaitingConnection, foundActiveMaster, foundActiveSecondary, handleFailLoop, initializeConnection, isMasterConnected, lockAndSwitchMaster, lockAndSwitchSecondary, preClose, preExecute, primaryFail, reconnect, removeListenerFromSchedulers, secondaryFail, switchReadOnlyConnection`

### Methods inherited from class org.mariadb.jdbc.internal.failover.AbstractMastersSlavesListener

`getFilterForFailedHost, getSecondaryHostFailNanos, handleFailover, hasHostFail, isMasterHostFailReconnect, isSecondaryHostFail, isSecondaryHostFailReconnect, resetMasterFailoverData, resetSecondaryFailoverData, setSecondaryHostFail`

### Methods inherited from class org.mariadb.jdbc.internal.failover.AbstractMastersListener

`addToBlacklist, canRetryFailLoop, clearBlacklist, closeConnection, getBlacklistKeys, getCurrentProtocol, getLastQueryNanos, getMasterHostFailNanos, getProxy, getRetriesAllDown, getUrlParser, invoke, isAutoReconnect, isClosed, isExplicitClosed, isMasterHostFail, isQueryRelaunchable, isReadOnly, pingMasterProtocol, preAutoReconnect, relaunchOperation, removeFromBlacklist, resetOldsBlackListHosts, setMasterHostFail, setProxy, setSessionReadOnly, syncConnection, throwFailoverMessage`

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

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

### Constructor Detail

#### AuroraListener

    public AuroraListener(UrlParser urlParser)

Constructor for Aurora. This differ from standard failover because : - we don't know current master, we must check that after initial connection - master can change after he has a failover

Parameters:
  `urlParser` - connection informations

### Method Detail

#### reconnectFailedConnection

    public void reconnectFailedConnection(SearchFilter searchFilter)
                                   throws QueryException

Search a valid connection for failed one. A Node can be a master or a replica depending on the cluster state. so search for each host until found all the failed connection. By default, search for the host not down, and recheck the down one after if not found valid connections.

Specified by:
  `reconnectFailedConnection` in interface `Listener`
Overrides:
  `reconnectFailedConnection` in class `MastersSlavesListener`
Throws:
  `QueryException` - if a connection asked is not found

#### searchByStartName

    public HostAddress searchByStartName(Protocol secondaryProtocol,
                                         List<HostAddress> loopAddress)

Aurora replica doesn't have the master endpoint but the master instance name. since the end point normally use the instance name like "instancename.some_ugly_string.region.rds.amazonaws.com", if an endpoint start with this instance name, it will be checked first.

Parameters:
  `secondaryProtocol` - the current secondary protocol
  `loopAddress` - list of possible hosts
Returns:
  the probable master address or null if not found

#### checkMasterStatus

    public boolean checkMasterStatus(SearchFilter searchFilter)

Description copied from class: `MastersSlavesListener`
Check master status.

Specified by:
  `checkMasterStatus` in interface `Listener`
Overrides:
  `checkMasterStatus` in class `MastersSlavesListener`
Parameters:
  `searchFilter` - search filter
Returns:
  has some status changed