Package org.apache.zookeeper.server
Class ConnectionBean
- java.lang.Object
 - 
- org.apache.zookeeper.server.ConnectionBean
 
 
- 
- All Implemented Interfaces:
 ZKMBeanInfo,ConnectionMXBean
public class ConnectionBean extends Object implements ConnectionMXBean, ZKMBeanInfo
Implementation of connection MBean interface. 
- 
- 
Constructor Summary
Constructors Constructor Description ConnectionBean(ServerCnxn connection, ZooKeeperServer zk) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetAvgLatency()Average latency in msString[]getEphemeralNodes()StringgetLastCxid()Last cxid of this connectionlonggetLastLatency()Latency of last response to client on this connection in msStringgetLastOperation()Last operation performed by this connectionStringgetLastResponseTime()Last time server sent a response to client on this connectionStringgetLastZxid()Last zxid of this connectionlonggetMaxLatency()Max latency in mslonggetMinLatency()Min latency in msStringgetName()longgetOutstandingRequests()longgetPacketsReceived()longgetPacketsSent()StringgetSessionId()intgetSessionTimeout()StringgetSourceIP()StringgetStartedTime()booleanisHidden()If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools.voidresetCounters()Reset countersvoidterminateConnection()Terminate thei client connection.voidterminateSession()Terminate this client session.StringtoString() 
 - 
 
- 
- 
Constructor Detail
- 
ConnectionBean
public ConnectionBean(ServerCnxn connection, ZooKeeperServer zk)
 
 - 
 
- 
Method Detail
- 
getSessionId
public String getSessionId()
- Specified by:
 getSessionIdin interfaceConnectionMXBean- Returns:
 - client's session id
 
 
- 
getSourceIP
public String getSourceIP()
- Specified by:
 getSourceIPin interfaceConnectionMXBean- Returns:
 - source (client) IP address
 
 
- 
getName
public String getName()
- Specified by:
 getNamein interfaceZKMBeanInfo- Returns:
 - a string identifying the MBean
 
 
- 
isHidden
public boolean isHidden()
Description copied from interface:ZKMBeanInfoIf isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools. Used for grouping MBeans.- Specified by:
 isHiddenin interfaceZKMBeanInfo- Returns:
 - true if the MBean is hidden.
 
 
- 
getEphemeralNodes
public String[] getEphemeralNodes()
- Specified by:
 getEphemeralNodesin interfaceConnectionMXBean- Returns:
 - number of ephemeral nodes owned by this connection
 
 
- 
getStartedTime
public String getStartedTime()
- Specified by:
 getStartedTimein interfaceConnectionMXBean- Returns:
 - time the connection was started
 
 
- 
terminateSession
public void terminateSession()
Description copied from interface:ConnectionMXBeanTerminate this client session. The client will reconnect with a different session id.- Specified by:
 terminateSessionin interfaceConnectionMXBean
 
- 
terminateConnection
public void terminateConnection()
Description copied from interface:ConnectionMXBeanTerminate thei client connection. The client will immediately attempt to reconnect with the same session id.- Specified by:
 terminateConnectionin interfaceConnectionMXBean
 
- 
resetCounters
public void resetCounters()
Description copied from interface:ConnectionMXBeanReset counters- Specified by:
 resetCountersin interfaceConnectionMXBean
 
- 
getOutstandingRequests
public long getOutstandingRequests()
- Specified by:
 getOutstandingRequestsin interfaceConnectionMXBean- Returns:
 - number of requets being processed
 
 
- 
getPacketsReceived
public long getPacketsReceived()
- Specified by:
 getPacketsReceivedin interfaceConnectionMXBean- Returns:
 - packets received from this client
 
 
- 
getPacketsSent
public long getPacketsSent()
- Specified by:
 getPacketsSentin interfaceConnectionMXBean- Returns:
 - number of packets sent to this client
 
 
- 
getSessionTimeout
public int getSessionTimeout()
- Specified by:
 getSessionTimeoutin interfaceConnectionMXBean- Returns:
 - session timeout in ms
 
 
- 
getMinLatency
public long getMinLatency()
Description copied from interface:ConnectionMXBeanMin latency in ms- Specified by:
 getMinLatencyin interfaceConnectionMXBean
 
- 
getAvgLatency
public long getAvgLatency()
Description copied from interface:ConnectionMXBeanAverage latency in ms- Specified by:
 getAvgLatencyin interfaceConnectionMXBean
 
- 
getMaxLatency
public long getMaxLatency()
Description copied from interface:ConnectionMXBeanMax latency in ms- Specified by:
 getMaxLatencyin interfaceConnectionMXBean
 
- 
getLastOperation
public String getLastOperation()
Description copied from interface:ConnectionMXBeanLast operation performed by this connection- Specified by:
 getLastOperationin interfaceConnectionMXBean
 
- 
getLastCxid
public String getLastCxid()
Description copied from interface:ConnectionMXBeanLast cxid of this connection- Specified by:
 getLastCxidin interfaceConnectionMXBean
 
- 
getLastZxid
public String getLastZxid()
Description copied from interface:ConnectionMXBeanLast zxid of this connection- Specified by:
 getLastZxidin interfaceConnectionMXBean
 
- 
getLastResponseTime
public String getLastResponseTime()
Description copied from interface:ConnectionMXBeanLast time server sent a response to client on this connection- Specified by:
 getLastResponseTimein interfaceConnectionMXBean
 
- 
getLastLatency
public long getLastLatency()
Description copied from interface:ConnectionMXBeanLatency of last response to client on this connection in ms- Specified by:
 getLastLatencyin interfaceConnectionMXBean
 
 - 
 
 -