directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1096042 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/ http-directory-bridge/src/main/java/org/apache/directory/server/ protocol-ldap/src/main/java/org/apache/directory/server/ldap/ protocol-ldap/s...
Date Fri, 22 Apr 2011 21:11:43 GMT
Author: elecharny
Date: Fri Apr 22 21:11:42 2011
New Revision: 1096042

URL: http://svn.apache.org/viewvc?rev=1096042&view=rev
Log:
o Changed the get/setErrorMessage to get/setDiagnosticMessage, as define din the RFC 4511

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/apacheds/trunk/http-directory-bridge/src/main/java/org/apache/directory/server/HttpDirectoryService.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ExtendedHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Fri Apr 22 21:11:42 2011
@@ -198,7 +198,7 @@ public class LdapCoreSessionConnection i
             LOG.warn( e.getMessage(), e );
 
             resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
-            resp.getLdapResult().setErrorMessage( e.getMessage() );
+            resp.getLdapResult().setDiagnosticMessage( e.getMessage() );
         }
 
         addResponseControls( addRequest, resp );
@@ -358,7 +358,7 @@ public class LdapCoreSessionConnection i
             LOG.warn( e.getMessage(), e );
 
             resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
-            resp.getLdapResult().setErrorMessage( e.getMessage() );
+            resp.getLdapResult().setDiagnosticMessage( e.getMessage() );
         }
 
         addResponseControls( deleteRequest, resp );
@@ -611,7 +611,7 @@ public class LdapCoreSessionConnection i
             LOG.warn( e.getMessage(), e );
 
             resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
-            resp.getLdapResult().setErrorMessage( e.getMessage() );
+            resp.getLdapResult().setDiagnosticMessage( e.getMessage() );
         }
 
         addResponseControls( iModReq, resp );
@@ -663,7 +663,7 @@ public class LdapCoreSessionConnection i
             LOG.warn( e.getMessage(), e );
 
             resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
-            resp.getLdapResult().setErrorMessage( e.getMessage() );
+            resp.getLdapResult().setDiagnosticMessage( e.getMessage() );
         }
 
         addResponseControls( iModReq, resp );
@@ -698,7 +698,7 @@ public class LdapCoreSessionConnection i
             LOG.warn( e.getMessage(), e );
 
             resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
-            resp.getLdapResult().setErrorMessage( e.getMessage() );
+            resp.getLdapResult().setDiagnosticMessage( e.getMessage() );
         }
 
         addResponseControls( modRequest, resp );
@@ -729,7 +729,7 @@ public class LdapCoreSessionConnection i
             // it is not allowed to modify the name of the Root DSE
             String msg = "Modify Dn is not allowed on Root DSE.";
             result.setResultCode( ResultCodeEnum.PROTOCOL_ERROR );
-            result.setErrorMessage( msg );
+            result.setDiagnosticMessage( msg );
             return resp;
         }
 
@@ -765,7 +765,7 @@ public class LdapCoreSessionConnection i
             }
             else
             {
-                result.setErrorMessage( "Attempt to move entry onto itself." );
+                result.setDiagnosticMessage( "Attempt to move entry onto itself." );
                 result.setResultCode( ResultCodeEnum.ENTRY_ALREADY_EXISTS );
                 result.setMatchedDn( modDnRequest.getName() );
             }
@@ -776,7 +776,7 @@ public class LdapCoreSessionConnection i
             LOG.warn( e.getMessage(), e );
 
             resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
-            resp.getLdapResult().setErrorMessage( e.getMessage() );
+            resp.getLdapResult().setDiagnosticMessage( e.getMessage() );
         }
 
         addResponseControls( modDnRequest, resp );
@@ -1198,7 +1198,7 @@ public class LdapCoreSessionConnection i
         {
             LOG.warn( e.getMessage(), e );
             LdapResult res = bindResp.getLdapResult();
-            res.setErrorMessage( e.getMessage() );
+            res.setDiagnosticMessage( e.getMessage() );
             res.setResultCode( e.getResultCode() );
         }
 

Modified: directory/apacheds/trunk/http-directory-bridge/src/main/java/org/apache/directory/server/HttpDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/http-directory-bridge/src/main/java/org/apache/directory/server/HttpDirectoryService.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/http-directory-bridge/src/main/java/org/apache/directory/server/HttpDirectoryService.java
(original)
+++ directory/apacheds/trunk/http-directory-bridge/src/main/java/org/apache/directory/server/HttpDirectoryService.java
Fri Apr 22 21:11:42 2011
@@ -87,7 +87,7 @@ public class HttpDirectoryService
             resp = new BindResponseImpl();
 
             LdapResult result = resp.getLdapResult();
-            result.setErrorMessage( e.getMessage() );
+            result.setDiagnosticMessage( e.getMessage() );
             result.setResultCode( ResultCodeEnum.getResultCode(e) );
 
             holder = new BindResponseHolder( resp, null );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java
Fri Apr 22 21:11:42 2011
@@ -22,9 +22,8 @@ package org.apache.directory.server.ldap
 
 import org.apache.directory.shared.ldap.codec.api.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.codec.api.LdapCodecServiceFactory;
-import org.apache.directory.shared.ldap.codec.api.MessageDecorator;
 import org.apache.directory.shared.ldap.codec.api.LdapMessageContainer;
-import org.apache.directory.shared.ldap.model.message.extended.NoticeOfDisconnect;
+import org.apache.directory.shared.ldap.codec.api.MessageDecorator;
 import org.apache.directory.shared.ldap.model.exception.ResponseCarryingMessageException;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
@@ -33,6 +32,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.message.ResultResponse;
 import org.apache.directory.shared.ldap.model.message.ResultResponseRequest;
+import org.apache.directory.shared.ldap.model.message.extended.NoticeOfDisconnect;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 import org.apache.directory.shared.util.Strings;
@@ -214,7 +214,7 @@ class LdapProtocolHandler extends Demuxi
                 if ( control.isCritical() && !ldapServer.getSupportedControls().contains(
control.getOid() ) )
                 {
                     ResultResponse resp = req.getResultResponse();
-                    resp.getLdapResult().setErrorMessage( "Unsupport critical control: "
+ control.getOid() );
+                    resp.getLdapResult().setDiagnosticMessage( "Unsupport critical control:
" + control.getOid() );
                     resp.getLdapResult().setResultCode( ResultCodeEnum.UNAVAILABLE_CRITICAL_EXTENSION
);
                     session.write( resp );
                     return;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
Fri Apr 22 21:11:42 2011
@@ -153,7 +153,7 @@ public class BindHandler extends LdapReq
             {
                 LOG.info( "Bind principalDn points to referral." );
                 LdapResult result = bindRequest.getResultResponse().getLdapResult();
-                result.setErrorMessage( "Bind principalDn points to referral." );
+                result.setDiagnosticMessage( "Bind principalDn points to referral." );
                 result.setResultCode( ResultCodeEnum.INVALID_CREDENTIALS );
                 ldapSession.getIoSession().write( bindRequest.getResultResponse() );
                 return;
@@ -232,7 +232,7 @@ public class BindHandler extends LdapReq
                 result.setMatchedDn( dn );
             }
 
-            result.setErrorMessage( msg );
+            result.setDiagnosticMessage( msg );
             bindRequest.getResultResponse().addAllControls( bindContext.getResponseControls()
);
             ldapSession.getIoSession().write( bindRequest.getResultResponse() );
         }
@@ -369,7 +369,7 @@ public class BindHandler extends LdapReq
         // And send the response to the client
         LdapResult bindResult = bindRequest.getResultResponse().getLdapResult();
         bindResult.setResultCode( ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED );
-        bindResult.setErrorMessage( ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED.toString() +
": "
+        bindResult.setDiagnosticMessage( ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED.toString()
+ ": "
             + bindRequest.getSaslMechanism() + " is not a supported mechanism." );
 
         // Write back the error
@@ -398,7 +398,7 @@ public class BindHandler extends LdapReq
 
         LOG.error( message );
         result.setResultCode( ResultCodeEnum.INVALID_CREDENTIALS );
-        result.setErrorMessage( message );
+        result.setDiagnosticMessage( message );
 
         // Reinitialize the state to Anonymous and clear the sasl properties
         ldapSession.clearSaslProperties();
@@ -593,7 +593,7 @@ public class BindHandler extends LdapReq
             LOG.error( I18n.err( I18n.ERR_162 ) );
             LdapResult bindResult = bindRequest.getResultResponse().getLdapResult();
             bindResult.setResultCode( ResultCodeEnum.PROTOCOL_ERROR );
-            bindResult.setErrorMessage( I18n.err( I18n.ERR_163 ) );
+            bindResult.setDiagnosticMessage( I18n.err( I18n.ERR_163 ) );
             ldapSession.getIoSession().write( bindRequest.getResultResponse() );
             return;
         }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ExtendedHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ExtendedHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ExtendedHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ExtendedHandler.java
Fri Apr 22 21:11:42 2011
@@ -47,7 +47,7 @@ public class ExtendedHandler extends Lda
             String msg = "Unrecognized extended operation EXTENSION_OID: " + req.getRequestName();
             LdapResult result = req.getResultResponse().getLdapResult();
             result.setResultCode( ResultCodeEnum.PROTOCOL_ERROR );
-            result.setErrorMessage( msg );
+            result.setDiagnosticMessage( msg );
             session.getIoSession().write( req.getResultResponse() );
             return;
         }
@@ -60,7 +60,7 @@ public class ExtendedHandler extends Lda
         {
             LdapResult result = req.getResultResponse().getLdapResult();
             result.setResultCode( ResultCodeEnum.OTHER );
-            result.setErrorMessage( ResultCodeEnum.OTHER
+            result.setDiagnosticMessage( ResultCodeEnum.OTHER
                 + ": Extended operation handler for the specified EXTENSION_OID (" + req.getRequestName()
                 + ") has failed to process your request:\n" + ExceptionUtils.getStackTrace(
e ) );
             ExtendedResponse resp = req.getResultResponse();

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
Fri Apr 22 21:11:42 2011
@@ -112,7 +112,7 @@ public abstract class LdapRequestHandler
     {
         LdapResult result = resp.getLdapResult();
         result.setResultCode( ResultCodeEnum.CONFIDENTIALITY_REQUIRED );
-        result.setErrorMessage( "Confidentiality (TLS secured connection) is required." );
+        result.setDiagnosticMessage( "Confidentiality (TLS secured connection) is required."
);
         session.write( resp );
     }
 
@@ -147,7 +147,7 @@ public abstract class LdapRequestHandler
                 BindResponse bindResponse = new BindResponseImpl( message.getMessageId()
);
                 LdapResult bindResult = bindResponse.getLdapResult();
                 bindResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
-                bindResult.setErrorMessage( I18n.err( I18n.ERR_732 ) );
+                bindResult.setDiagnosticMessage( I18n.err( I18n.ERR_732 ) );
                 ldapSession.getIoSession().write( bindResponse );
                 return;
             }
@@ -270,7 +270,7 @@ public abstract class LdapRequestHandler
             msg += ":\n" + ExceptionUtils.getStackTrace( e );
         }
 
-        result.setErrorMessage( msg );
+        result.setDiagnosticMessage( msg );
 
         if ( e instanceof LdapOperationException)
         {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java
Fri Apr 22 21:11:42 2011
@@ -67,7 +67,7 @@ public class ModifyDnHandler extends Lda
             // it is not allowed to modify the name of the Root DSE
             String msg = "Modify Dn is not allowed on Root DSE.";
             result.setResultCode( ResultCodeEnum.PROTOCOL_ERROR );
-            result.setErrorMessage( msg );
+            result.setDiagnosticMessage( msg );
             session.getIoSession().write( req.getResultResponse() );
             return;
         }
@@ -102,7 +102,7 @@ public class ModifyDnHandler extends Lda
             }
             else
             {
-                result.setErrorMessage( "Attempt to move entry onto itself." );
+                result.setDiagnosticMessage( "Attempt to move entry onto itself." );
                 result.setResultCode( ResultCodeEnum.ENTRY_ALREADY_EXISTS );
                 result.setMatchedDn( req.getName() );
                 session.getIoSession().write( req.getResultResponse() );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
Fri Apr 22 21:11:42 2011
@@ -668,7 +668,7 @@ public class SearchHandler extends LdapR
             {
                 // We didn't found the cookie into the session : it must be invalid
                 // send an error.
-                ldapResult.setErrorMessage( "Invalid cookie for this PagedSearch request."
);
+                ldapResult.setDiagnosticMessage( "Invalid cookie for this PagedSearch request."
);
                 ldapResult.setResultCode( ResultCodeEnum.UNWILLING_TO_PERFORM );
 
                 return ( SearchResultDone ) req.getResultResponse();
@@ -1189,7 +1189,7 @@ public class SearchHandler extends LdapR
 
                 if ( referralAncestor == null )
                 {
-                    result.setErrorMessage( "Entry not found." );
+                    result.setDiagnosticMessage( "Entry not found." );
                     result.setResultCode( ResultCodeEnum.NO_SUCH_OBJECT );
                     session.getIoSession().write( req.getResultResponse() );
                     return;
@@ -1230,7 +1230,7 @@ public class SearchHandler extends LdapR
         ReferralImpl referral = new ReferralImpl();
         result.setReferral( referral );
         result.setResultCode( ResultCodeEnum.REFERRAL );
-        result.setErrorMessage( "Encountered referral attempting to handle request." );
+        result.setDiagnosticMessage( "Encountered referral attempting to handle request."
);
         result.setMatchedDn( req.getBase() );
 
         Attribute refAttr = entry.getOriginalEntry().get( SchemaConstants.REF_AT );
@@ -1544,7 +1544,7 @@ public class SearchHandler extends LdapR
             msg += ":\n" + ExceptionUtils.getStackTrace( e );
         }
 
-        result.setErrorMessage( msg );
+        result.setDiagnosticMessage( msg );
 
         if ( e instanceof LdapOperationException )
         {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/AbstractSaslCallbackHandler.java
Fri Apr 22 21:11:42 2011
@@ -275,7 +275,7 @@ public abstract class AbstractSaslCallba
                 result.setMatchedDn( dn );
             }
 
-            result.setErrorMessage( msg );
+            result.setDiagnosticMessage( msg );
             session.write( bindRequest.getResultResponse() );
             ctx = null;
         }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java?rev=1096042&r1=1096041&r2=1096042&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/SimpleMechanismHandler.java
Fri Apr 22 21:11:42 2011
@@ -122,7 +122,7 @@ public class SimpleMechanismHandler impl
                 result.setMatchedDn( name );
             }
 
-            result.setErrorMessage( msg );
+            result.setDiagnosticMessage( msg );
             ldapSession.getIoSession().write( bindRequest.getResultResponse() );
         }
         



Mime
View raw message