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/AddRequestProtocolOp.java | 48 +++++++++++++++++++-----------------------------
1 files changed, 19 insertions(+), 29 deletions(-)
diff --git a/opends/src/server/org/opends/server/protocols/ldap/AddRequestProtocolOp.java b/opends/src/server/org/opends/server/protocols/ldap/AddRequestProtocolOp.java
index c23dfdc..c002d36 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/AddRequestProtocolOp.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/AddRequestProtocolOp.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;
@@ -37,7 +37,9 @@
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.util.Base64;
-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.*;
@@ -46,7 +48,6 @@
import static org.opends.server.util.StaticUtils.*;
-
/**
* This class defines the structures and methods for an LDAP add request
* protocol op, which is used to add a new entry to the Directory Server.
@@ -54,11 +55,6 @@
public class AddRequestProtocolOp
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.AddRequestProtocolOp";
@@ -78,7 +74,6 @@
*/
public AddRequestProtocolOp(ASN1OctetString dn)
{
- assert debugConstructor(CLASS_NAME, String.valueOf(dn));
this.dn = dn;
this.attributes = new ArrayList<LDAPAttribute>();
@@ -96,8 +91,6 @@
public AddRequestProtocolOp(ASN1OctetString dn,
ArrayList<LDAPAttribute> attributes)
{
- assert debugConstructor(CLASS_NAME, String.valueOf(dn),
- String.valueOf(attributes));
this.dn = dn;
@@ -120,7 +113,6 @@
*/
public ASN1OctetString getDN()
{
- assert debugEnter(CLASS_NAME, "getDN");
return dn;
}
@@ -134,7 +126,6 @@
*/
public void setDN(ASN1OctetString dn)
{
- assert debugEnter(CLASS_NAME, "setDN", String.valueOf(dn));
this.dn = dn;
}
@@ -149,7 +140,6 @@
*/
public List<LDAPAttribute> getAttributes()
{
- assert debugEnter(CLASS_NAME, "getAttributes");
return attributes;
}
@@ -163,7 +153,6 @@
*/
public byte getType()
{
- assert debugEnter(CLASS_NAME, "getType");
return OP_TYPE_ADD_REQUEST;
}
@@ -177,7 +166,6 @@
*/
public String getProtocolOpName()
{
- assert debugEnter(CLASS_NAME, "getProtocolOpName");
return "Add Request";
}
@@ -192,7 +180,6 @@
*/
public ASN1Element encode()
{
- assert debugEnter(CLASS_NAME, "encode");
ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2);
elements.add(dn);
@@ -225,7 +212,6 @@
public static AddRequestProtocolOp decodeAddRequest(ASN1Element element)
throws LDAPException
{
- assert debugEnter(CLASS_NAME, "decodeAddRequest", String.valueOf(element));
ArrayList<ASN1Element> elements;
try
@@ -234,9 +220,12 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "decodeAddRequest", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
- int msgID = MSGID_LDAP_ADD_REQUEST_DECODE_SEQUENCE;
+ int msgID = MSGID_LDAP_ADD_REQUEST_DECODE_SEQUENCE;
String message = getMessage(msgID, String.valueOf(e));
throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
}
@@ -258,9 +247,12 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "decodeAddRequest", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
- int msgID = MSGID_LDAP_ADD_REQUEST_DECODE_DN;
+ int msgID = MSGID_LDAP_ADD_REQUEST_DECODE_DN;
String message = getMessage(msgID, String.valueOf(e));
throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
}
@@ -280,9 +272,12 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "decodeAddRequest", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
- int msgID = MSGID_LDAP_ADD_REQUEST_DECODE_ATTRS;
+ int msgID = MSGID_LDAP_ADD_REQUEST_DECODE_ATTRS;
String message = getMessage(msgID, String.valueOf(e));
throw new LDAPException(PROTOCOL_ERROR, msgID, message, e);
}
@@ -301,7 +296,6 @@
*/
public void toString(StringBuilder buffer)
{
- assert debugEnter(CLASS_NAME, "toString", "java.lang.StringBuilder");
buffer.append("AddRequest(dn=");
dn.toString(buffer);
@@ -334,8 +328,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++)
@@ -371,8 +363,6 @@
*/
public void toLDIF(StringBuilder buffer, int wrapColumn)
{
- assert debugEnter(CLASS_NAME, "toLDIF", "java.lang.StringBuilder",
- String.valueOf(wrapColumn));
// Add the DN to the buffer.
--
Gitblit v1.10.0