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/protocols/ldap/ModifyRequestProtocolOp.java | 47 +++++++++++++++++++----------------------------
1 files changed, 19 insertions(+), 28 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java b/opends/src/server/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java
index 9541fb8..4829a15 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.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.protocols.ldap;
@@ -35,7 +35,9 @@
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
-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.MessageHandler.*;
import static org.opends.server.messages.ProtocolMessages.*;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
@@ -43,7 +45,6 @@
import static org.opends.server.util.ServerConstants.*;
-
/**
* This class defines the structures and methods for an LDAP modify request
* protocol op, which is used to alter the contents of an entry in the Directory
@@ -52,11 +53,6 @@
public class ModifyRequestProtocolOp
extends ProtocolOp
{
- /**
- * The fully-qualified name of this class to use for debugging purposes.
- */
- private static final String CLASS_NAME =
- "org.opends.server.protocols.ldap.ModifyRequestProtocolOp";
@@ -76,7 +72,6 @@
*/
public ModifyRequestProtocolOp(ASN1OctetString dn)
{
- assert debugConstructor(CLASS_NAME, String.valueOf(dn));
this.dn = dn;
this.modifications = new ArrayList<LDAPModification>();
@@ -94,8 +89,6 @@
public ModifyRequestProtocolOp(ASN1OctetString dn,
ArrayList<LDAPModification> modifications)
{
- assert debugConstructor(CLASS_NAME, String.valueOf(dn),
- String.valueOf(modifications));
this.dn = dn;
@@ -118,7 +111,6 @@
*/
public ASN1OctetString getDN()
{
- assert debugEnter(CLASS_NAME, "getDN");
return dn;
}
@@ -132,7 +124,6 @@
*/
public void setDN(ASN1OctetString dn)
{
- assert debugEnter(CLASS_NAME, "setDN", String.valueOf(dn));
this.dn = dn;
}
@@ -147,7 +138,6 @@
*/
public ArrayList<LDAPModification> getModifications()
{
- assert debugEnter(CLASS_NAME, "getModifications");
return modifications;
}
@@ -161,7 +151,6 @@
*/
public byte getType()
{
- assert debugEnter(CLASS_NAME, "getType");
return OP_TYPE_MODIFY_REQUEST;
}
@@ -175,7 +164,6 @@
*/
public String getProtocolOpName()
{
- assert debugEnter(CLASS_NAME, "getProtocolOpName");
return "Modify Request";
}
@@ -190,7 +178,6 @@
*/
public ASN1Element encode()
{
- assert debugEnter(CLASS_NAME, "encode");
ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2);
elements.add(dn);
@@ -224,8 +211,6 @@
public static ModifyRequestProtocolOp decodeModifyRequest(ASN1Element element)
throws LDAPException
{
- assert debugEnter(CLASS_NAME, "decodeModifyRequest",
- String.valueOf(element));
ArrayList<ASN1Element> elements;
try
@@ -234,9 +219,12 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "decodeModifyRequest", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
- int msgID = MSGID_LDAP_MODIFY_REQUEST_DECODE_SEQUENCE;
+ int msgID = MSGID_LDAP_MODIFY_REQUEST_DECODE_SEQUENCE;
String message = getMessage(msgID, String.valueOf(e));
throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
}
@@ -258,9 +246,12 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "decodeModifyRequest", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
- int msgID = MSGID_LDAP_MODIFY_REQUEST_DECODE_DN;
+ int msgID = MSGID_LDAP_MODIFY_REQUEST_DECODE_DN;
String message = getMessage(msgID, String.valueOf(e));
throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
}
@@ -280,9 +271,12 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "decodeModifyRequest", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
- int msgID = MSGID_LDAP_MODIFY_REQUEST_DECODE_MODS;
+ int msgID = MSGID_LDAP_MODIFY_REQUEST_DECODE_MODS;
String message = getMessage(msgID, String.valueOf(e));
throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
}
@@ -301,7 +295,6 @@
*/
public void toString(StringBuilder buffer)
{
- assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder");
buffer.append("ModifyRequest(dn=");
dn.toString(buffer);
@@ -334,8 +327,6 @@
*/
public void toString(StringBuilder buffer, int indent)
{
- assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder",
- String.valueOf(indent));
StringBuilder indentBuf = new StringBuilder(indent);
for (int i=0 ; i < indent; i++)
--
Gitblit v1.10.0