From fa6e5bb0c17c4d59d8598979feb1a7701bc32679 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 12 Dec 2006 23:55:39 +0000
Subject: [PATCH] Publish a separate monitor entry for each connection handler, which includes the protocol, listen address/port, number of established connections, and information about each connection.

---
 opends/src/server/org/opends/server/api/ClientConnection.java |   57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/api/ClientConnection.java b/opends/src/server/org/opends/server/api/ClientConnection.java
index c813a3e..41fd2ca 100644
--- a/opends/src/server/org/opends/server/api/ClientConnection.java
+++ b/opends/src/server/org/opends/server/api/ClientConnection.java
@@ -46,6 +46,7 @@
 import org.opends.server.types.IntermediateResponse;
 import org.opends.server.types.SearchResultEntry;
 import org.opends.server.types.SearchResultReference;
+import org.opends.server.util.TimeThread;
 
 import static org.opends.server.loggers.Debug.*;
 import static org.opends.server.messages.MessageHandler.*;
@@ -83,10 +84,17 @@
   // The lookthrough limit for use with this client connection.
   private int lookthroughLimit;
 
+  // The time that this client connection was established.
+  private long connectTime;
+
   // The opaque information used for storing intermediate state
   // information needed across multi-stage SASL binds.
   private Object saslAuthState;
 
+  // A string representation of the time that this client connection
+  // was established.
+  private String connectTimeString;
+
   // A set of persistent searches registered for this client.
   private CopyOnWriteArrayList<PersistentSearch> persistentSearches;
 
@@ -100,6 +108,8 @@
   {
     assert debugConstructor(CLASS_NAME);
 
+    connectTime        = TimeThread.getTime();
+    connectTimeString  = TimeThread.getUTCTime();
     authenticationInfo = new AuthenticationInfo();
     saslAuthState      = null;
     bindInProgress     = false;
@@ -112,6 +122,38 @@
 
 
   /**
+   * Retrieves the time that this connection was established, measured
+   * in the number of milliseconds since January 1, 1970 UTC.
+   *
+   * @return  The time that this connection was established, measured
+   *          in the number of milliseconds since January 1, 1970 UTC.
+   */
+  public long getConnectTime()
+  {
+    assert debugEnter(CLASS_NAME, "getConnectTime");
+
+    return connectTime;
+  }
+
+
+
+  /**
+   * Retrieves a string representation of the time that this
+   * connection was established.
+   *
+   * @return  A string representation of the time that this connection
+   *          was established.
+   */
+  public String getConnectTimeString()
+  {
+    assert debugEnter(CLASS_NAME, "getConnectTimeString");
+
+    return connectTimeString;
+  }
+
+
+
+  /**
    * Retrieves the unique identifier that has been assigned to this
    * connection.
    *
@@ -852,6 +894,21 @@
 
 
   /**
+   * Retrieves a one-line summary of this client connection in a form
+   * that is suitable for including in the monitor entry for the
+   * associated connection handler.  It should be in a format that is
+   * both humand readable and machine parseable (e.g., a
+   * space-delimited name-value list, with quotes around the values).
+   *
+   * @return  A one-line summary of this client connection in a form
+   *          that is suitable for including in the monitor entry for
+   *          the associated connection handler.
+   */
+  public abstract String getMonitorSummary();
+
+
+
+  /**
    * Retrieves a string representation of this client connection.
    *
    * @return  A string representation of this client connection.

--
Gitblit v1.10.0