You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/04/23 09:36:27 UTC

svn commit: r164350 - in /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars: BindRequestGrammar.java BindResponseGrammar.java LdapControlGrammar.java LdapMessageGrammar.java LdapResultGrammar.java

Author: elecharny
Date: Sat Apr 23 00:36:27 2005
New Revision: 164350

URL: http://svn.apache.org/viewcvs?rev=164350&view=rev
Log:
Modified this class to use LdapStatesEnum instead of StatesEnum

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java?rev=164350&r1=164349&r2=164350&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java Sat Apr 23 00:36:27 2005
@@ -22,7 +22,6 @@
 import org.apache.asn1.ber.grammar.GrammarAction;
 import org.apache.asn1.ber.grammar.GrammarTransition;
 import org.apache.asn1.ber.grammar.IGrammar;
-import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ber.tlv.Value;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
@@ -86,7 +85,7 @@
         statesEnum = LdapStatesEnum.getInstance();
 
         // We have 17 differents states, so 16 transitions between states.
-        super.transitions = new GrammarTransition[StatesEnum.LAST_BIND_REQUEST_STATE][256];
+        super.transitions = new GrammarTransition[LdapStatesEnum.LAST_BIND_REQUEST_STATE][256];
 
         //============================================================================================
         // protocolOp : Bind Request
@@ -94,11 +93,11 @@
         // We have to allocate a BindRequestPOJO
         // LdapMessage ::= ... BindRequest ...
         // BindRequest ::= [APPLICATION 0] SEQUENCE { ... (Length)
-        super.transitions[StatesEnum.BIND_REQUEST_TAG][0x60]    = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_TAG, StatesEnum.BIND_REQUEST_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_TAG][0x60]    = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_TAG, LdapStatesEnum.BIND_REQUEST_LENGTH, null );
 
-        super.transitions[StatesEnum.BIND_REQUEST_LENGTH][0x60] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_LENGTH, StatesEnum.BIND_REQUEST_VALUE,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_LENGTH][0x60] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_LENGTH, LdapStatesEnum.BIND_REQUEST_VALUE,
                 new GrammarAction( "Init BindRequest" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -143,18 +142,18 @@
         // LdapMessage ::= ... BindRequest ...
         // BindRequest ::= [APPLICATION 0] SEQUENCE { ... (Value)
         // Nothing to do, the Value is empty, this is a constructed TLV. We now can swith to the BindRequest Grammar
-        super.transitions[StatesEnum.BIND_REQUEST_VALUE][0x60] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_VALUE, StatesEnum.BIND_REQUEST_VERSION_TAG, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_VALUE][0x60] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_VALUE, LdapStatesEnum.BIND_REQUEST_VERSION_TAG, null );
 
         // BindRequest ::= ... version INTEGER (1 .. 127 ), ... (Tag)
         // Nothing to do.
-        super.transitions[StatesEnum.BIND_REQUEST_VERSION_TAG][0x02] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_VERSION_TAG, StatesEnum.BIND_REQUEST_VERSION_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_VERSION_TAG][0x02] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_VERSION_TAG, LdapStatesEnum.BIND_REQUEST_VERSION_LENGTH, null );
 
         // BindRequest ::= ... version INTEGER (1 .. 127 ), ... (Length)
         // Checks the length
-        super.transitions[StatesEnum.BIND_REQUEST_VERSION_LENGTH][0x02] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_VERSION_LENGTH, StatesEnum.BIND_REQUEST_VERSION_VALUE,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_VERSION_LENGTH][0x02] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_VERSION_LENGTH, LdapStatesEnum.BIND_REQUEST_VERSION_VALUE,
                 new GrammarAction( "Store version" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -171,8 +170,8 @@
 
         // BindRequest ::= ... version INTEGER (1 .. 127 ), ... (value)
         // Checks that the Version is in [1, 127]
-        super.transitions[StatesEnum.BIND_REQUEST_VERSION_VALUE][0x02] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_VERSION_VALUE, StatesEnum.BIND_REQUEST_NAME_TAG,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_VERSION_VALUE][0x02] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_VERSION_VALUE, LdapStatesEnum.BIND_REQUEST_NAME_TAG,
                 new GrammarAction( "Store version" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -199,13 +198,13 @@
 
         // BindRequest ::= ... name LDAPDN, ... (Tag)
         // Nothing to do. The tag is supposed to be 0x04
-        super.transitions[StatesEnum.BIND_REQUEST_NAME_TAG][0x04] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_NAME_TAG, StatesEnum.BIND_REQUEST_NAME_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_NAME_TAG][0x04] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_NAME_TAG, LdapStatesEnum.BIND_REQUEST_NAME_LENGTH, null );
 
         // BindRequest ::= ... name LDAPDN, ... (Length)
         // We just check the length.
-        super.transitions[StatesEnum.BIND_REQUEST_NAME_LENGTH][0x04] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_NAME_LENGTH, StatesEnum.BIND_REQUEST_NAME_VALUE,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_NAME_LENGTH][0x04] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_NAME_LENGTH, LdapStatesEnum.BIND_REQUEST_NAME_VALUE,
                 new GrammarAction( "Check Bind Name Length" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -234,9 +233,9 @@
 
         // BindRequest ::= ... name LDAPDN, ... (Value)
         // We have to store the name
-        super.transitions[StatesEnum.BIND_REQUEST_NAME_VALUE][0x04] = new GrammarTransition(
-                StatesEnum.BIND_REQUEST_NAME_VALUE,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_NAME_VALUE][0x04] = new GrammarTransition(
+                LdapStatesEnum.BIND_REQUEST_NAME_VALUE,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG,
                 new GrammarAction( "Store Bind Name value" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -264,16 +263,16 @@
         // If it's 0x80, it is a SimpleAuthentication.
         //--------------------------------------------------------------------------------------------
         // Nothing to do.
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG][( 0x80 & 0x00FF )] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG][( 0x80 & 0x00FF )] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_LENGTH, null );
 
         // AuthenticationChoice ::= CHOICE {
         //        simple         [0] OCTET STRING, (Length)
         // We just have to check the length, and to allocate an authentication POJO
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_LENGTH][( 0x80 & 0x00FF )] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_LENGTH,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_VALUE,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_LENGTH][( 0x80 & 0x00FF )] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_LENGTH,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_VALUE,
                 new GrammarAction( "Check simple authentication length" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -322,9 +321,9 @@
         //        simple         [0] OCTET STRING, (Value)
         // We have to create an Authentication POJO to store the credentials.
         // The nextState is GRAMMAR_END
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_VALUE][( 0x80 & 0x00FF )] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_VALUE,
-                StatesEnum.GRAMMAR_END,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_VALUE][( 0x80 & 0x00FF )] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_SIMPLE_VALUE,
+                LdapStatesEnum.GRAMMAR_END,
                 new GrammarAction( "Store Bind Simple Authentication value" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -359,9 +358,9 @@
         // AuthenticationChoice ::= CHOICE {
         //        sasl         [3] saslCredentials, (Tag)
         // Nothing to do. In fact, 0x83 is the mechanism tag. 
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG][( 0x83 & 0x00FF )] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG][( 0x83 & 0x00FF )] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CHOICE_TAG,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_LENGTH, null );
 
         // AuthenticationChoice ::= CHOICE {
         //        sasl         [3] saslCredentials }
@@ -370,9 +369,9 @@
         //        mechanism     LDAPSTRING,  (Length)
         //		  ...
         // We just have to check the length.
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_LENGTH][( 0x83 & 0x00FF )] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_LENGTH,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_VALUE,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_LENGTH][( 0x83 & 0x00FF )] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_LENGTH,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_VALUE,
                 new GrammarAction( "Check sasl authentication mechanism length" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -423,9 +422,9 @@
         //        mechanism     LDAPSTRING,  (Value)
         //		  ...
         // We have to store the mechanism.
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_VALUE][( 0x83 & 0x00FF )] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_VALUE,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_VALUE][( 0x83 & 0x00FF )] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_MECHANISM_VALUE,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG,
                 new GrammarAction( "Create Bind sasl Authentication POJO" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -461,22 +460,22 @@
         //	- any other value is an error.
         //
         // It's a credential if it's 0x04
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG][0x04] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG][0x04] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_LENGTH, null );
 
         // It's a control if it's 0x80
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG][(0x80 & 0x00FF)] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG][(0x80 & 0x00FF)] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_TAG,
+                LdapStatesEnum.GRAMMAR_END, null );
         
         // SaslCredentials ::= SEQUENCE {
         //        ...
         //        credentials     OCTET STRING OPTIONAL } (Length)
         // We just have to check the length
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_LENGTH][0x04] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_LENGTH,
-                StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_VALUE,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_LENGTH][0x04] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_LENGTH,
+                LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_VALUE,
                 new GrammarAction( "Check sasl authentication credentials length" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -515,9 +514,9 @@
         // - or nothing at all (end of the BindRequest).
         // We just have to transit to the first case, which will accept or not the transition.
         // This is done by transiting to the GRAMMAR_END state
-        super.transitions[StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_VALUE][0x04] =
-            new GrammarTransition( StatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_VALUE,
-                StatesEnum.GRAMMAR_END,
+        super.transitions[LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_VALUE][0x04] =
+            new GrammarTransition( LdapStatesEnum.BIND_REQUEST_AUTHENTICATION_CREDENTIALS_VALUE,
+                LdapStatesEnum.GRAMMAR_END,
                 new GrammarAction( "Store Bind sasl Authentication credentials value" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java?rev=164350&r1=164349&r2=164350&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java Sat Apr 23 00:36:27 2005
@@ -22,7 +22,6 @@
 import org.apache.asn1.ber.grammar.GrammarAction;
 import org.apache.asn1.ber.grammar.GrammarTransition;
 import org.apache.asn1.ber.grammar.IGrammar;
-import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
 import org.apache.asn1.ldap.pojo.BindResponsePOJO;
@@ -65,7 +64,7 @@
         statesEnum = LdapStatesEnum.getInstance();
 
         // We have 17 differents states, so 16 transitions between states.
-        super.transitions = new GrammarTransition[StatesEnum.LAST_LDAP_STATE][256];
+        super.transitions = new GrammarTransition[LdapStatesEnum.LAST_LDAP_STATE][256];
 
         //============================================================================================
         // BindResponse Message
@@ -74,14 +73,14 @@
         //     COMPONENTS OF LDAPResult,
         //     ...
         // Nothing to do
-        super.transitions[StatesEnum.BIND_RESPONSE_TAG][0x61] = new GrammarTransition(
-                StatesEnum.BIND_RESPONSE_TAG, StatesEnum.BIND_RESPONSE_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_TAG][0x61] = new GrammarTransition(
+                LdapStatesEnum.BIND_RESPONSE_TAG, LdapStatesEnum.BIND_RESPONSE_LENGTH, null );
 
         // We have to allocate a BindRequestPOJO
         // LdapMessage ::= ... BindResponse ...
         // BindResponse ::= [APPLICATION 1] SEQUENCE { ... (Length)
-        super.transitions[StatesEnum.BIND_RESPONSE_LENGTH][0x61] = new GrammarTransition(
-                StatesEnum.BIND_RESPONSE_LENGTH, StatesEnum.BIND_RESPONSE_VALUE,
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_LENGTH][0x61] = new GrammarTransition(
+                LdapStatesEnum.BIND_RESPONSE_LENGTH, LdapStatesEnum.BIND_RESPONSE_VALUE,
                 new GrammarAction( "Init BindReponse" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -125,36 +124,36 @@
         // LdapMessage ::= ... BindResponse ...
         // BindResponse ::= [APPLICATION 1] SEQUENCE { ... (Value)
         // The first Tag will be the LDAPResult Tag (0x0A). So we have to switch the grammar.
-        super.transitions[StatesEnum.BIND_RESPONSE_VALUE][0x61] = new GrammarTransition(
-                StatesEnum.BIND_RESPONSE_VALUE, StatesEnum.BIND_RESPONSE_LDAP_RESULT, null );
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_VALUE][0x61] = new GrammarTransition(
+                LdapStatesEnum.BIND_RESPONSE_VALUE, LdapStatesEnum.BIND_RESPONSE_LDAP_RESULT, null );
 
         // LdapMessage ::= ... BindResponse ...
         // BindResponse ::= [APPLICATION 1] SEQUENCE { ... (Value)
         // The first Tag will be the LDAPResult Tag (0x0A). So we have to switch the grammar.
-        super.transitions[StatesEnum.BIND_RESPONSE_LDAP_RESULT][0x0A] = new GrammarTransition(
-                StatesEnum.BIND_RESPONSE_LDAP_RESULT, StatesEnum.LDAP_RESULT_GRAMMAR_SWITCH, null );
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_LDAP_RESULT][0x0A] = new GrammarTransition(
+                LdapStatesEnum.BIND_RESPONSE_LDAP_RESULT, LdapStatesEnum.LDAP_RESULT_GRAMMAR_SWITCH, null );
 
         // BindResponse ::= APPLICATION 1] SEQUENCE {
         //     ...
         //    serverSaslCreds   [7] OCTET STRING OPTIONAL } (Tag)
         // It's a server sasl credential if the tag is 0x87
         // Otherwise, if the tag is 0x80, it's a control
-        super.transitions[StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG][0x87] =
-            new GrammarTransition( StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG,
-                StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_LENGTH, null );
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG][0x87] =
+            new GrammarTransition( LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG,
+                    LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_LENGTH, null );
 
         // It's a control if it's 0x80. We have to quit this grammar.
-        super.transitions[StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG][( 0x80 & 0x00FF )] =
-            new GrammarTransition( StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG][( 0x80 & 0x00FF )] =
+            new GrammarTransition( LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_TAG,
+                    LdapStatesEnum.GRAMMAR_END, null );
 
         // BindResponse ::= APPLICATION 1] SEQUENCE {
         //     ...
         //    serverSaslCreds   [7] OCTET STRING OPTIONAL } (Length)
         // We have to check the length
-        super.transitions[StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_LENGTH][0x87] =
-            new GrammarTransition( StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_LENGTH,
-                StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_VALUE,
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_LENGTH][0x87] =
+            new GrammarTransition( LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_LENGTH,
+                LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_VALUE,
                 new GrammarAction( "Check server sasl credentials length" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -190,9 +189,9 @@
         // - nothing at all (end of the BindResponse).
         // We just have to transit to the first case, which will accept or not the transition.
         // This is done by transiting to the GRAMMAR_END state
-        super.transitions[StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_VALUE][0x87] =
-            new GrammarTransition( StatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_VALUE,
-                StatesEnum.GRAMMAR_END,
+        super.transitions[LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_VALUE][0x87] =
+            new GrammarTransition( LdapStatesEnum.BIND_RESPONSE_SERVER_SASL_CREDS_VALUE,
+                LdapStatesEnum.GRAMMAR_END,
                 new GrammarAction( "Store server sasl credentials value" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java?rev=164350&r1=164349&r2=164350&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java Sat Apr 23 00:36:27 2005
@@ -19,7 +19,6 @@
 import org.apache.asn1.ber.grammar.AbstractGrammar;
 import org.apache.asn1.ber.grammar.GrammarTransition;
 import org.apache.asn1.ber.grammar.IGrammar;
-import org.apache.asn1.ber.grammar.StatesEnum;
 
 import org.apache.log4j.Logger;
 
@@ -64,7 +63,7 @@
         name = LdapControlGrammar.class.getName();
         statesEnum = LdapStatesEnum.getInstance();
 
-        super.transitions = new GrammarTransition[StatesEnum.CONTROL_LAST_STATE][256];
+        super.transitions = new GrammarTransition[LdapStatesEnum.CONTROL_LAST_STATE][256];
 
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java?rev=164350&r1=164349&r2=164350&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java Sat Apr 23 00:36:27 2005
@@ -22,7 +22,6 @@
 import org.apache.asn1.ber.grammar.GrammarAction;
 import org.apache.asn1.ber.grammar.GrammarTransition;
 import org.apache.asn1.ber.grammar.IGrammar;
-import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ber.tlv.Value;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
@@ -76,15 +75,15 @@
         statesEnum = LdapStatesEnum.getInstance();
 
         // We have 9 differents states, so 8 transitions between states.
-        super.transitions = new GrammarTransition[StatesEnum.LAST_LDAP_MESSAGE_STATE][256];
+        super.transitions = new GrammarTransition[LdapStatesEnum.LAST_LDAP_MESSAGE_STATE][256];
 
         //============================================================================================
         // LdapMessage 
         //============================================================================================
         // LDAPMessage --> SEQUENCE { ... (Tag)
         // We have a LDAPMessage, and the tag must be 0x30
-        super.transitions[StatesEnum.LDAP_MESSAGE_TAG][0x30] = new GrammarTransition( StatesEnum.LDAP_MESSAGE_TAG,
-                StatesEnum.LDAP_MESSAGE_LENGTH, new GrammarAction( "LdapMessage Tag" )
+        super.transitions[LdapStatesEnum.LDAP_MESSAGE_TAG][0x30] = new GrammarTransition( LdapStatesEnum.LDAP_MESSAGE_TAG,
+                LdapStatesEnum.LDAP_MESSAGE_LENGTH, new GrammarAction( "LdapMessage Tag" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
@@ -111,8 +110,8 @@
 
         // LDAPMessage --> SEQUENCE { ... (Length)
         // Ok, get the LdapMessage length
-        super.transitions[StatesEnum.LDAP_MESSAGE_LENGTH][0x30] = new GrammarTransition( StatesEnum.LDAP_MESSAGE_LENGTH,
-                StatesEnum.LDAP_MESSAGE_VALUE, new GrammarAction( "LdapMessage Length" )
+        super.transitions[LdapStatesEnum.LDAP_MESSAGE_LENGTH][0x30] = new GrammarTransition( LdapStatesEnum.LDAP_MESSAGE_LENGTH,
+                LdapStatesEnum.LDAP_MESSAGE_VALUE, new GrammarAction( "LdapMessage Length" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
@@ -129,18 +128,18 @@
         
         // LDAPMessage --> SEQUENCE { ... (Value)
         // Nothing to do, it's a constructed TLV. It's just a phantom transition ...
-        super.transitions[StatesEnum.LDAP_MESSAGE_VALUE][0x30] = new GrammarTransition( StatesEnum.LDAP_MESSAGE_VALUE, StatesEnum.LDAP_MESSAGE_ID_TAG, null);
+        super.transitions[LdapStatesEnum.LDAP_MESSAGE_VALUE][0x30] = new GrammarTransition( LdapStatesEnum.LDAP_MESSAGE_VALUE, LdapStatesEnum.LDAP_MESSAGE_ID_TAG, null);
 
         //--------------------------------------------------------------------------------------------
         // LdapMessage Message ID 
         //--------------------------------------------------------------------------------------------
         // LDAPMessage --> ... MessageId ...(Tag)
         // The tag must be 0x02. Nothing special to do.
-        super.transitions[StatesEnum.LDAP_MESSAGE_ID_TAG][0x02] = new GrammarTransition( StatesEnum.LDAP_MESSAGE_ID_TAG, StatesEnum.LDAP_MESSAGE_ID_LENGTH, null);
+        super.transitions[LdapStatesEnum.LDAP_MESSAGE_ID_TAG][0x02] = new GrammarTransition( LdapStatesEnum.LDAP_MESSAGE_ID_TAG, LdapStatesEnum.LDAP_MESSAGE_ID_LENGTH, null);
 
         // LDAPMessage --> ... MessageId ...(Length)
         // Checks the length
-        super.transitions[StatesEnum.LDAP_MESSAGE_ID_LENGTH][0x02] = new GrammarTransition( StatesEnum.LDAP_MESSAGE_ID_LENGTH, StatesEnum.LDAP_MESSAGE_ID_VALUE, 
+        super.transitions[LdapStatesEnum.LDAP_MESSAGE_ID_LENGTH][0x02] = new GrammarTransition( LdapStatesEnum.LDAP_MESSAGE_ID_LENGTH, LdapStatesEnum.LDAP_MESSAGE_ID_VALUE, 
                 new GrammarAction( "Check MessageId Length " )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -155,7 +154,7 @@
         // LDAPMessage --> ... MessageId ...(Value)
         // Checks that MessageId is in [0 .. 2147483647] and store the value in the LdapMessage POJO
         // (2147483647 = Integer.MAX_VALUE)
-        super.transitions[StatesEnum.LDAP_MESSAGE_ID_VALUE][0x02] = new GrammarTransition( StatesEnum.LDAP_MESSAGE_ID_VALUE, StatesEnum.PROTOCOL_OP_TAG,
+        super.transitions[LdapStatesEnum.LDAP_MESSAGE_ID_VALUE][0x02] = new GrammarTransition( LdapStatesEnum.LDAP_MESSAGE_ID_VALUE, LdapStatesEnum.PROTOCOL_OP_TAG,
                 new GrammarAction( "Store MessageId" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -197,7 +196,7 @@
         // LdapMessage ::= ... BindRequest ...
         // BindRequest ::= [APPLICATION 0] SEQUENCE { ... (Tag)
         // Nothing to do while the length is not checked.
-        super.transitions[StatesEnum.PROTOCOL_OP_TAG][0x60] = new GrammarTransition( StatesEnum.PROTOCOL_OP_TAG, StatesEnum.BIND_REQUEST_GRAMMAR_SWITCH, null );
+        super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x60] = new GrammarTransition( LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.BIND_REQUEST_GRAMMAR_SWITCH, null );
 
         //--------------------------------------------------------------------------------------------
         // BindResponse Message.
@@ -205,6 +204,6 @@
         // LdapMessage ::= ... BindResponse ...
         // BindResponse ::= [APPLICATION 1] SEQUENCE { ... (Tag)
         // We have to switch to the BindResponse grammar
-        super.transitions[StatesEnum.PROTOCOL_OP_TAG][0x61] = new GrammarTransition( StatesEnum.PROTOCOL_OP_TAG, StatesEnum.BIND_RESPONSE_GRAMMAR_SWITCH, null);
+        super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x61] = new GrammarTransition( LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.BIND_RESPONSE_GRAMMAR_SWITCH, null);
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java?rev=164350&r1=164349&r2=164350&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java Sat Apr 23 00:36:27 2005
@@ -22,7 +22,6 @@
 import org.apache.asn1.ber.grammar.GrammarAction;
 import org.apache.asn1.ber.grammar.GrammarTransition;
 import org.apache.asn1.ber.grammar.IGrammar;
-import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ber.tlv.Value;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
@@ -71,7 +70,7 @@
         name              = LdapResultGrammar.class.getName();
         statesEnum = LdapStatesEnum.getInstance();
 
-        super.transitions = new GrammarTransition[StatesEnum.LDAP_RESULT_LAST_STATE][256];
+        super.transitions = new GrammarTransition[LdapStatesEnum.LDAP_RESULT_LAST_STATE][256];
 
         //============================================================================================
         // LdapResult
@@ -80,14 +79,14 @@
         //    resultCode    ENUMERATED { ... (Tag)
         // We have a LDAPResult, and the tag may be 0x0A
         // Nothing to do
-        super.transitions[StatesEnum.LDAP_RESULT_CODE_TAG][0x0A] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_CODE_TAG, StatesEnum.LDAP_RESULT_CODE_LENGTH, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_TAG][0x0A] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_CODE_TAG, LdapStatesEnum.LDAP_RESULT_CODE_LENGTH, null );
 
         // LDAPResult --> SEQUENCE {
         //    resultCode    ENUMERATED { ... (Length)
         //   let's check the length
-        super.transitions[StatesEnum.LDAP_RESULT_CODE_LENGTH][0x0A] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_CODE_LENGTH, StatesEnum.LDAP_RESULT_CODE_VALUE,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_LENGTH][0x0A] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_CODE_LENGTH, LdapStatesEnum.LDAP_RESULT_CODE_VALUE,
                 new GrammarAction( "LdapResult Length" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -178,8 +177,8 @@
         //  other                        (80) },
         //  -- 81-90 reserved for APIs --
         //
-        super.transitions[StatesEnum.LDAP_RESULT_CODE_VALUE][0x0A] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_CODE_VALUE, StatesEnum.LDAP_RESULT_MATCHED_DN_TAG,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_VALUE][0x0A] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_CODE_VALUE, LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG,
                 new GrammarAction( "Store resultCode" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -258,16 +257,16 @@
         //    ...
         //    matchedDN   LDAPDN, (Tag)
         // The tag is 0x04. Nothing to do
-        super.transitions[StatesEnum.LDAP_RESULT_MATCHED_DN_TAG][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_MATCHED_DN_TAG, StatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG, LdapStatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH,
                 null );
 
         // LDAPResult --> SEQUENCE {
         //    ...
         //    matchedDN   LDAPDN, (Length)
         // The tag is 0x04. We have to check the Length
-        super.transitions[StatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH, StatesEnum.LDAP_RESULT_MATCHED_DN_VALUE,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH, LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE,
                 new GrammarAction( "Ldap Result Matched DN lentgh control" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -297,8 +296,8 @@
         //    ...
         //    matchedDN   LDAPDN, (Value)
         // We store the LDAPDN after having checked that it is valid.
-        super.transitions[StatesEnum.LDAP_RESULT_MATCHED_DN_VALUE][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_MATCHED_DN_VALUE, StatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE, LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG,
                 new GrammarAction( "Store Ldap Result matched DN" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -325,17 +324,17 @@
         //    ...
         //    errorMessage   LDAPString, (Tag)
         // The tag is 0x04. Nothing to do
-        super.transitions[StatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG,
-                StatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG,
+                LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH, null );
 
         // LDAPResult --> SEQUENCE {
         //    ...
         //    errorMessage   LDAPString, (Length)
         // The tag is 0x04. We have to check the Length
-        super.transitions[StatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH][0x04] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH,
-                StatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH][0x04] =
+            new GrammarTransition( LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH,
+                LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
                 new GrammarAction( "Ldap Result error message length control" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -365,9 +364,9 @@
         //    ...
         //    errorMessage   LDAPString, (Value)
         // Stores the value.
-        super.transitions[StatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][0x04] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
-                StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][0x04] =
+            new GrammarTransition( LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
                 new GrammarAction( "Store Ldap Result error message" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -406,33 +405,33 @@
         // the grammar.
         //
         // This is a control. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x80] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x80] =
+            new GrammarTransition( LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
+                LdapStatesEnum.GRAMMAR_END, null );
 
         // This is a referral.
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x83] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
-                StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x83] =
+            new GrammarTransition( LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
 
         // This is a serverSaslCreds. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x87] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x87] =
+            new GrammarTransition( LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
+                LdapStatesEnum.GRAMMAR_END, null );
 
         // This is a extended response. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x8A] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x8A] =
+            new GrammarTransition( LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
+                LdapStatesEnum.GRAMMAR_END, null );
 
         // LDAPResult --> SEQUENCE {
         //    ...
         //    referral   [3] Referral OPTIONAL } (Length)
         // We just check the length, and store the new expected length. As this is a sequence, we don't have any value, so we
         // transit to the REFERRAL_TAG.
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH][0x83] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH,
-                StatesEnum.LDAP_RESULT_REFERRAL_TAG,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH][0x83] =
+            new GrammarTransition( LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH,
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG,
                 new GrammarAction( "Ldap Result referrals length control" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -463,14 +462,14 @@
         // Referral ::= SEQUENCE OF LDAPURL (Tag)
         // This is a SEQUENCE, we will have at least one referral, but may be many.
         // As this is the tag, we don't have anything to do.
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_TAG][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_REFERRAL_TAG, StatesEnum.LDAP_RESULT_REFERRAL_LENGTH, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG, LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH, null );
 
         // Referral ::= SEQUENCE OF LDAPURL (Length)
         // This is a SEQUENCE, we will have at least one referral, but may be many.
         // We will check the length.
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LENGTH][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_REFERRAL_LENGTH, StatesEnum.LDAP_RESULT_REFERRAL_VALUE,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH, LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE,
                 new GrammarAction( "Ldap Result referral length control" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -501,8 +500,8 @@
         // To handle those different cases, we have to transit to a special state, which
         // will do this brancing.
         // Here, we store the referral in the ldapResult.
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_VALUE][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_REFERRAL_LENGTH, StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH, LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
                 new GrammarAction( "Store Ldap Result referral" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -534,21 +533,21 @@
         // Those different cases are handled here.
 
         // This is a referral. We have to transit to its Length state
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x04] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
-                StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x04] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
 
         // This is a control. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x80] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x80] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, LdapStatesEnum.GRAMMAR_END, null );
 
         // This is a serverSaslCreds. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x87] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x87] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, LdapStatesEnum.GRAMMAR_END, null );
 
         // This is a extended response. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x8A] = new GrammarTransition(
-                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, StatesEnum.GRAMMAR_END, null );
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x8A] = new GrammarTransition(
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, LdapStatesEnum.GRAMMAR_END, null );
 
     }