ReplicationConnectionGroup
Date: 2016-03-08

com.mysql.jdbc

## Class ReplicationConnectionGroup

- java.lang.Object
- - com.mysql.jdbc.ReplicationConnectionGroup

-     public class ReplicationConnectionGroup
      extends java.lang.Object

  Group of connection objects which can be configured as a group. This is used for promotion/demotion of slaves and masters in a replication configuration, and for exposing metrics around replication-aware connections.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReplicationConnectionGroup(java.lang.String groupName)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSlaveHost(java.lang.String host)`
    `long` | `getActiveConnectionCount()`
    `long` | `getConnectionCount()`
    `int` | `getConnectionCountWithHostAsMaster(java.lang.String host)`
    `int` | `getConnectionCountWithHostAsSlave(java.lang.String host)`
    `java.lang.String` | `getGroupName()`
    `java.util.Collection<java.lang.String>` | `getMasterHosts()`
    `long` | `getNumberOfSlavePromotions()`
    `long` | `getNumberOfSlavesAdded()`
    `long` | `getNumberOfSlavesRemoved()`
    `java.util.Collection<java.lang.String>` | `getSlaveHosts()`
    `long` | `getTotalConnectionCount()`
    `void` | `handleCloseConnection(ReplicationConnection conn)`
    `void` | `promoteSlaveToMaster(java.lang.String host)`
    `long` | `registerReplicationConnection(ReplicationConnection conn, java.util.List<java.lang.String> localMasterList, java.util.List<java.lang.String> localSlaveList)`
    `void` | `removeMasterHost(java.lang.String host)`
    `void` | `removeMasterHost(java.lang.String host, boolean closeGently)`
    `void` | `removeSlaveHost(java.lang.String host, boolean closeGently)`
    `java.lang.String` | `toString()`

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

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

- - ### Constructor Detail

    - #### ReplicationConnectionGroup

          ReplicationConnectionGroup(java.lang.String groupName)

  - ### Method Detail

    - #### getConnectionCount

          public long getConnectionCount()

    - #### registerReplicationConnection

          public long registerReplicationConnection(ReplicationConnection conn,
                                           java.util.List<java.lang.String> localMasterList,
                                           java.util.List<java.lang.String> localSlaveList)

    - #### getGroupName

          public java.lang.String getGroupName()

    - #### getMasterHosts

          public java.util.Collection<java.lang.String> getMasterHosts()

    - #### getSlaveHosts

          public java.util.Collection<java.lang.String> getSlaveHosts()

    - #### addSlaveHost

          public void addSlaveHost(java.lang.String host)
                            throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### handleCloseConnection

          public void handleCloseConnection(ReplicationConnection conn)

    - #### removeSlaveHost

          public void removeSlaveHost(java.lang.String host,
                             boolean closeGently)
                               throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### promoteSlaveToMaster

          public void promoteSlaveToMaster(java.lang.String host)
                                    throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### removeMasterHost

          public void removeMasterHost(java.lang.String host)
                                throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### removeMasterHost

          public void removeMasterHost(java.lang.String host,
                              boolean closeGently)
                                throws java.sql.SQLException

      Throws:
        `java.sql.SQLException`

    - #### getConnectionCountWithHostAsSlave

          public int getConnectionCountWithHostAsSlave(java.lang.String host)

    - #### getConnectionCountWithHostAsMaster

          public int getConnectionCountWithHostAsMaster(java.lang.String host)

    - #### getNumberOfSlavesAdded

          public long getNumberOfSlavesAdded()

    - #### getNumberOfSlavesRemoved

          public long getNumberOfSlavesRemoved()

    - #### getNumberOfSlavePromotions

          public long getNumberOfSlavePromotions()

    - #### getTotalConnectionCount

          public long getTotalConnectionCount()

    - #### getActiveConnectionCount

          public long getActiveConnectionCount()

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`