From 1bdcce4d1f73ba57fd4c2a91e8833d943b193a6e Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 27 Apr 2009 18:19:56 +0000
Subject: [PATCH] Fix issue 3936: Allow intermediate CONNECT messages to be logged.

---
 opendj-sdk/opends/src/server/org/opends/server/loggers/AccessLogger.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 3 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/loggers/AccessLogger.java b/opendj-sdk/opends/src/server/org/opends/server/loggers/AccessLogger.java
index 58c54d6..18fd8fb 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/loggers/AccessLogger.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/loggers/AccessLogger.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2006-2008 Sun Microsystems, Inc.
+ *      Copyright 2006-2009 Sun Microsystems, Inc.
  */
 package org.opends.server.loggers;
 import org.opends.messages.Message;
@@ -73,11 +73,11 @@
 
   // The set of access loggers that have been registered with the server.  It
   // will initially be empty.
-  static CopyOnWriteArrayList<AccessLogPublisher<?>> accessPublishers =
+  private static CopyOnWriteArrayList<AccessLogPublisher<?>> accessPublishers =
       new CopyOnWriteArrayList<AccessLogPublisher<?>>();
 
   // The singleton instance of this class for configuration purposes.
-  static final AccessLogger instance = new AccessLogger();
+  private static final AccessLogger instance = new AccessLogger();
 
 
 
@@ -448,6 +448,32 @@
 
 
   /**
+   * Writes a message to the access logger containing additional
+   * information associated with the provided client connection.
+   *
+   * @param clientConnection
+   *          The client connection that has been established.
+   * @param category
+   *          The category of the intermediate message.
+   * @param content
+   *          The content of the intermediate message. This comprises of
+   *          one or more key/value pairs which form the content of the
+   *          intermediate message.
+   */
+  public static void logConnectIntermediateMessage(
+      ClientConnection clientConnection, String category,
+      Map<String, String> content)
+  {
+    for (AccessLogPublisher<?> publisher : accessPublishers)
+    {
+      publisher.logConnectIntermediateMessage(clientConnection,
+          category, content);
+    }
+  }
+
+
+
+  /**
    * Writes a message to the access logger with information about the
    * termination of an existing client connection.
    *
@@ -468,6 +494,33 @@
   }
 
 
+
+  /**
+   * Writes a message to the access logger containing additional
+   * information associated with the provided client disconnection.
+   *
+   * @param clientConnection
+   *          The client connection that has been terminated.
+   * @param category
+   *          The category of the intermediate message.
+   * @param content
+   *          The content of the intermediate message. This comprises of
+   *          one or more key/value pairs which form the content of the
+   *          intermediate message.
+   */
+  public static void logDisconnectIntermediateMessage(
+      ClientConnection clientConnection, String category,
+      Map<String, String> content)
+  {
+    for (AccessLogPublisher<?> publisher : accessPublishers)
+    {
+      publisher.logDisconnectIntermediateMessage(clientConnection,
+          category, content);
+    }
+  }
+
+
+
   /**
    * Writes a message to the access logger with information about the abandon
    * request associated with the provided abandon operation.

--
Gitblit v1.10.0