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/SHA1PasswordStorageScheme.java | 55 +++++++++++++++++++++++++------------------------------
1 files changed, 25 insertions(+), 30 deletions(-)
diff --git a/opends/src/server/org/opends/server/extensions/SHA1PasswordStorageScheme.java b/opends/src/server/org/opends/server/extensions/SHA1PasswordStorageScheme.java
index 9e005e3..00dc392 100644
--- a/opends/src/server/org/opends/server/extensions/SHA1PasswordStorageScheme.java
+++ b/opends/src/server/org/opends/server/extensions/SHA1PasswordStorageScheme.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;
@@ -46,7 +46,9 @@
import org.opends.server.util.Base64;
import static org.opends.server.extensions.ExtensionsConstants.*;
-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.loggers.Error.*;
import static org.opends.server.messages.ExtensionsMessages.*;
import static org.opends.server.messages.MessageHandler.*;
@@ -67,7 +69,7 @@
extends PasswordStorageScheme
{
/**
- * The fully-qualified name of this class for debugging purposes.
+ * The fully-qualified name of this class.
*/
private static final String CLASS_NAME =
"org.opends.server.extensions.SHA1PasswordStorageScheme";
@@ -91,7 +93,6 @@
{
super();
- assert debugConstructor(CLASS_NAME);
}
@@ -103,8 +104,6 @@
public void initializePasswordStorageScheme(ConfigEntry configEntry)
throws ConfigException, InitializationException
{
- assert debugEnter(CLASS_NAME, "initializePasswordStorageScheme",
- String.valueOf(configEntry));
try
{
@@ -112,7 +111,10 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "initializePasswordStorageScheme", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
int msgID = MSGID_PWSCHEME_CANNOT_INITIALIZE_MESSAGE_DIGEST;
String message = getMessage(msgID, MESSAGE_DIGEST_ALGORITHM_SHA_1,
@@ -131,7 +133,6 @@
@Override()
public String getStorageSchemeName()
{
- assert debugEnter(CLASS_NAME, "getStorageSchemeName");
return STORAGE_SCHEME_NAME_SHA_1;
}
@@ -145,7 +146,6 @@
public ByteString encodePassword(ByteString plaintext)
throws DirectoryException
{
- assert debugEnter(CLASS_NAME, "encodePassword", String.valueOf(plaintext));
byte[] digestBytes;
@@ -157,7 +157,10 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "encodePassword", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
int msgID = MSGID_PWSCHEME_CANNOT_ENCODE_PASSWORD;
String message = getMessage(msgID, CLASS_NAME,
@@ -183,8 +186,6 @@
public ByteString encodePasswordWithScheme(ByteString plaintext)
throws DirectoryException
{
- assert debugEnter(CLASS_NAME, "encodePasswordWithScheme",
- "ByteString");
StringBuilder buffer = new StringBuilder();
buffer.append('{');
@@ -201,7 +202,10 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "encodePassword", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
int msgID = MSGID_PWSCHEME_CANNOT_ENCODE_PASSWORD;
String message = getMessage(msgID, CLASS_NAME,
@@ -229,9 +233,6 @@
public boolean passwordMatches(ByteString plaintextPassword,
ByteString storedPassword)
{
- assert debugEnter(CLASS_NAME, "passwordMatches",
- String.valueOf(plaintextPassword),
- String.valueOf(storedPassword));
byte[] userPWDigestBytes;
@@ -243,7 +244,10 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "passwordMatches", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
return false;
}
@@ -259,7 +263,10 @@
}
catch (Exception e)
{
- assert debugException(CLASS_NAME, "passwordMatches", e);
+ if (debugEnabled())
+ {
+ debugCought(DebugLogLevel.ERROR, e);
+ }
logError(ErrorLogCategory.EXTENSIONS, ErrorLogSeverity.MILD_ERROR,
MSGID_PWSCHEME_CANNOT_BASE64_DECODE_STORED_PASSWORD,
@@ -279,7 +286,6 @@
@Override()
public boolean supportsAuthPasswordSyntax()
{
- assert debugEnter(CLASS_NAME, "supportsAuthPasswordSyntax");
// This storage scheme does not support the authentication password syntax.
return false;
@@ -294,8 +300,6 @@
public ByteString encodeAuthPassword(ByteString plaintext)
throws DirectoryException
{
- assert debugEnter(CLASS_NAME, "encodeAuthPassword",
- String.valueOf(plaintext));
int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD;
@@ -313,9 +317,6 @@
public boolean authPasswordMatches(ByteString plaintextPassword,
String authInfo, String authValue)
{
- assert debugEnter(CLASS_NAME, "authPasswordMatches",
- String.valueOf(plaintextPassword),
- String.valueOf(authInfo), String.valueOf(authValue));
// This storage scheme does not support the authentication password syntax.
@@ -330,7 +331,6 @@
@Override()
public boolean isReversible()
{
- assert debugEnter(CLASS_NAME, "isReversible");
return false;
}
@@ -344,8 +344,6 @@
public ByteString getPlaintextValue(ByteString storedPassword)
throws DirectoryException
{
- assert debugEnter(CLASS_NAME, "getPlaintextValue",
- String.valueOf(storedPassword));
int msgID = MSGID_PWSCHEME_NOT_REVERSIBLE;
String message = getMessage(msgID, STORAGE_SCHEME_NAME_SHA_1);
@@ -363,8 +361,6 @@
String authValue)
throws DirectoryException
{
- assert debugEnter(CLASS_NAME, "getAuthPasswordPlaintextValue",
- String.valueOf(authInfo), String.valueOf(authValue));
int msgID = MSGID_PWSCHEME_DOES_NOT_SUPPORT_AUTH_PASSWORD;
String message = getMessage(msgID, getStorageSchemeName());
@@ -380,7 +376,6 @@
@Override()
public boolean isStorageSchemeSecure()
{
- assert debugEnter(CLASS_NAME, "isStorageSchemeSecure");
// SHA-1 should be considered secure.
return true;
--
Gitblit v1.10.0