directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r477298 [1/3] - in /directory/trunks/shared/ldap/src: main/java/org/apache/directory/shared/ldap/codec/ main/java/org/apache/directory/shared/ldap/codec/actions/ main/java/org/apache/directory/shared/ldap/exception/ main/java/org/apache/dir...
Date Mon, 20 Nov 2006 19:29:44 GMT
Author: elecharny
Date: Mon Nov 20 11:29:41 2006
New Revision: 477298

URL: http://svn.apache.org/viewvc?view=rev&rev=477298
Log:
Changed the ResultCodeEnum to become an enum instead of an subclass
of ValuedEnum (Java 5 migration)

Modified:
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAttributeInUseException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationNotSupportedException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapContextNotEmptyException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeIdentifierException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeValueException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameAlreadyBoundException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameNotFoundException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoPermissionException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoSuchAttributeException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSchemaViolationException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSizeLimitExceededException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapTimeLimitExceededException.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/ResultCodeEnum.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/GracefulShutdownResponse.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/LaunchDiagnosticUiResponse.java
    directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/NoticeOfDisconnect.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/LdapResultTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddRequestTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/add/AddResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyRequestTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modify/ModifyResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchResultDoneTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/message/AbstractResultResponseTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindResponseImplTest.java
    directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/message/LdapResultImplTest.java

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Mon Nov 20 11:29:41 2006
@@ -380,7 +380,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                             
                             DeleteResponseImpl response = new DeleteResponseImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
                         }
 
                         delRequest.setEntry( entry );
@@ -609,7 +609,7 @@
                         
                             BindResponseImpl response = new BindResponseImpl( ldapMessage.getMessageId() );
                         
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
                         }
 
                         bindRequestMessage.setName( name );
@@ -719,7 +719,7 @@
                         
                         BindResponseImpl response = new BindResponseImpl( ldapMessage.getMessageId() );
                     
-                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDCREDENTIALS, 
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_CREDENTIALS, 
                             bindRequestMessage.getName(), null );
                     }
 
@@ -1492,7 +1492,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                     
                             ModifyResponseImpl response = new ModifyResponseImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
                         }
 
                         modifyRequest.setObject( object );
@@ -1657,7 +1657,7 @@
                         log.error( msg );
                         
                         ModifyResponseImpl response = new ModifyResponseImpl( ldapMessage.getMessageId() );
-                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDATTRIBUTESYNTAX, modifyRequest.getObject(), null );
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, modifyRequest.getObject(), null );
                     }
                     else
                     {
@@ -1916,7 +1916,7 @@
                 
                         // I guess that trying to add an entry which DN is empty is a naming violation...
                         // Not 100% sure though ...
-                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.NAMINGVIOLATION, LdapDN.EMPTY_LDAPDN, null );
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.NAMING_VIOLATION, LdapDN.EMPTY_LDAPDN, null );
                     }
                     else
                     {
@@ -1935,7 +1935,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                 
                             AddResponseImpl response = new AddResponseImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
                         }
 
                         addRequest.setEntry( entry );
@@ -2011,7 +2011,7 @@
 
                         AddResponseImpl response = new AddResponseImpl( ldapMessage.getMessageId() );
                         
-                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDATTRIBUTESYNTAX, addRequest.getEntry(), null );
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, addRequest.getEntry(), null );
                     }
 
                     String type = new String( tlv.getValue().getData() );
@@ -2255,7 +2255,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
         
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
                         }
 
                         modifyDNRequest.setEntry( entry );
@@ -2306,7 +2306,7 @@
                         log.error(  msg  );
                         
                         ModifyDnResponseImpl response = new ModifyDnResponseImpl( ldapMessage.getMessageId() );
-                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, modifyDNRequest.getEntry(), null );
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, modifyDNRequest.getEntry(), null );
                     }
                     else
                     {
@@ -2325,7 +2325,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
     
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, modifyDNRequest.getEntry(), ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, modifyDNRequest.getEntry(), ine );
                         }
 
                         modifyDNRequest.setNewRDN( newRdn );
@@ -2459,7 +2459,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
     
                             ModifyDnResponseImpl response = new ModifyDnResponseImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, modifyDNRequest.getEntry(), ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, modifyDNRequest.getEntry(), ine );
                         }
 
                         modifyDNRequest.setNewSuperior( newSuperior );
@@ -2614,7 +2614,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
             
                             CompareResponseImpl response = new CompareResponseImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
                         }
 
                         compareRequest.setEntry( entry );
@@ -2674,7 +2674,7 @@
                         log.error( msg );
                         CompareResponseImpl response = new CompareResponseImpl( ldapMessage.getMessageId() );
                         
-                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDATTRIBUTESYNTAX, compareRequest.getEntry(), null );
+                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, compareRequest.getEntry(), null );
                     }
 
                     String type = new String( tlv.getValue().getData() );
@@ -3523,7 +3523,7 @@
                             log.error( "{} : {}", msg, ine.getMessage() );
                     
                             SearchResponseDoneImpl response = new SearchResponseDoneImpl( ldapMessage.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALIDDNSYNTAX, LdapDN.EMPTY_LDAPDN, ine );
+                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX, LdapDN.EMPTY_LDAPDN, ine );
                         }
                     }
 

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapResult.java Mon Nov 20 11:29:41 2006
@@ -25,8 +25,8 @@
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.EncoderException;
-import org.apache.directory.shared.ldap.codec.util.LdapResultEnum;
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -97,7 +97,7 @@
      * other                                    (80) 
      * }                                        -- 81-90 reserved for APIs --
      */
-    private int resultCode;
+    private ResultCodeEnum resultCode;
 
     /** The DN that is matched by the Bind */
     private LdapDN matchedDN;
@@ -211,7 +211,7 @@
      * 
      * @return Returns the resultCode.
      */
-    public int getResultCode()
+    public ResultCodeEnum getResultCode()
     {
         return resultCode;
     }
@@ -222,7 +222,7 @@
      * 
      * @param resultCode The resultCode to set.
      */
-    public void setResultCode( int resultCode )
+    public void setResultCode( ResultCodeEnum resultCode )
     {
         this.resultCode = resultCode;
     }
@@ -314,7 +314,7 @@
             // The result code
             buffer.put( UniversalTag.ENUMERATED_TAG );
             buffer.put( ( byte ) 1 );
-            buffer.put( ( byte ) resultCode );
+            buffer.put( ( byte ) resultCode.getValue() );
         }
         catch ( BufferOverflowException boe )
         {
@@ -367,239 +367,244 @@
         switch ( resultCode )
         {
 
-            case LdapResultEnum.SUCCESS:
+            case SUCCESS:
                 sb.append( " success\n" );
                 break;
 
-            case LdapResultEnum.OPERATIONS_ERROR:
+            case OPERATIONS_ERROR:
                 sb.append( " operationsError\n" );
                 break;
 
-            case LdapResultEnum.PROTOCOL_ERROR:
+            case PROTOCOL_ERROR:
                 sb.append( " protocolError\n" );
                 break;
 
-            case LdapResultEnum.TIME_LIMIT_EXCEEDED:
+            case TIME_LIMIT_EXCEEDED:
                 sb.append( " timeLimitExceeded\n" );
                 break;
 
-            case LdapResultEnum.SIZE_LIMIT_EXCEEDED:
+            case SIZE_LIMIT_EXCEEDED:
                 sb.append( " sizeLimitExceeded\n" );
                 break;
 
-            case LdapResultEnum.COMPARE_FALSE:
+            case COMPARE_FALSE:
                 sb.append( " compareFalse\n" );
                 break;
 
-            case LdapResultEnum.COMPARE_TRUE:
+            case COMPARE_TRUE:
                 sb.append( " compareTrue\n" );
                 break;
 
-            case LdapResultEnum.AUTH_METHOD_NOT_SUPPORTED:
+            case AUTH_METHOD_NOT_SUPPORTED:
                 sb.append( " authMethodNotSupported\n" );
                 break;
 
-            case LdapResultEnum.STRONG_AUTH_REQUIRED:
+            case STRONG_AUTH_REQUIRED:
                 sb.append( " strongAuthRequired\n" );
                 break;
 
-            case LdapResultEnum.RESERVED_9:
-                sb.append( " -- 9 reserved --\n" );
-                break;
-
-            case LdapResultEnum.REFERRAL:
+            case REFERRAL:
                 sb.append( " referral -- new\n" );
                 break;
 
-            case LdapResultEnum.ADMIN_LIMIT_EXCEEDED:
+            case ADMIN_LIMIT_EXCEEDED:
                 sb.append( " adminLimitExceeded -- new\n" );
                 break;
 
-            case LdapResultEnum.UNAVAILABLE_CRITICAL_EXTENSION:
+            case UNAVAILABLE_CRITICAL_EXTENSION:
                 sb.append( " unavailableCriticalExtension -- new\n" );
                 break;
 
-            case LdapResultEnum.CONFIDENTIALITY_REQUIRED:
+            case CONFIDENTIALITY_REQUIRED:
                 sb.append( " confidentialityRequired -- new\n" );
                 break;
 
-            case LdapResultEnum.SASL_BIND_IN_PROGRESS:
+            case SASL_BIND_IN_PROGRESS:
                 sb.append( " saslBindInProgress -- new\n" );
                 break;
 
-            case LdapResultEnum.NO_SUCH_ATTRIBUTE:
+            case NO_SUCH_ATTRIBUTE:
                 sb.append( " noSuchAttribute\n" );
                 break;
 
-            case LdapResultEnum.UNDEFINED_ATTRIBUTE_TYPE:
+            case UNDEFINED_ATTRIBUTE_TYPE:
                 sb.append( " undefinedAttributeType\n" );
                 break;
 
-            case LdapResultEnum.INAPPROPRIATE_MATCHING:
+            case INAPPROPRIATE_MATCHING:
                 sb.append( " inappropriateMatching\n" );
                 break;
 
-            case LdapResultEnum.CONSTRAINT_VIOLATION:
+            case CONSTRAINT_VIOLATION:
                 sb.append( " constraintViolation\n" );
                 break;
 
-            case LdapResultEnum.ATTRIBUTE_OR_VALUE_EXISTS:
+            case ATTRIBUTE_OR_VALUE_EXISTS:
                 sb.append( " attributeOrValueExists\n" );
                 break;
 
-            case LdapResultEnum.INVALID_ATTRIBUTE_SYNTAX:
+            case INVALID_ATTRIBUTE_SYNTAX:
                 sb.append( " invalidAttributeSyntax\n" );
                 break;
 
-            case LdapResultEnum.UNUSED_22:
-            case LdapResultEnum.UNUSED_23:
-            case LdapResultEnum.UNUSED_24:
-            case LdapResultEnum.UNUSED_25:
-            case LdapResultEnum.UNUSED_26:
-            case LdapResultEnum.UNUSED_27:
-            case LdapResultEnum.UNUSED_28:
-            case LdapResultEnum.UNUSED_29:
-            case LdapResultEnum.UNUSED_30:
-            case LdapResultEnum.UNUSED_31:
-                sb.append( " -- 22-31 unused --\n" );
-                break;
-
-            case LdapResultEnum.NO_SUCH_OBJECT:
+            case NO_SUCH_OBJECT:
                 sb.append( " noSuchObject\n" );
                 break;
 
-            case LdapResultEnum.ALIAS_PROBLEM:
+            case ALIAS_PROBLEM:
                 sb.append( " aliasProblem\n" );
                 break;
 
-            case LdapResultEnum.INVALID_DN_SYNTAX:
+            case INVALID_DN_SYNTAX:
                 sb.append( " invalidDNSyntax\n" );
                 break;
 
-            case LdapResultEnum.RESERVED_FOR_UNDEFINED_IS_LEAF:
-                sb.append( " -- 35 reserved for undefined isLeaf --\n" );
-                break;
-
-            case LdapResultEnum.ALIAS_DEREFERENCING_PROBLEM:
+            case ALIAS_DEREFERENCING_PROBLEM:
                 sb.append( " aliasDereferencingProblem\n" );
                 break;
 
-            case LdapResultEnum.UNUSED_37:
-            case LdapResultEnum.UNUSED_38:
-            case LdapResultEnum.UNUSED_39:
-            case LdapResultEnum.UNUSED_40:
-            case LdapResultEnum.UNUSED_41:
-            case LdapResultEnum.UNUSED_42:
-            case LdapResultEnum.UNUSED_43:
-            case LdapResultEnum.UNUSED_44:
-            case LdapResultEnum.UNUSED_45:
-            case LdapResultEnum.UNUSED_46:
-            case LdapResultEnum.UNUSED_47:
-                sb.append( " -- 37-47 unused --\n" );
-                break;
-
-            case LdapResultEnum.INAPPROPRIATE_AUTHENTICATION:
+            case INAPPROPRIATE_AUTHENTICATION:
                 sb.append( " inappropriateAuthentication\n" );
                 break;
 
-            case LdapResultEnum.INVALID_CREDENTIALS:
+            case INVALID_CREDENTIALS:
                 sb.append( " invalidCredentials\n" );
                 break;
 
-            case LdapResultEnum.INSUFFICIENT_ACCESS_RIGHTS:
+            case INSUFFICIENT_ACCESS_RIGHTS:
                 sb.append( " insufficientAccessRights\n" );
                 break;
 
-            case LdapResultEnum.BUSY:
+            case BUSY:
                 sb.append( " busy\n" );
                 break;
 
-            case LdapResultEnum.UNAVAILABLE:
+            case UNAVAILABLE:
                 sb.append( " unavailable\n" );
                 break;
 
-            case LdapResultEnum.UNWILLING_TO_PERFORM:
+            case UNWILLING_TO_PERFORM:
                 sb.append( " unwillingToPerform\n" );
                 break;
 
-            case LdapResultEnum.LOOP_DETECT:
+            case LOOP_DETECT:
                 sb.append( " loopDetect\n" );
                 break;
 
-            case LdapResultEnum.UNUSED_55:
-            case LdapResultEnum.UNUSED_56:
-            case LdapResultEnum.UNUSED_57:
-            case LdapResultEnum.UNUSED_58:
-            case LdapResultEnum.UNUSED_59:
-            case LdapResultEnum.UNUSED_60:
-            case LdapResultEnum.UNUSED_61:
-            case LdapResultEnum.UNUSED_62:
-            case LdapResultEnum.UNUSED_63:
-                sb.append( " -- 55-63 unused --\n" );
-                break;
-
-            case LdapResultEnum.NAMING_VIOLATION:
+            case NAMING_VIOLATION:
                 sb.append( " namingViolation\n" );
                 break;
 
-            case LdapResultEnum.OBJECT_CLASS_VIOLATION:
+            case OBJECT_CLASS_VIOLATION:
                 sb.append( " objectClassViolation\n" );
                 break;
 
-            case LdapResultEnum.NOT_ALLOWED_ON_NON_LEAF:
+            case NOT_ALLOWED_ON_NON_LEAF:
                 sb.append( " notAllowedOnNonLeaf\n" );
                 break;
 
-            case LdapResultEnum.NOT_ALLOWED_ON_RDN:
+            case NOT_ALLOWED_ON_RDN:
                 sb.append( " notAllowedOnRDN\n" );
                 break;
 
-            case LdapResultEnum.ENTRY_ALREADY_EXISTS:
+            case ENTRY_ALREADY_EXISTS:
                 sb.append( " entryAlreadyExists\n" );
                 break;
 
-            case LdapResultEnum.OBJECT_CLASS_MODS_PROHIBITED:
+            case OBJECT_CLASS_MODS_PROHIBITED:
                 sb.append( " objectClassModsProhibited\n" );
                 break;
 
-            case LdapResultEnum.RESERVED_FOR_CLDAP:
-                sb.append( " -- 70 reserved for CLDAP --\n" );
-                break;
-
-            case LdapResultEnum.AFFECTS_MULTIPLE_DSAS:
+            case AFFECTS_MULTIPLE_DSAS:
                 sb.append( " affectsMultipleDSAs -- new\n" );
                 break;
 
-            case LdapResultEnum.UNUSED_72:
-            case LdapResultEnum.UNUSED_73:
-            case LdapResultEnum.UNUSED_74:
-            case LdapResultEnum.UNUSED_75:
-            case LdapResultEnum.UNUSED_76:
-            case LdapResultEnum.UNUSED_77:
-            case LdapResultEnum.UNUSED_78:
-            case LdapResultEnum.UNUSED_79:
-                sb.append( " -- 72-79 unused --\n" );
-                break;
-
-            case LdapResultEnum.OTHER:
+            case OTHER:
                 sb.append( " other\n" );
                 break;
 
-            case LdapResultEnum.RESERVED_FOR_APIS_81:
-            case LdapResultEnum.RESERVED_FOR_APIS_82:
-            case LdapResultEnum.RESERVED_FOR_APIS_83:
-            case LdapResultEnum.RESERVED_FOR_APIS_84:
-            case LdapResultEnum.RESERVED_FOR_APIS_85:
-            case LdapResultEnum.RESERVED_FOR_APIS_86:
-            case LdapResultEnum.RESERVED_FOR_APIS_87:
-            case LdapResultEnum.RESERVED_FOR_APIS_88:
-            case LdapResultEnum.RESERVED_FOR_APIS_89:
-            case LdapResultEnum.RESERVED_FOR_APIS_90:
-                sb.append( " -- 81-90 reserved for APIs --" );
-                break;
-
             default:
-                sb.append( "Unknown error code : " ).append( resultCode );
+                switch ( resultCode.getResultCode() )
+                {
+                    case 9:
+                        sb.append( " -- 9 reserved --\n" );
+                        break;
+    
+                    case 22:
+                    case 23:
+                    case 24:
+                    case 25:
+                    case 26:
+                    case 27:
+                    case 28:
+                    case 29:
+                    case 30:
+                    case 31:
+                        sb.append( " -- 22-31 unused --\n" );
+                        break;
+                        
+                    case 35 :
+                        sb.append( " -- 35 reserved for undefined isLeaf --\n" );
+                        break;
+                        
+                    case 37:
+                    case 38:
+                    case 39:
+                    case 40:
+                    case 41:
+                    case 42:
+                    case 43:
+                    case 44:
+                    case 45:
+                    case 46:
+                    case 47:
+                        sb.append( " -- 37-47 unused --\n" );
+                        break;
+    
+                    case 55:
+                    case 56:
+                    case 57:
+                    case 58:
+                    case 59:
+                    case 60:
+                    case 61:
+                    case 62:
+                    case 63:
+                        sb.append( " -- 55-63 unused --\n" );
+                        break;
+    
+                    case 70:
+                        sb.append( " -- 70 reserved for CLDAP --\n" );
+                        break;
+                        
+                    case 72:
+                    case 73:
+                    case 74:
+                    case 75:
+                    case 76:
+                    case 77:
+                    case 78:
+                    case 79:
+                        sb.append( " -- 72-79 unused --\n" );
+                        break;
+    
+                    case 81:
+                    case 82:
+                    case 83:
+                    case 84:
+                    case 85:
+                    case 86:
+                    case 87:
+                    case 88:
+                    case 89:
+                    case 90:
+                        sb.append( " -- 81-90 reserved for APIs --" );
+                        break;
+                        
+                    default :
+                        sb.append( "Unknown error code : " ).append( resultCode );
+                        break;
+                }
         }
 
         sb.append( "            Matched DN : '" ).append( matchedDN == null ? "": matchedDN.toString() ).append( "'\n" );

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/TwixTransformer.java Mon Nov 20 11:29:41 2006
@@ -855,7 +855,7 @@
         LdapResult twixLdapResult = new LdapResult();
 
         // Snickers : ResultCodeEnum resultCode -> Twix : int resultCode
-        twixLdapResult.setResultCode( snickersLdapResult.getResultCode().getValue() );
+        twixLdapResult.setResultCode( snickersLdapResult.getResultCode() );
 
         // Snickers : String errorMessage -> Twix : LdapString errorMessage
         String errorMessage = snickersLdapResult.getErrorMessage();

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java Mon Nov 20 11:29:41 2006
@@ -30,7 +30,7 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponse;
 import org.apache.directory.shared.ldap.codec.LdapResult;
-import org.apache.directory.shared.ldap.codec.util.LdapResultEnum;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -80,14 +80,14 @@
             // A not null matchedDN is valid for resultCodes
             // NoSuchObject, AliasProblem, InvalidDNSyntax and
             // AliasDreferencingProblem.
-            int resultCode = ldapResult.getResultCode();
+            ResultCodeEnum resultCode = ldapResult.getResultCode();
 
             switch ( resultCode )
             {
-                case LdapResultEnum.NO_SUCH_OBJECT :
-                case LdapResultEnum.ALIAS_PROBLEM :
-                case LdapResultEnum.INVALID_DN_SYNTAX :
-                case LdapResultEnum.ALIAS_DEREFERENCING_PROBLEM :
+                case NO_SUCH_OBJECT :
+                case ALIAS_PROBLEM :
+                case INVALID_DN_SYNTAX :
+                case ALIAS_DEREFERENCING_PROBLEM :
                     byte[] dnBytes = tlv.getValue().getData();
                     
                     try

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java Mon Nov 20 11:29:41 2006
@@ -30,9 +30,9 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponse;
 import org.apache.directory.shared.ldap.codec.LdapResult;
-import org.apache.directory.shared.ldap.codec.util.LdapResultEnum;
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -74,7 +74,7 @@
         }
         else
         {
-            if ( ldapResult.getResultCode() == LdapResultEnum.REFERRAL )
+            if ( ldapResult.getResultCode() == ResultCodeEnum.REFERRAL )
             {
                 try
                 {

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java Mon Nov 20 11:29:41 2006
@@ -31,7 +31,7 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponse;
 import org.apache.directory.shared.ldap.codec.LdapResult;
-import org.apache.directory.shared.ldap.codec.util.LdapResultEnum;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 import org.slf4j.Logger;
@@ -74,11 +74,11 @@
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
         Value value = tlv.getValue();
-        int resultCode = 0;
+        ResultCodeEnum resultCode = ResultCodeEnum.SUCCESS;
 
         try
         {
-            resultCode = IntegerDecoder.parse( value, 0, 90 );
+            resultCode = ResultCodeEnum.getResultCode( IntegerDecoder.parse( value, 0, 90 ) );
         }
         catch ( IntegerDecoderException ide )
         {
@@ -91,54 +91,54 @@
         // Treat the 'normal' cases !
         switch ( resultCode )
         {
-            case LdapResultEnum.SUCCESS:
-            case LdapResultEnum.OPERATIONS_ERROR:
-            case LdapResultEnum.PROTOCOL_ERROR:
-            case LdapResultEnum.TIME_LIMIT_EXCEEDED:
-            case LdapResultEnum.SIZE_LIMIT_EXCEEDED:
-            case LdapResultEnum.COMPARE_FALSE:
-            case LdapResultEnum.COMPARE_TRUE:
-            case LdapResultEnum.AUTH_METHOD_NOT_SUPPORTED:
-            case LdapResultEnum.STRONG_AUTH_REQUIRED:
-            case LdapResultEnum.REFERRAL:
-            case LdapResultEnum.ADMIN_LIMIT_EXCEEDED:
-            case LdapResultEnum.UNAVAILABLE_CRITICAL_EXTENSION:
-            case LdapResultEnum.CONFIDENTIALITY_REQUIRED:
-            case LdapResultEnum.SASL_BIND_IN_PROGRESS:
-            case LdapResultEnum.NO_SUCH_ATTRIBUTE:
-            case LdapResultEnum.UNDEFINED_ATTRIBUTE_TYPE:
-            case LdapResultEnum.INAPPROPRIATE_MATCHING:
-            case LdapResultEnum.CONSTRAINT_VIOLATION:
-            case LdapResultEnum.ATTRIBUTE_OR_VALUE_EXISTS:
-            case LdapResultEnum.INVALID_ATTRIBUTE_SYNTAX:
-            case LdapResultEnum.NO_SUCH_OBJECT:
-            case LdapResultEnum.ALIAS_PROBLEM:
-            case LdapResultEnum.INVALID_DN_SYNTAX:
-            case LdapResultEnum.ALIAS_DEREFERENCING_PROBLEM:
-            case LdapResultEnum.INAPPROPRIATE_AUTHENTICATION:
-            case LdapResultEnum.INVALID_CREDENTIALS:
-            case LdapResultEnum.INSUFFICIENT_ACCESS_RIGHTS:
-            case LdapResultEnum.BUSY:
-            case LdapResultEnum.UNAVAILABLE:
-            case LdapResultEnum.UNWILLING_TO_PERFORM:
-            case LdapResultEnum.LOOP_DETECT:
-            case LdapResultEnum.NAMING_VIOLATION:
-            case LdapResultEnum.OBJECT_CLASS_VIOLATION:
-            case LdapResultEnum.NOT_ALLOWED_ON_NON_LEAF:
-            case LdapResultEnum.NOT_ALLOWED_ON_RDN:
-            case LdapResultEnum.ENTRY_ALREADY_EXISTS:
-            case LdapResultEnum.AFFECTS_MULTIPLE_DSAS:
+            case SUCCESS:
+            case OPERATIONS_ERROR:
+            case PROTOCOL_ERROR:
+            case TIME_LIMIT_EXCEEDED:
+            case SIZE_LIMIT_EXCEEDED:
+            case COMPARE_FALSE:
+            case COMPARE_TRUE:
+            case AUTH_METHOD_NOT_SUPPORTED:
+            case STRONG_AUTH_REQUIRED:
+            case REFERRAL:
+            case ADMIN_LIMIT_EXCEEDED:
+            case UNAVAILABLE_CRITICAL_EXTENSION:
+            case CONFIDENTIALITY_REQUIRED:
+            case SASL_BIND_IN_PROGRESS:
+            case NO_SUCH_ATTRIBUTE:
+            case UNDEFINED_ATTRIBUTE_TYPE:
+            case INAPPROPRIATE_MATCHING:
+            case CONSTRAINT_VIOLATION:
+            case ATTRIBUTE_OR_VALUE_EXISTS:
+            case INVALID_ATTRIBUTE_SYNTAX:
+            case NO_SUCH_OBJECT:
+            case ALIAS_PROBLEM:
+            case INVALID_DN_SYNTAX:
+            case ALIAS_DEREFERENCING_PROBLEM:
+            case INAPPROPRIATE_AUTHENTICATION:
+            case INVALID_CREDENTIALS:
+            case INSUFFICIENT_ACCESS_RIGHTS:
+            case BUSY:
+            case UNAVAILABLE:
+            case UNWILLING_TO_PERFORM:
+            case LOOP_DETECT:
+            case NAMING_VIOLATION:
+            case OBJECT_CLASS_VIOLATION:
+            case NOT_ALLOWED_ON_NON_LEAF:
+            case NOT_ALLOWED_ON_RDN:
+            case ENTRY_ALREADY_EXISTS:
+            case AFFECTS_MULTIPLE_DSAS:
                 ldapResult.setResultCode( resultCode );
                 break;
 
             default:
                 log.warn( "The resultCode " + resultCode + " is unknown." );
-                ldapResult.setResultCode( LdapResultEnum.OTHER );
+                ldapResult.setResultCode( ResultCodeEnum.OTHER );
         }
 
         if ( IS_DEBUG )
         {
-            log.debug( "The result code is set to " + LdapResultEnum.errorCode( resultCode ) );
+            log.debug( "The result code is set to " + resultCode );
         }
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAttributeInUseException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAttributeInUseException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAttributeInUseException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAttributeInUseException.java Mon Nov 20 11:29:41 2006
@@ -63,6 +63,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.ATTRIBUTEORVALUEEXISTS;
+        return ResultCodeEnum.ATTRIBUTE_OR_VALUE_EXISTS;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationException.java Mon Nov 20 11:29:41 2006
@@ -59,6 +59,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.INVALIDCREDENTIALS;
+        return ResultCodeEnum.INVALID_CREDENTIALS;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationNotSupportedException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationNotSupportedException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationNotSupportedException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapAuthenticationNotSupportedException.java Mon Nov 20 11:29:41 2006
@@ -113,17 +113,20 @@
      */
     private void checkResultCode()
     {
-        switch ( resultCode.getValue() )
+        switch ( resultCode )
         {
-            case ( ResultCodeEnum.INAPPROPRIATEAUTHENTICATION_VAL  ):
+            case INAPPROPRIATE_AUTHENTICATION :
                 break;
-            case ( ResultCodeEnum.CONFIDENTIALITYREQUIRED_VAL  ):
+                
+            case CONFIDENTIALITY_REQUIRED :
                 break;
-            case ( ResultCodeEnum.AUTHMETHODNOTSUPPORTED_VAL  ):
+                
+            case AUTH_METHOD_NOT_SUPPORTED :
                 break;
+                
             default:
                 throw new IllegalArgumentException( "Unexceptable result code " + "for this exception type: "
-                    + resultCode.getName() );
+                    + resultCode );
         }
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapContextNotEmptyException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapContextNotEmptyException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapContextNotEmptyException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapContextNotEmptyException.java Mon Nov 20 11:29:41 2006
@@ -55,6 +55,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.NOTALLOWEDONNONLEAF;
+        return ResultCodeEnum.NOT_ALLOWED_ON_NON_LEAF;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeIdentifierException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeIdentifierException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeIdentifierException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeIdentifierException.java Mon Nov 20 11:29:41 2006
@@ -64,6 +64,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.UNDEFINEDATTRIBUTETYPE;
+        return ResultCodeEnum.UNDEFINED_ATTRIBUTE_TYPE;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeValueException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeValueException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeValueException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapInvalidAttributeValueException.java Mon Nov 20 11:29:41 2006
@@ -57,15 +57,17 @@
     {
         super();
 
-        switch ( resultCode.getValue() )
+        switch ( resultCode )
         {
-            case ( ResultCodeEnum.CONSTRAINTVIOLATION_VAL  ):
+            case CONSTRAINT_VIOLATION :
                 break;
-            case ( ResultCodeEnum.INVALIDATTRIBUTESYNTAX_VAL  ):
+                
+            case INVALID_ATTRIBUTE_SYNTAX :
                 break;
+                
             default:
 
-                throw new IllegalArgumentException( resultCode.getName() + " is not an acceptable result code." );
+                throw new IllegalArgumentException( resultCode + " is not an acceptable result code." );
         }
 
         this.resultCode = resultCode;

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameAlreadyBoundException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameAlreadyBoundException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameAlreadyBoundException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameAlreadyBoundException.java Mon Nov 20 11:29:41 2006
@@ -61,6 +61,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.ENTRYALREADYEXISTS;
+        return ResultCodeEnum.ENTRY_ALREADY_EXISTS;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameNotFoundException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameNotFoundException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameNotFoundException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNameNotFoundException.java Mon Nov 20 11:29:41 2006
@@ -60,6 +60,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.NOSUCHOBJECT;
+        return ResultCodeEnum.NO_SUCH_OBJECT;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoPermissionException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoPermissionException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoPermissionException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoPermissionException.java Mon Nov 20 11:29:41 2006
@@ -68,6 +68,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.INSUFFICIENTACCESSRIGHTS;
+        return ResultCodeEnum.INSUFFICIENT_ACCESS_RIGHTS;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoSuchAttributeException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoSuchAttributeException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoSuchAttributeException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapNoSuchAttributeException.java Mon Nov 20 11:29:41 2006
@@ -63,6 +63,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.NOSUCHATTRIBUTE;
+        return ResultCodeEnum.NO_SUCH_ATTRIBUTE;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSchemaViolationException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSchemaViolationException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSchemaViolationException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSchemaViolationException.java Mon Nov 20 11:29:41 2006
@@ -58,23 +58,23 @@
     {
         super();
 
-        switch ( resultCode.getValue() )
+        switch ( resultCode )
         {
-            case ( ResultCodeEnum.OBJECTCLASSVIOLATION_VAL  ):
+            case OBJECT_CLASS_VIOLATION :
 
                 break;
 
-            case ( ResultCodeEnum.NOTALLOWEDONRDN_VAL  ):
+            case NOT_ALLOWED_ON_RDN :
 
                 break;
 
-            case ( ResultCodeEnum.OBJECTCLASSMODSPROHIBITED_VAL  ):
+            case OBJECT_CLASS_MODS_PROHIBITED :
 
                 break;
 
             default:
 
-                throw new IllegalArgumentException( resultCode.getName() + " is not an acceptable result code." );
+                throw new IllegalArgumentException( resultCode + " is not an acceptable result code." );
         }
 
         this.resultCode = resultCode;

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSizeLimitExceededException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSizeLimitExceededException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSizeLimitExceededException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapSizeLimitExceededException.java Mon Nov 20 11:29:41 2006
@@ -67,6 +67,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.SIZELIMITEXCEEDED;
+        return ResultCodeEnum.SIZE_LIMIT_EXCEEDED;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapTimeLimitExceededException.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapTimeLimitExceededException.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapTimeLimitExceededException.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/exception/LdapTimeLimitExceededException.java Mon Nov 20 11:29:41 2006
@@ -67,6 +67,6 @@
      */
     public ResultCodeEnum getResultCode()
     {
-        return ResultCodeEnum.TIMELIMITEXCEEDED;
+        return ResultCodeEnum.TIME_LIMIT_EXCEEDED;
     }
 }

Modified: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java
URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java?view=diff&rev=477298&r1=477297&r2=477298
==============================================================================
--- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java (original)
+++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapResultImpl.java Mon Nov 20 11:29:41 2006
@@ -265,201 +265,247 @@
         sb.append( "        Ldap Result\n" );
         sb.append( "            Result code : (" ).append( resultCode ).append( ')' );
 
-        if ( resultCode != null )
+        switch ( resultCode )
         {
 
-            if ( resultCode.getValue() == ResultCodeEnum.SUCCESS_VAL )
-            {
+            case SUCCESS :
                 sb.append( " success\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.OPERATIONSERROR_VAL )
-            {
+                break;
+
+            case OPERATIONS_ERROR :
                 sb.append( " operationsError\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.PROTOCOLERROR_VAL )
-            {
+                break;
+
+            case PROTOCOL_ERROR :
                 sb.append( " protocolError\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.TIMELIMITEXCEEDED_VAL )
-            {
+                break;
+
+            case TIME_LIMIT_EXCEEDED :
                 sb.append( " timeLimitExceeded\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.SIZELIMITEXCEEDED_VAL )
-            {
+                break;
+
+            case SIZE_LIMIT_EXCEEDED :
                 sb.append( " sizeLimitExceeded\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.COMPAREFALSE_VAL )
-            {
+                break;
+
+            case COMPARE_FALSE :
                 sb.append( " compareFalse\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.COMPARETRUE_VAL )
-            {
+                break;
+
+            case COMPARE_TRUE :
                 sb.append( " compareTrue\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.AUTHMETHODNOTSUPPORTED_VAL )
-            {
+                break;
+
+            case AUTH_METHOD_NOT_SUPPORTED :
                 sb.append( " authMethodNotSupported\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.STRONGAUTHREQUIRED_VAL )
-            {
+                break;
+
+            case STRONG_AUTH_REQUIRED :
                 sb.append( " strongAuthRequired\n" );
-            }
-            else if ( resultCode.getValue() == 9 )
-            {
-                sb.append( " -- 9 reserved --\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.REFERRAL_VAL )
-            {
+                break;
+
+            case REFERRAL :
                 sb.append( " referral -- new\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.ADMINLIMITEXCEEDED_VAL )
-            {
+                break;
+
+            case ADMIN_LIMIT_EXCEEDED :
                 sb.append( " adminLimitExceeded -- new\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.UNAVAILABLECRITICALEXTENSION_VAL )
-            {
+                break;
+
+            case UNAVAILABLE_CRITICAL_EXTENSION :
                 sb.append( " unavailableCriticalExtension -- new\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.CONFIDENTIALITYREQUIRED_VAL )
-            {
+                break;
+
+            case CONFIDENTIALITY_REQUIRED :
                 sb.append( " confidentialityRequired -- new\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.SASLBINDINPROGRESS_VAL )
-            {
+                break;
+
+            case SASL_BIND_IN_PROGRESS :
                 sb.append( " saslBindInProgress -- new\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.NOSUCHATTRIBUTE_VAL )
-            {
+                break;
+
+            case NO_SUCH_ATTRIBUTE :
                 sb.append( " noSuchAttribute\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.UNDEFINEDATTRIBUTETYPE_VAL )
-            {
+                break;
+
+            case UNDEFINED_ATTRIBUTE_TYPE :
                 sb.append( " undefinedAttributeType\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.INAPPROPRIATEMATCHING_VAL )
-            {
+                break;
+
+            case INAPPROPRIATE_MATCHING :
                 sb.append( " inappropriateMatching\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.CONSTRAINTVIOLATION_VAL )
-            {
+                break;
+
+            case CONSTRAINT_VIOLATION :
                 sb.append( " constraintViolation\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.ATTRIBUTEORVALUEEXISTS_VAL )
-            {
+                break;
+
+            case ATTRIBUTE_OR_VALUE_EXISTS :
                 sb.append( " attributeOrValueExists\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.INVALIDATTRIBUTESYNTAX_VAL )
-            {
+                break;
+
+            case INVALID_ATTRIBUTE_SYNTAX :
                 sb.append( " invalidAttributeSyntax\n" );
-            }
-            else if ( ( resultCode.getValue() >= 22 ) && ( resultCode.getValue() <= 31 ) )
-            {
-                sb.append( " -- 22-31 unused --\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.NOSUCHOBJECT_VAL )
-            {
+                break;
+
+            case NO_SUCH_OBJECT :
                 sb.append( " noSuchObject\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.ALIASPROBLEM_VAL )
-            {
+                break;
+
+            case ALIAS_PROBLEM :
                 sb.append( " aliasProblem\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.INVALIDDNSYNTAX_VAL )
-            {
+                break;
+
+            case INVALID_DN_SYNTAX :
                 sb.append( " invalidDNSyntax\n" );
-            }
-            else if ( resultCode.getValue() == 35 )
-            {
-                sb.append( " -- 35 reserved for undefined isLeaf --\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM_VAL )
-            {
+                break;
+
+            case ALIAS_DEREFERENCING_PROBLEM :
                 sb.append( " aliasDereferencingProblem\n" );
-            }
-            else if ( ( resultCode.getValue() >= 37 ) && ( resultCode.getValue() <= 47 ) )
-            {
-                sb.append( " -- 37-47 unused --\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.INAPPROPRIATEAUTHENTICATION_VAL )
-            {
+                break;
+
+            case INAPPROPRIATE_AUTHENTICATION :
                 sb.append( " inappropriateAuthentication\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.INVALIDCREDENTIALS_VAL )
-            {
+                break;
+
+            case INVALID_CREDENTIALS :
                 sb.append( " invalidCredentials\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.INSUFFICIENTACCESSRIGHTS_VAL )
-            {
+                break;
+
+            case INSUFFICIENT_ACCESS_RIGHTS :
                 sb.append( " insufficientAccessRights\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.BUSY_VAL )
-            {
+                break;
+
+            case BUSY :
                 sb.append( " busy\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.UNAVAILABLE_VAL )
-            {
+                break;
+
+            case UNAVAILABLE :
                 sb.append( " unavailable\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.UNWILLINGTOPERFORM_VAL )
-            {
+                break;
+
+            case UNWILLING_TO_PERFORM :
                 sb.append( " unwillingToPerform\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.LOOPDETECT_VAL )
-            {
+                break;
+
+            case LOOP_DETECT :
                 sb.append( " loopDetect\n" );
-            }
-            else if ( ( resultCode.getValue() >= 55 ) && ( resultCode.getValue() <= 63 ) )
-            {
-                sb.append( " -- 55-63 unused --\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.NAMINGVIOLATION_VAL )
-            {
+                break;
+
+            case NAMING_VIOLATION :
                 sb.append( " namingViolation\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.OBJECTCLASSVIOLATION_VAL )
-            {
+                break;
+
+            case OBJECT_CLASS_VIOLATION :
                 sb.append( " objectClassViolation\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.NOTALLOWEDONNONLEAF_VAL )
-            {
+                break;
+
+            case NOT_ALLOWED_ON_NON_LEAF :
                 sb.append( " notAllowedOnNonLeaf\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.NOTALLOWEDONRDN_VAL )
-            {
+                break;
+
+            case NOT_ALLOWED_ON_RDN :
                 sb.append( " notAllowedOnRDN\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.ENTRYALREADYEXISTS_VAL )
-            {
+                break;
+
+            case ENTRY_ALREADY_EXISTS :
                 sb.append( " entryAlreadyExists\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.OBJECTCLASSMODSPROHIBITED_VAL )
-            {
+                break;
+
+            case OBJECT_CLASS_MODS_PROHIBITED :
                 sb.append( " objectClassModsProhibited\n" );
-            }
-            else if ( resultCode.getValue() == 70 )
-            {
-                sb.append( " -- 70 reserved for CLDAP --\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.AFFECTSMULTIPLEDSAS_VAL )
-            {
+                break;
+
+            case AFFECTS_MULTIPLE_DSAS :
                 sb.append( " affectsMultipleDSAs -- new\n" );
-            }
-            else if ( ( resultCode.getValue() >= 72 ) && ( resultCode.getValue() <= 79 ) )
-            {
-                sb.append( " -- 72-79 unused --\n" );
-            }
-            else if ( resultCode.getValue() == ResultCodeEnum.OTHER_VAL )
-            {
+                break;
+
+            case OTHER :
                 sb.append( " other\n" );
-            }
-            else if ( ( resultCode.getValue() >= 81 ) && ( resultCode.getValue() <= 90 ) )
-            {
-                sb.append( " -- 81-90 reserved for APIs --" );
-            }
-            else
-            {
-                sb.append( "Unknown error code : " ).append( resultCode );
-            }
+                break;
+                
+            default :
+                switch ( resultCode.getResultCode() )
+                {
+                    case 9 :
+                        sb.append( " -- 9 reserved --\n" );
+                        break;
+                        
+                    case 22 :
+                    case 23:
+                    case 24 :
+                    case 25 :
+                    case 26 :
+                    case 27 :
+                    case 28 :
+                    case 29 :
+                    case 30 :
+                    case 31 :
+                        sb.append( " -- 22-31 unused --\n" );
+                        break;
+
+                    case 35 :
+                        sb.append( " -- 35 reserved for undefined isLeaf --\n" );
+                        break;
+                                
+                    case 37 :
+                    case 38 :
+                    case 39 :
+                    case 40 :
+                    case 41 :
+                    case 42 :
+                    case 43 :
+                    case 44 :
+                    case 45 :
+                    case 46 :
+                    case 47 :
+                        sb.append( " -- 37-47 unused --\n" );
+                        break;
+
+                    case 55 :
+                    case 56 :
+                    case 57 :
+                    case 58 :
+                    case 59 :
+                    case 60 :
+                    case 61 :
+                    case 62 :
+                    case 63 :
+                        sb.append( " -- 55-63 unused --\n" );
+                        break;
+
+                    case 70 :
+                        sb.append( " -- 70 reserved for CLDAP --\n" );
+                        break;
+
+                    case 72 :
+                    case 73 :
+                    case 74 :
+                    case 75 :
+                    case 76 :
+                    case 77 :
+                    case 78 :
+                    case 79 :
+                        sb.append( " -- 72-79 unused --\n" );
+                        break;
+
+                    case 81 :
+                    case 82 :
+                    case 83 :
+                    case 84 :
+                    case 85 :
+                    case 86 :
+                    case 87 :
+                    case 88 :
+                    case 89 :
+                    case 90 :
+                        sb.append( " -- 81-90 reserved for APIs --" );
+                        break;
+                        
+                    default :
+                        sb.append( "Unknown error code : " ).append( resultCode );
+                        break;
+                }
         }
 
         sb.append( "            Matched DN : '" ).append( matchedDn ).append( "'\n" );



Mime
View raw message