From 455897cc245b67d929f409a93cfa7106e835cc1f Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 01 Mar 2007 03:27:06 +0000
Subject: [PATCH] This removes old debug logging framework method calls that are going to be automatically instrumented by AspectJ. Non instrumented debug method calls are updated to use the new debug framework methods. However, the new debug logging framework is not yet active as the Aspects are not weaved in. After this revision, debug logging will be disabled in the server until the new AOP framework is complete. 

---
 opends/src/server/org/opends/server/extensions/SubjectEqualsDNCertificateMapper.java |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/SubjectEqualsDNCertificateMapper.java b/opends/src/server/org/opends/server/extensions/SubjectEqualsDNCertificateMapper.java
index 956ac7e..a396167 100644
--- a/opends/src/server/org/opends/server/extensions/SubjectEqualsDNCertificateMapper.java
+++ b/opends/src/server/org/opends/server/extensions/SubjectEqualsDNCertificateMapper.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Portions Copyright 2006 Sun Microsystems, Inc.
+ *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
  */
 package org.opends.server.extensions;
 
@@ -44,7 +44,9 @@
 import org.opends.server.types.LockManager;
 import org.opends.server.types.ResultCode;
 
-import static org.opends.server.loggers.Debug.*;
+import static org.opends.server.loggers.debug.DebugLogger.debugCought;
+import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
+import org.opends.server.types.DebugLogLevel;
 import static org.opends.server.messages.ExtensionsMessages.*;
 import static org.opends.server.messages.MessageHandler.*;
 import static org.opends.server.util.StaticUtils.*;
@@ -59,11 +61,6 @@
 public class SubjectEqualsDNCertificateMapper
        extends CertificateMapper
 {
-  /**
-   * The fully-qualified name of this class for debugging purposes.
-   */
-  private static final String CLASS_NAME =
-       "org.opends.server.extensions.SubjectEqualsDNCertificateMapper";
 
 
 
@@ -76,7 +73,6 @@
   {
     super();
 
-    assert debugConstructor(CLASS_NAME);
   }
 
 
@@ -98,8 +94,6 @@
   public void initializeCertificateMapper(ConfigEntry configEntry)
          throws ConfigException, InitializationException
   {
-    assert debugEnter(CLASS_NAME, "initializeCertificateMapper",
-                      String.valueOf(configEntry));
 
     // No initialization is required.
   }
@@ -129,8 +123,6 @@
   public Entry mapCertificateToUser(Certificate[] certificateChain)
          throws DirectoryException
   {
-    assert debugEnter(CLASS_NAME, "mapCertificateToUser",
-                      String.valueOf(certificateChain));
 
 
     // Make sure that a peer certificate was provided.
@@ -151,7 +143,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "mapCertificateToUser", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       int    msgID   = MSGID_SEDCM_PEER_CERT_NOT_X509;
       String message =
@@ -170,7 +165,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "mapCertificateToUser", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       int    msgID   = MSGID_SEDCM_CANNOT_DECODE_SUBJECT_AS_DN;
       String message = getMessage(msgID, String.valueOf(peerPrincipal),
@@ -209,7 +207,10 @@
     }
     catch (DirectoryException de)
     {
-      assert debugException(CLASS_NAME, "mapCertificateToUser", de);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, de);
+      }
 
       int    msgID   = MSGID_SEDCM_CANNOT_GET_ENTRY;
       String message = getMessage(msgID, String.valueOf(subjectDN),
@@ -219,7 +220,10 @@
     }
     catch (Exception e)
     {
-      assert debugException(CLASS_NAME, "mapCertificateToUser", e);
+      if (debugEnabled())
+      {
+        debugCought(DebugLogLevel.ERROR, e);
+      }
 
       int    msgID   = MSGID_SEDCM_CANNOT_GET_ENTRY;
       String message = getMessage(msgID, String.valueOf(subjectDN),

--
Gitblit v1.10.0