ConnectionBean (Apache ZooKeeper - Server 3.7.0 API)
Date: 2021-03-17

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 and Description
    `ConnectionBean(ServerCnxn connection, ZooKeeperServer zk)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getAvgLatency()` Average latency in ms
    `String[]` | `getEphemeralNodes()`
    `String` | `getLastCxid()` Last cxid of this connection
    `long` | `getLastLatency()` Latency of last response to client on this connection in ms
    `String` | `getLastOperation()` Last operation performed by this connection
    `String` | `getLastResponseTime()` Last time server sent a response to client on this connection
    `String` | `getLastZxid()` Last zxid of this connection
    `long` | `getMaxLatency()` Max latency in ms
    `long` | `getMinLatency()` Min latency in ms
    `String` | `getName()`
    `long` | `getOutstandingRequests()`
    `long` | `getPacketsReceived()`
    `long` | `getPacketsSent()`
    `String` | `getSessionId()`
    `int` | `getSessionTimeout()`
    `String` | `getSourceIP()`
    `String` | `getStartedTime()`
    `boolean` | `isHidden()` If isHidden returns true, the MBean won't be registered with MBean server, and thus won't be available for management tools.
    `void` | `resetCounters()` Reset counters
    `void` | `terminateConnection()` Terminate thei client connection.
    `void` | `terminateSession()` Terminate this client session.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### ConnectionBean

          public ConnectionBean(ServerCnxn connection,
                                ZooKeeperServer zk)

  - ### Method Detail

    - #### getSessionId

          public String getSessionId()

      Specified by:
        `getSessionId` in interface `ConnectionMXBean`
      Returns:
        client's session id

    - #### getSourceIP

          public String getSourceIP()

      Specified by:
        `getSourceIP` in interface `ConnectionMXBean`
      Returns:
        source (client) IP address

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `ZKMBeanInfo`
      Returns:
        a string identifying the MBean

    - #### isHidden

          public boolean isHidden()

      Description copied from interface: `ZKMBeanInfo`
      If 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:
        `isHidden` in interface `ZKMBeanInfo`
      Returns:
        true if the MBean is hidden.

    - #### getEphemeralNodes

          public String[] getEphemeralNodes()

      Specified by:
        `getEphemeralNodes` in interface `ConnectionMXBean`
      Returns:
        number of ephemeral nodes owned by this connection

    - #### getStartedTime

          public String getStartedTime()

      Specified by:
        `getStartedTime` in interface `ConnectionMXBean`
      Returns:
        time the connection was started

    - #### terminateSession

          public void terminateSession()

      Description copied from interface: `ConnectionMXBean`
      Terminate this client session. The client will reconnect with a different session id.
      Specified by:
        `terminateSession` in interface `ConnectionMXBean`

    - #### terminateConnection

          public void terminateConnection()

      Description copied from interface: `ConnectionMXBean`
      Terminate thei client connection. The client will immediately attempt to reconnect with the same session id.
      Specified by:
        `terminateConnection` in interface `ConnectionMXBean`

    - #### resetCounters

          public void resetCounters()

      Description copied from interface: `ConnectionMXBean`
      Reset counters
      Specified by:
        `resetCounters` in interface `ConnectionMXBean`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getOutstandingRequests

          public long getOutstandingRequests()

      Specified by:
        `getOutstandingRequests` in interface `ConnectionMXBean`
      Returns:
        number of requets being processed

    - #### getPacketsReceived

          public long getPacketsReceived()

      Specified by:
        `getPacketsReceived` in interface `ConnectionMXBean`
      Returns:
        packets received from this client

    - #### getPacketsSent

          public long getPacketsSent()

      Specified by:
        `getPacketsSent` in interface `ConnectionMXBean`
      Returns:
        number of packets sent to this client

    - #### getSessionTimeout

          public int getSessionTimeout()

      Specified by:
        `getSessionTimeout` in interface `ConnectionMXBean`
      Returns:
        session timeout in ms

    - #### getMinLatency

          public long getMinLatency()

      Description copied from interface: `ConnectionMXBean`
      Min latency in ms
      Specified by:
        `getMinLatency` in interface `ConnectionMXBean`

    - #### getAvgLatency

          public long getAvgLatency()

      Description copied from interface: `ConnectionMXBean`
      Average latency in ms
      Specified by:
        `getAvgLatency` in interface `ConnectionMXBean`

    - #### getMaxLatency

          public long getMaxLatency()

      Description copied from interface: `ConnectionMXBean`
      Max latency in ms
      Specified by:
        `getMaxLatency` in interface `ConnectionMXBean`

    - #### getLastOperation

          public String getLastOperation()

      Description copied from interface: `ConnectionMXBean`
      Last operation performed by this connection
      Specified by:
        `getLastOperation` in interface `ConnectionMXBean`

    - #### getLastCxid

          public String getLastCxid()

      Description copied from interface: `ConnectionMXBean`
      Last cxid of this connection
      Specified by:
        `getLastCxid` in interface `ConnectionMXBean`

    - #### getLastZxid

          public String getLastZxid()

      Description copied from interface: `ConnectionMXBean`
      Last zxid of this connection
      Specified by:
        `getLastZxid` in interface `ConnectionMXBean`

    - #### getLastResponseTime

          public String getLastResponseTime()

      Description copied from interface: `ConnectionMXBean`
      Last time server sent a response to client on this connection
      Specified by:
        `getLastResponseTime` in interface `ConnectionMXBean`

    - #### getLastLatency

          public long getLastLatency()

      Description copied from interface: `ConnectionMXBean`
      Latency of last response to client on this connection in ms
      Specified by:
        `getLastLatency` in interface `ConnectionMXBean`

Copyright © 2008–2021 The Apache Software Foundation. All rights reserved.