public class ConnectionGroup
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private long |
activeConnections |
private int |
activeHosts |
private java.util.Set<java.lang.String> |
closedHosts |
private long |
closedProxyTotalPhysicalConnections |
private long |
closedProxyTotalTransactions |
private java.util.HashMap<java.lang.Long,LoadBalancedConnectionProxy> |
connectionProxies |
private long |
connections |
private java.lang.String |
groupName |
private java.util.Set<java.lang.String> |
hostList |
private boolean |
isInitialized |
| Constructor and Description |
|---|
ConnectionGroup(java.lang.String groupName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHost(java.lang.String hostPortPair)
Add the given host (host:port pair) to this Connection Group.
|
void |
addHost(java.lang.String hostPortPair,
boolean forExisting)
Add the given host (host:port pair) to this Connection Group and, consequently, to all the load-balanced connections it holds.
|
void |
closeConnectionProxy(LoadBalancedConnectionProxy proxy) |
int |
getActiveHostCount() |
long |
getActiveLogicalConnectionCount() |
long |
getActivePhysicalConnectionCount() |
java.util.Collection<java.lang.String> |
getClosedHosts() |
java.lang.String |
getGroupName() |
java.util.Collection<java.lang.String> |
getInitialHosts() |
long |
getTotalLogicalConnectionCount() |
long |
getTotalPhysicalConnectionCount() |
long |
getTotalTransactionCount() |
long |
registerConnectionProxy(LoadBalancedConnectionProxy proxy,
java.util.List<java.lang.String> localHostList) |
void |
removeHost(java.lang.String hostPortPair)
Remove the given host (host:port pair) from this Connection Group.
|
void |
removeHost(java.lang.String hostPortPair,
boolean removeExisting)
Remove the given host (host:port pair) from this Connection Group.
|
void |
removeHost(java.lang.String hostPortPair,
boolean removeExisting,
boolean waitForGracefulFailover)
Remove the given host (host:port pair) from this Connection Group and, consequently, from all the load-balanced connections it holds.
|
private java.lang.String groupName
private long connections
private long activeConnections
private java.util.HashMap<java.lang.Long,LoadBalancedConnectionProxy> connectionProxies
private java.util.Set<java.lang.String> hostList
private boolean isInitialized
private long closedProxyTotalPhysicalConnections
private long closedProxyTotalTransactions
private int activeHosts
private java.util.Set<java.lang.String> closedHosts
public long registerConnectionProxy(LoadBalancedConnectionProxy proxy, java.util.List<java.lang.String> localHostList)
public java.lang.String getGroupName()
public java.util.Collection<java.lang.String> getInitialHosts()
public int getActiveHostCount()
public java.util.Collection<java.lang.String> getClosedHosts()
public long getTotalLogicalConnectionCount()
public long getActiveLogicalConnectionCount()
public long getActivePhysicalConnectionCount()
public long getTotalPhysicalConnectionCount()
public long getTotalTransactionCount()
public void closeConnectionProxy(LoadBalancedConnectionProxy proxy)
public void removeHost(java.lang.String hostPortPair)
throws java.sql.SQLException
hostPortPair - The host:port pair to remove.java.sql.SQLException - if a database access error occurspublic void removeHost(java.lang.String hostPortPair,
boolean removeExisting)
throws java.sql.SQLException
hostPortPair - The host:port pair to remove.removeExisting - Whether affects existing load-balanced connections or only new ones.java.sql.SQLException - if a database access error occurspublic void removeHost(java.lang.String hostPortPair,
boolean removeExisting,
boolean waitForGracefulFailover)
throws java.sql.SQLException
hostPortPair - The host:port pair to remove.removeExisting - Whether affects existing load-balanced connections or only new ones.waitForGracefulFailover - If true instructs the load-balanced connections to fail-over the underlying active connection before removing this host, otherwise remove
immediately.java.sql.SQLException - if a database access error occurspublic void addHost(java.lang.String hostPortPair)
hostPortPair - The host:port pair to add.public void addHost(java.lang.String hostPortPair,
boolean forExisting)
hostPortPair - The host:port pair to add.forExisting - Whether affects existing load-balanced connections or only new ones.