directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r230873 - in /directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol: AddHandler.java BindHandler.java CompareHandler.java DeleteHandler.java ModifyDnHandler.java ModifyHandler.java SearchHandler.java
Date Mon, 08 Aug 2005 20:21:55 GMT
Author: akarasulu
Date: Mon Aug  8 13:21:50 2005
New Revision: 230873

URL: http://svn.apache.org/viewcvs?rev=230873&view=rev
Log:
Applying Stefans patch to fix error handling messages here: http://issues.apache.org/jira/secure/attachment/12311640/patch.txt

Modified:
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/AddHandler.java
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/BindHandler.java
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/CompareHandler.java
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/DeleteHandler.java
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyDnHandler.java
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyHandler.java
    directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/AddHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/AddHandler.java?rev=230873&r1=230872&r2=230873&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/AddHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/AddHandler.java
Mon Aug  8 13:21:50 2005
@@ -28,6 +28,7 @@
 import org.apache.ldap.common.util.ExceptionUtils;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.handler.MessageHandler;
+import org.apache.log4j.Logger;
 
 /**
  * A single reply handler for {@link org.apache.ldap.common.message.AddRequest}s.
@@ -37,6 +38,8 @@
  */
 public class AddHandler implements MessageHandler
 {
+    private static final Logger LOG = Logger.getLogger( AddHandler.class );
+
     public void messageReceived( ProtocolSession session, Object request )
     {
         AddRequest req = ( AddRequest ) request;
@@ -53,9 +56,12 @@
         }
         catch( NamingException e )
         {
-            String msg = "failed to add entry " + req.getName() + ":\n";
+            String msg = "failed to add entry " + req.getName();
 
-            msg += ExceptionUtils.getStackTrace( e );
+            if ( LOG.isDebugEnabled() )
+            {
+                msg += ":\n" + ExceptionUtils.getStackTrace( e );
+            }
 
             ResultCodeEnum code;
 

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/BindHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/BindHandler.java?rev=230873&r1=230872&r2=230873&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/BindHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/BindHandler.java
Mon Aug  8 13:21:50 2005
@@ -34,6 +34,7 @@
 import org.apache.ldap.common.message.LdapResultImpl;
 import org.apache.ldap.common.message.ResultCodeEnum;
 import org.apache.ldap.common.util.ExceptionUtils;
+import org.apache.log4j.Logger;
 
 /*
  * I would like to eventually see these newly introduced dependencies
@@ -61,6 +62,8 @@
  */
 public class BindHandler implements MessageHandler
 {
+    private static final Logger LOG = Logger.getLogger( BindHandler.class );
+
     private static final Control[] EMPTY = new Control[0];
 
 
@@ -150,9 +153,14 @@
                         req.getType() ) );
             }
 
-            String msg = "Bind failure:\n" + ExceptionUtils.getStackTrace( e );
+            String msg = "Bind failed";
+
+            if ( LOG.isDebugEnabled() )
+            {
+                msg += ":\n" + ExceptionUtils.getStackTrace( e );
+                msg += "\n\nBindRequest = \n" + req.toString();
+            }
 
-            msg += "\n\nBindRequest = \n" + req.toString();
 
             result.setErrorMessage( msg );
 

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/CompareHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/CompareHandler.java?rev=230873&r1=230872&r2=230873&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/CompareHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/CompareHandler.java
Mon Aug  8 13:21:50 2005
@@ -30,6 +30,7 @@
 import org.apache.ldap.common.util.ExceptionUtils;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.handler.MessageHandler;
+import org.apache.log4j.Logger;
 
 
 /**
@@ -40,6 +41,8 @@
  */
 public class CompareHandler implements MessageHandler
 {
+    private static final Logger LOG = Logger.getLogger( CompareHandler.class );
+
     public void messageReceived( ProtocolSession session, Object request )
     {
         CompareRequest req = ( CompareRequest ) request;
@@ -69,9 +72,12 @@
         }
         catch ( NamingException e )
         {
-            String msg = "failed to add entry " + req.getName() + ":\n";
+            String msg = "failed to compare entry " + req.getName();
 
-            msg += ExceptionUtils.getStackTrace( e );
+            if ( LOG.isDebugEnabled() )
+            {
+                msg += ":\n" + ExceptionUtils.getStackTrace( e );
+            }
 
             ResultCodeEnum code;
 

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/DeleteHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/DeleteHandler.java?rev=230873&r1=230872&r2=230873&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/DeleteHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/DeleteHandler.java
Mon Aug  8 13:21:50 2005
@@ -54,11 +54,11 @@
         }
         catch( NamingException e )
         {
-            String msg = "failed to delete entry " + req.getName() + ":\n";
+            String msg = "failed to delete entry " + req.getName();
 
             if ( LOG.isDebugEnabled() )
             {
-                msg += ExceptionUtils.getStackTrace( e );
+                msg += ":\n" + ExceptionUtils.getStackTrace( e );
             }
 
             ResultCodeEnum code;

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyDnHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyDnHandler.java?rev=230873&r1=230872&r2=230873&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyDnHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyDnHandler.java
Mon Aug  8 13:21:50 2005
@@ -30,6 +30,7 @@
 import org.apache.ldap.common.util.ExceptionUtils;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.handler.MessageHandler;
+import org.apache.log4j.Logger;
 
 
 /**
@@ -40,6 +41,8 @@
  */
 public class ModifyDnHandler implements MessageHandler
 {
+    private static final Logger LOG = Logger.getLogger( ModifyDnHandler.class );
+
     public void messageReceived( ProtocolSession session, Object request )
     {
         ModifyDnRequest req = ( ModifyDnRequest ) request;
@@ -86,9 +89,12 @@
         }
         catch ( NamingException e )
         {
-            String msg = "failed to add entry " + req.getName() + ":\n";
+            String msg = "failed to modify DN of entry " + req.getName();
 
-            msg += ExceptionUtils.getStackTrace( e );
+            if ( LOG.isDebugEnabled() )
+            {
+                msg += ":\n" + ExceptionUtils.getStackTrace( e );
+            }
 
             ResultCodeEnum code;
 

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyHandler.java?rev=230873&r1=230872&r2=230873&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/ModifyHandler.java
Mon Aug  8 13:21:50 2005
@@ -30,6 +30,7 @@
 import org.apache.ldap.common.util.ExceptionUtils;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.handler.MessageHandler;
+import org.apache.log4j.Logger;
 
 
 /**
@@ -40,6 +41,8 @@
  */
 public class ModifyHandler implements MessageHandler
 {
+    private static final Logger LOG = Logger.getLogger( ModifyHandler.class );
+
     private static final ModificationItem[] EMPTY = new ModificationItem[0];
 
     public void messageReceived( ProtocolSession session, Object request )
@@ -60,9 +63,12 @@
         }
         catch ( NamingException e )
         {
-            String msg = "failed to add entry " + req.getName() + ":\n";
-
-            msg += ExceptionUtils.getStackTrace( e );
+            String msg = "failed to modify entry " + req.getName();
+	    
+            if ( LOG.isDebugEnabled() )
+            {
+                msg += ":\n" + ExceptionUtils.getStackTrace( e );
+            }
 
             ResultCodeEnum code;
 

Modified: directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java?rev=230873&r1=230872&r2=230873&view=diff
==============================================================================
--- directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java
(original)
+++ directory/protocol-providers/ldap/trunk/src/main/java/org/apache/ldap/server/protocol/SearchHandler.java
Mon Aug  8 13:21:50 2005
@@ -44,6 +44,7 @@
 import org.apache.ldap.common.util.ExceptionUtils;
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.handler.MessageHandler;
+import org.apache.log4j.Logger;
 
 /**
  * A handler for processing search requests.
@@ -53,6 +54,8 @@
  */
 public class SearchHandler implements MessageHandler
 {
+    private static final Logger LOG = Logger.getLogger( SearchHandler.class );
+    
     private static final String DEREFALIASES_KEY = "java.naming.ldap.derefAliases";
 
 
@@ -162,9 +165,12 @@
         }
         catch( NamingException e )
         {
-            String msg = "failed on search operation:\n" + req + "\n";
+            String msg = "failed on search operation";
 
-            msg += ExceptionUtils.getStackTrace( e );
+            if ( LOG.isDebugEnabled() )
+            {
+                msg += ":\n" + req + ":\n" + ExceptionUtils.getStackTrace( e );
+            }
 
             SearchResponseDone resp = new SearchResponseDoneImpl( req.getMessageId() );
 
@@ -206,9 +212,12 @@
 
     SearchResponseDone getResponse( SearchRequest req, NamingException e )
     {
-        String msg = "failed on search operation:\n" + req + "\n";
+        String msg = "failed on search operation";
 
-        msg += ExceptionUtils.getStackTrace( e );
+        if ( LOG.isDebugEnabled() )
+        {
+            msg += ":\n" + req + ":\n" + ExceptionUtils.getStackTrace( e );
+        }
 
         SearchResponseDone resp = new SearchResponseDoneImpl( req.getMessageId() );
 



Mime
View raw message