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/06/01 08:54:38 UTC

svn commit: r179365 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java

Author: elecharny
Date: Tue May 31 23:54:37 2005
New Revision: 179365

URL: http://svn.apache.org/viewcvs?rev=179365&view=rev
Log:
Added the CompareResponse states

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java?rev=179365&r1=179364&r2=179365&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapStatesEnum.java Tue May 31 23:54:37 2005
@@ -33,9 +33,6 @@
     //=========================================================================
     // LdapMessage
     //=========================================================================
-    /** Initiate the counter to 0 */
-    //private static int FIRST_LDAP_MESSAGE_STATE = 0;
-
     /** LDAPMessage Tag */
     public static int LDAP_MESSAGE_TAG = 0;
 
@@ -71,9 +68,6 @@
     //=========================================================================
     // BindRequest 
     //=========================================================================
-    /** The bind request init state */
-    //private static int FIRST_BIND_REQUEST_STATE = 0;
-
     /** The BindRequest Tag */
     public static int BIND_REQUEST_TAG = 0;
 
@@ -107,9 +101,6 @@
     public static int BIND_REQUEST_AUTHENTICATION_CHOICE_TAG = 9;
 
     // Authentication simple --------------------------------------------------
-    /** Authentication Simple Tag */
-    //public static int BIND_REQUEST_AUTHENTICATION_SIMPLE_TAG = BIND_REQUEST_STATE++;
-
     /** Authentication Simple Length */
     public static int BIND_REQUEST_AUTHENTICATION_SIMPLE_LENGTH = 10;
 
@@ -117,9 +108,6 @@
     public static int BIND_REQUEST_AUTHENTICATION_SIMPLE_VALUE = 11;
 
     // Authentication sasl ----------------------------------------------------
-    /** Authentication Sasl Tag */
-    //public static int BIND_AUTHENTICATION_SASL_TAG = INIT_STATE++;
-
     /** Authentication Sasl Length */
     public static int BIND_REQUEST_AUTHENTICATION_SASL_LENGTH = 12;
 
@@ -152,9 +140,6 @@
     //=========================================================================
     // UnBindRequest 
     //=========================================================================
-    /** The unbind request init state */
-    //private static int FIRST_UNBIND_REQUEST_STATE = 0;
-
     /** The UnBindRequest Tag */
     public static int UNBIND_REQUEST_TAG = 0;
 
@@ -167,9 +152,6 @@
     //=========================================================================
     // AbandonRequest 
     //=========================================================================
-    /** The abandon request init state */
-    //private static int FIRST_ABANDON_REQUEST_STATE = 0;
-
     /** The abandon request Tag */
     public static int ABANDON_REQUEST_MESSAGE_ID_TAG = 0;
 
@@ -185,9 +167,6 @@
     //=========================================================================
     // Controls 
     //=========================================================================
-    /** The ldap control init state */
-    //private static int FIRST_LDAP_CONTROL_STATE = 0;
-
     /** Controls Tag */
     public static int CONTROLS_TAG = 1;
 
@@ -243,9 +222,6 @@
     //=========================================================================
     // BindResponse
     //=========================================================================
-    /** The bind response init state */
-    //private static int FIRST_BIND_RESPONSE_STATE = 0;
-
     /**  Bind Response Tag */
     public static int BIND_RESPONSE_TAG = 0;
 
@@ -273,9 +249,6 @@
     //=========================================================================
     // AddResponse 
     //=========================================================================
-    /** The add response init state */
-    //private static int FIRST_ADD_RESPONSE_STATE = 0;
-
     /**  Add Response Tag */
     public static int ADD_RESPONSE_TAG = 0;
 
@@ -292,12 +265,26 @@
     public static int LAST_ADD_RESPONSE_STATE = 4;
 
     //=========================================================================
-    // LdapResult grammar states 
+    // CompareResponse 
     //=========================================================================
-    /** The ldap result init state */
-    //private static int FIRST_LDAP_RESULT_STATE = 0;
+    /**  Compare Response Tag */
+    public static int COMPARE_RESPONSE_TAG = 0;
+
+    /**  Compare Response Length */
+    public static int COMPARE_RESPONSE_LENGTH = 1;
+
+    /**  Compare Response Value */
+    public static int COMPARE_RESPONSE_VALUE = 2;
+
+    /**  Compare Response Ldap Result (we will switch the grammar here) */
+    public static int COMPARE_RESPONSE_LDAP_RESULT = 3;
+
+    /** Last state */
+    public static int LAST_COMPARE_RESPONSE_STATE = 4;
 
-    // LdapResult Code --------------------------------------------------------
+    //=========================================================================
+    // LdapResult grammar states 
+    //=========================================================================
     /** LdapResult Code Tag */
     public static int LDAP_RESULT_CODE_TAG = 0;
 
@@ -401,6 +388,12 @@
     /** AddRequest number */
     public static final int ADD_RESPONSE_GRAMMAR = 7;
     
+    /** AddRequest Grammar */
+    public static final int COMPARE_RESPONSE_GRAMMAR_SWITCH = 0x0900;
+
+    /** AddRequest number */
+    public static final int COMPARE_RESPONSE_GRAMMAR = 8;
+    
     /** The total number of grammars used */
     public static final int NB_GRAMMARS = 20;
 
@@ -418,7 +411,8 @@
             "BIND_RESPONSE_GRAMMAR_SWITCH",
             "UNBIND_REQUEST_GRAMMAR_SWITCH",
             "ABANDON_RESPONSE_GRAMMAR_SWITCH",
-            "ADD_RESPONSE_GRAMMAR_SWITCH"
+            "ADD_RESPONSE_GRAMMAR_SWITCH",
+            "COMPARE_RESPONSE_GRAMMAR_SWITCH"
         };
 
     //=========================================================================
@@ -548,6 +542,16 @@
             "ADD_RESPONSE_LDAP_RESULT"
         };
 
+    /** A string representation of all the Compare Response states */
+    private static String[] CompareResponseString =
+        new String[]
+        {
+            "COMPARE_RESPONSE_TAG", 
+            "COMPARE_RESPONSE_LENGTH",
+            "COMPARE_RESPONSE_VALUE",
+            "COMPARE_RESPONSE_LDAP_RESULT"
+        };
+
     /** The instance */
     private static LdapStatesEnum instance = new LdapStatesEnum();
 
@@ -589,6 +593,7 @@
             case UNBIND_REQUEST_GRAMMAR : return "UNBIND_REQUEST_GRAMMAR";
             case ABANDON_REQUEST_GRAMMAR : return "ABANDON_REQUEST_GRAMMAR";
             case ADD_RESPONSE_GRAMMAR : return "ADD_RESPONSE_GRAMMAR";
+            case COMPARE_RESPONSE_GRAMMAR : return "COMPARE_RESPONSE_GRAMMAR";
         	default : return "UNKNOWN";
         }
     }
@@ -632,6 +637,10 @@
         {
             return "ADD_RESPONSE_GRAMMAR";
         }
+        else if (grammar instanceof CompareResponseGrammar)
+        {
+            return "COMPARE_RESPONSE_GRAMMAR";
+        }
         else 
         {
             return "UNKNOWN GRAMMAR";
@@ -682,6 +691,9 @@
 
                 case ADD_RESPONSE_GRAMMAR :
                     return ( ( state == GRAMMAR_END ) ? "ADD_RESPONSE_END_STATE" : AddResponseString[state] );
+
+                case COMPARE_RESPONSE_GRAMMAR :
+                    return ( ( state == GRAMMAR_END ) ? "COMPARE_RESPONSE_END_STATE" : CompareResponseString[state] );
 
                 default :
                     return "UNKNOWN";