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/21 08:58:05 UTC

svn commit: r191635 - in /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars: LdapResultGrammar.java LdapStatesEnum.java UnBindRequestGrammar.java

Author: elecharny
Date: Mon Jun 20 23:58:04 2005
New Revision: 191635

URL: http://svn.apache.org/viewcvs?rev=191635&view=rev
Log:
Deleted the useless LENGTH transitions

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

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=191635&r1=191634&r2=191635&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 Mon Jun 20 23:58:04 2005
@@ -77,12 +77,12 @@
         // We have a LDAPResult, and the tag may be 0x0A
         // Nothing to do
         super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_TAG][0x0A] = new GrammarTransition(
-                LdapStatesEnum.LDAP_RESULT_CODE_TAG, LdapStatesEnum.LDAP_RESULT_CODE_LENGTH, null );
+                LdapStatesEnum.LDAP_RESULT_CODE_TAG, LdapStatesEnum.LDAP_RESULT_CODE_VALUE, null );
 
         // LDAPResult --> SEQUENCE {
         //    resultCode    ENUMERATED { ... (Length)
         //   let's check the length
-        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_LENGTH][0x0A] = new GrammarTransition(
+        /*super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_LENGTH][0x0A] = new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_CODE_LENGTH, LdapStatesEnum.LDAP_RESULT_CODE_VALUE,
                 new GrammarAction( "LdapResult Length" )
                 {
@@ -114,6 +114,7 @@
                         return;
                     }
                 } );
+        */
 
         // LDAPResult --> SEQUENCE {
         //    resultCode    ENUMERATED { ... (Value)
@@ -179,7 +180,8 @@
                             ldapMessageContainer.getLdapMessage();
                         Response         response             = ( Response )
                             ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
+                        LdapResult       ldapResult           = new LdapResult();
+                        response.setLdapResult( ldapResult );
 
                         // We don't have to allocate a LdapResult first.
 
@@ -250,13 +252,13 @@
         super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG][0x04] =
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG,
-                LdapStatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH, null );
+                LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE, null );
 
         // LDAPResult --> SEQUENCE {
         //    ...
         //    matchedDN   LDAPDN, (Length)
         // The tag is 0x04. We have to check the Length
-        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH][0x04] =
+        /*super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH][0x04] =
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_MATCHED_DN_LENGTH,
                 LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE,
@@ -285,6 +287,7 @@
                         }
                     }
                 } );
+        */
 
         // LDAPResult --> SEQUENCE {
         //    ...
@@ -310,7 +313,16 @@
                         // Get the Value and store it in the BindResponse
                         TLV           tlv       = ldapMessageContainer.getCurrentTLV();
 
-                        ldapResult.setMatchedDN( new LdapDN( tlv.getValue().getData() ) );
+                        // We have to handle the special case of a 0 length matched DN
+                        if ( tlv.getLength().getLength() == 0 )
+                        {
+                            ldapResult.setMatchedDN( LdapDN.EMPTY_STRING );
+                        }
+                        else
+                        {
+                            ldapResult.setMatchedDN( new LdapDN( tlv.getValue().getData() ) );
+                        }
+                        
                         return;
                     }
                 } );
@@ -322,14 +334,14 @@
         super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG][0x04] =
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG,
-                LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH, null );
+                LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE, null );
 
         // LDAPResult --> SEQUENCE {
         //    ...
         //    errorMessage   LDAPString, (Length)
         // The tag is 0x04. We have to check the Length
         // As the string could be null, we have create an empty error message
-        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_LENGTH][0x04] =
+        /*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" )
@@ -357,6 +369,7 @@
                         }
                     }
                 } );
+        */
 
         // LDAPResult --> SEQUENCE {
         //    ...
@@ -381,7 +394,16 @@
                         // Get the Value and store it in the BindResponse
                         TLV           tlv          = ldapMessageContainer.getCurrentTLV();
 
-                        ldapResult.setErrorMessage( new LdapString( tlv.getValue().getData() ) );
+                        // We have to handle the special case of a 0 length error message
+                        if ( tlv.getLength().getLength() == 0 )
+                        {
+                            ldapResult.setErrorMessage( LdapString.EMPTY_STRING );
+                        }
+                        else
+                        {
+                            ldapResult.setErrorMessage( new LdapString( tlv.getValue().getData() ) );
+                        }
+                        
                         return;
                     }
                 } );
@@ -403,19 +425,19 @@
         // This is a referral.
         super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x83] =
             new GrammarTransition( LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
-                LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG, null );
 
         // In case we are coming from a error message state
         super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][0x83] =
             new GrammarTransition( LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
-                LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG, 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[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH][0x83] =
+        /*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" )
@@ -445,18 +467,19 @@
 
                     }
                 } );
+        */
 
         // 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[LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG][0x04] = new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG,
-                LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH, null );
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE, 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[LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH][0x04] =
+        /*super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH][0x04] =
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE,
@@ -485,6 +508,7 @@
                         }
                     }
                 } );
+        */
 
         // Referral ::= SEQUENCE OF LDAPURL (Length)
         // We may have other referrals, but wa may also have finished to read the LdapResult.
@@ -493,7 +517,7 @@
         // Here, we store the referral in the ldapResult.
         super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE][0x04] =
             new GrammarTransition(
-                LdapStatesEnum.LDAP_RESULT_REFERRAL_LENGTH,
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
                 new GrammarAction( "Store Ldap Result referral" )
                 {
@@ -511,7 +535,14 @@
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
 
-                        ldapResult.addReferral( new LdapString( tlv.getValue().getData() ) );
+                        if (tlv.getLength().getLength() == 0)
+                        {
+                            ldapResult.addReferral( LdapString.EMPTY_STRING );
+                        }
+                        else
+                        {
+                            ldapResult.addReferral( new LdapString( tlv.getValue().getData() ) );
+                        }
                     }
                 } );
 
@@ -525,7 +556,7 @@
         super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x04] =
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
-                LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
+                LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE, null );
 
     }
 

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=191635&r1=191634&r2=191635&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 Mon Jun 20 23:58:04 2005
@@ -37,36 +37,27 @@
     /** LDAPMessage Tag */
     public static int LDAP_MESSAGE_TAG = 0;
 
-    /** LDAPMessage Length */
-    public static int LDAP_MESSAGE_LENGTH = 1;
-
     /** LDAPMessage Value */
-    public static int LDAP_MESSAGE_VALUE = 2;
+    public static int LDAP_MESSAGE_VALUE = 1;
 
     // Message ID -------------------------------------------------------------
     /** MessageID Tag */
-    public static int LDAP_MESSAGE_ID_TAG = 3;
-
-    /** MessageID Length */
-    public static int LDAP_MESSAGE_ID_LENGTH = 4;
+    public static int LDAP_MESSAGE_ID_TAG = 2;
 
     /** MessageID Value */
-    public static int LDAP_MESSAGE_ID_VALUE = 5;
+    public static int LDAP_MESSAGE_ID_VALUE = 3;
 
     //=========================================================================
     // ProtocolOp
     //=========================================================================
     /** protocolOp CHOICE Tag */
-    public static int PROTOCOL_OP_TAG = 6;
-
-    /** protocolOp CHOICE Length */
-    public static int PROTOCOL_OP_LENGTH = 7;
+    public static int PROTOCOL_OP_TAG = 4;
 
     /** protocolOp CHOICE Value */
-    public static int PROTOCOL_OP_VALUE       = 8;
+    public static int PROTOCOL_OP_VALUE       = 5;
 
     /** The Ldap Message last state */
-    public static int LAST_LDAP_MESSAGE_STATE = 9;
+    public static int LAST_LDAP_MESSAGE_STATE = 6;
 
     //=========================================================================
     // BindRequest 
@@ -146,8 +137,8 @@
     /** The UnBindRequest Tag */
     public static int UNBIND_REQUEST_TAG = 0;
 
-    /** The UnBindRequest Length */
-    public static int UNBIND_REQUEST_LENGTH = 1;
+    /** The UnBindRequest Value */
+    public static int UNBIND_REQUEST_VALUE = 1;
 
     /** The unbind request last state */
     public static int LAST_UNBIND_REQUEST_STATE = 2;
@@ -158,14 +149,11 @@
     /** The abandon request Tag */
     public static int ABANDON_REQUEST_MESSAGE_ID_TAG = 0;
 
-    /** The abandon request Length */
-    public static int ABANDON_REQUEST_MESSAGE_ID_LENGTH = 1;
-
     /** The abandon request Value */
-    public static int ABANDON_REQUEST_MESSAGE_ID_VALUE = 2;
+    public static int ABANDON_REQUEST_MESSAGE_ID_VALUE = 1;
 
     /** The abandon request last state */
-    public static int LAST_ABANDON_REQUEST_STATE = 3;
+    public static int LAST_ABANDON_REQUEST_STATE = 2;
 
     //=========================================================================
     // Controls 
@@ -363,54 +351,39 @@
     /** LdapResult Code Tag */
     public static int LDAP_RESULT_CODE_TAG = 0;
 
-    /** LdapResult Code Length */
-    public static int LDAP_RESULT_CODE_LENGTH = 1;
-
     /** LdapResult Code Value */
-    public static int LDAP_RESULT_CODE_VALUE = 2;
+    public static int LDAP_RESULT_CODE_VALUE = 1;
 
     // LdapResult Matched DN --------------------------------------------------
     /** LdapResult Matched DN Tag */
-    public static int LDAP_RESULT_MATCHED_DN_TAG = 3;
-
-    /** LdapResult Matched DN Length */
-    public static int LDAP_RESULT_MATCHED_DN_LENGTH = 4;
+    public static int LDAP_RESULT_MATCHED_DN_TAG = 2;
 
     /** LdapResult Matched DN Value */
-    public static int LDAP_RESULT_MATCHED_DN_VALUE = 5;
+    public static int LDAP_RESULT_MATCHED_DN_VALUE = 3;
 
     // LdapResult error message -----------------------------------------------
     /** LdapResult error message Tag */
-    public static int LDAP_RESULT_ERROR_MESSAGE_TAG = 6;
-
-    /** LdapResult error message Length */
-    public static int LDAP_RESULT_ERROR_MESSAGE_LENGTH = 7;
+    public static int LDAP_RESULT_ERROR_MESSAGE_TAG = 4;
 
     /** LdapResult error message Value */
-    public static int LDAP_RESULT_ERROR_MESSAGE_VALUE = 8;
+    public static int LDAP_RESULT_ERROR_MESSAGE_VALUE = 5;
 
     // LdapResult referral sequence -------------------------------------------
     /** LdapResult referral sequence Tag */
-    public static int LDAP_RESULT_REFERRAL_SEQUENCE_TAG = 9;
-
-    /** LdapResult referral sequence Length */
-    public static int LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH = 10;
+    public static int LDAP_RESULT_REFERRAL_SEQUENCE_TAG = 6;
 
     // LdapResult referral ---------------------------------------------------
     /** LdapResult referral Tag */
-    public static int LDAP_RESULT_REFERRAL_TAG = 11;
-
-    /** LdapResult referral Length */
-    public static int LDAP_RESULT_REFERRAL_LENGTH = 12;
+    public static int LDAP_RESULT_REFERRAL_TAG = 7;
 
     /** LdapResult referral Value */
-    public static int LDAP_RESULT_REFERRAL_VALUE = 13;
+    public static int LDAP_RESULT_REFERRAL_VALUE = 8;
 
     /** LdapResult referral Tag loop */
-    public static int LDAP_RESULT_REFERRAL_LOOP_TAG = 14;
+    public static int LDAP_RESULT_REFERRAL_LOOP_TAG = 9;
 
     /** The last state */
-    public static int LAST_LDAP_RESULT_STATE = 15;
+    public static int LAST_LDAP_RESULT_STATE = 10;
 
     //=========================================================================
     // SearchRequest grammar states 
@@ -752,6 +725,86 @@
     public static int LAST_FILTER_STATE = 69;
 
     //=========================================================================
+    // Search Result Entry grammar states 
+    //=========================================================================
+    // Search Result Entry ----------------------------------------------------
+    /** Search Result Entry Tag */
+    public static int SEARCH_RESULT_ENTRY_TAG = 0;
+
+    /** Search Result Entry Length */
+    public static int SEARCH_RESULT_ENTRY_LENGTH = 1;
+
+    /** Search Result Entry Value */
+    public static int SEARCH_RESULT_ENTRY_VALUE = 2;
+
+    // Object Name ------------------------------------------------------------
+    /** Object Name Tag */
+    public static int SEARCH_RESULT_ENTRY_OBJECT_NAME_TAG = 3;
+
+    /** Object Name Length */
+    public static int SEARCH_RESULT_ENTRY_OBJECT_NAME_LENGTH = 4;
+
+    /** Object Name Value */
+    public static int SEARCH_RESULT_ENTRY_OBJECT_NAME_VALUE = 5;
+
+    // Attributes -------------------------------------------------------------
+    /** Attributes Tag */
+    public static int SEARCH_RESULT_ENTRY_ATTRIBUTES_TAG = 6;
+
+    /** Attributes Length */
+    public static int SEARCH_RESULT_ENTRY_ATTRIBUTES_LENGTH = 7;
+
+    /** Attributes Value */
+    public static int SEARCH_RESULT_ENTRY_ATTRIBUTES_VALUE = 8;
+    
+    // Partial Attributes List ------------------------------------------------
+    /** Partial Attributes List Tag */
+    public static int SEARCH_RESULT_ENTRY_PARTIAL_ATTRIBUTE_LIST_TAG = 9;
+
+    /** Partial Attributes List Length */
+    public static int SEARCH_RESULT_ENTRY_PARTIAL_ATTRIBUTE_LIST_LENGTH = 10;
+
+    /** Partial Attributes List Value */
+    public static int SEARCH_RESULT_ENTRY_PARTIAL_ATTRIBUTE_LIST_VALUE = 11;
+
+    // Attribute type ---------------------------------------------------------
+    /** Type Tag */
+    public static int SEARCH_RESULT_ENTRY_TYPE_TAG = 12;
+
+    /** Type Length */
+    public static int SEARCH_RESULT_ENTRY_TYPE_LENGTH = 13;
+
+    /** Type Value */
+    public static int SEARCH_RESULT_ENTRY_TYPE_VALUE = 14;
+
+    // Vals  ------------------------------------------------------------------
+    /** Attribute vals Tag */
+    public static int SEARCH_RESULT_ENTRY_VALS_TAG = 15;
+
+    /** Attribute vals Length */
+    public static int SEARCH_RESULT_ENTRY_VALS_LENGTH = 16;
+
+    /** Attribute vals Value */
+    public static int SEARCH_RESULT_ENTRY_VALS_VALUE = 17;
+
+    // Attribute value --------------------------------------------------------
+    /** Attribute value Tag */
+    public static int SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_TAG = 18;
+
+    /** Attribute value Length */
+    public static int SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_LENGTH = 19;
+
+    /** Attribute value Value */
+    public static int SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_VALUE = 20;
+
+    // Attribute value loop or next attribute ---------------------------------
+    /** Attribute value or next attribute Tag */
+    public static int SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_OR_LIST_TAG = 21;
+
+    /** The last state */
+    public static int LAST_SEARCH_RESULT_ENTRY_STATE = 22;
+
+    //=========================================================================
     // Filter substring grammar states 
     //=========================================================================
 
@@ -851,6 +904,12 @@
     /** Filter number */
     public static final int FILTER_GRAMMAR = 14;
     
+    /** SearchResultEntry Grammar */
+    public static final int SEARCH_RESULT_ENTRY_GRAMMAR_SWITCH = 0x1000;
+
+    /** SearchResultEntry number */
+    public static final int SEARCH_RESULT_ENTRY_GRAMMAR = 15;
+    
     /** The total number of grammars used */
     public static final int NB_GRAMMARS = 20;
 
@@ -876,7 +935,7 @@
             "SEARCH_RESULT_DONE_GRAMMAR_SWITCH",
             "SEARCH_REQUEST_GRAMMAR_SWITCH",
             "FILTER_GRAMMAR_SWITCH",
-            "SUBSTRING_FILTER_GRAMMAR_SWITCH"
+            "SEARCH_RESULT_ENTRY_GRAMMAR_SWITCH"
         };
 
     //=========================================================================
@@ -887,13 +946,10 @@
         new String[]
         {
             "LDAP_MESSAGE_TAG", 
-            "LDAP_MESSAGE_LENGTH", 
             "LDAP_MESSAGE_VALUE", 
             "LDAP_MESSAGE_ID_TAG",
-            "LDAP_MESSAGE_ID_LENGTH", 
             "LDAP_MESSAGE_ID_VALUE", 
             "PROTOCOL_OP_TAG",
-            "PROTOCOL_OP_LENGTH", 
             "PROTOCOL_OP_VALUE"
         };
 
@@ -902,19 +958,15 @@
         new String[]
         {
             "LDAP_RESULT_CODE_TAG", 
-            "LDAP_RESULT_CODE_LENGTH", 
             "LDAP_RESULT_CODE_VALUE",
             "LDAP_RESULT_MATCHED_DN_TAG", 
-            "LDAP_RESULT_MATCHED_DN_LENGTH",
             "LDAP_RESULT_MATCHED_DN_VALUE", 
             "LDAP_RESULT_ERROR_MESSAGE_TAG",
-            "LDAP_RESULT_ERROR_MESSAGE_LENGTH", 
             "LDAP_RESULT_ERROR_MESSAGE_VALUE",
             "LDAP_RESULT_REFERRAL_SEQUENCE_TAG", 
-            "LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH",
             "LDAP_RESULT_REFERRAL_TAG", 
-            "LDAP_RESULT_REFERRAL_LENGTH",
-            "LDAP_RESULT_REFERRAL_VALUE"
+            "LDAP_RESULT_REFERRAL_VALUE",
+            "LDAP_RESULT_REFERRAL_LOOP_TAG"
         };
 
     /** A string representation of all the controls states */
@@ -982,7 +1034,7 @@
         new String[]
         {
             "UNBIND_REQUEST_TAG", 
-            "UNBIND_REQUEST_LENGTH" 
+            "UNBIND_REQUEST_VALUE" 
         };
 
     /** A string representation of all the Abandon Request states */
@@ -990,7 +1042,6 @@
         new String[]
         {
             "ABANDON_REQUEST_MESSAGE_ID_TAG",
-            "ABANDON_REQUEST_MESSAGE_ID_LENGTH",
             "ABANDON_REQUEST_MESSAGE_ID_VALUE"
         };
 
@@ -1089,7 +1140,6 @@
             "SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_LOOP_TAG"
         };
 
-
     /** A string representation of all the Filter states */
     private static String[] FilterString =
         new String[]
@@ -1166,6 +1216,35 @@
                 "FILTER_END_STATE"
         };
     
+    /** A string representation of all the search result entry states */
+    private static String[] SearchResultEntryString =
+        new String[]
+        {
+			    "SEARCH_RESULT_ENTRY_TAG",
+			    "SEARCH_RESULT_ENTRY_LENGTH",
+			    "SEARCH_RESULT_ENTRY_VALUE",
+			    "SEARCH_RESULT_ENTRY_OBJECT_NAME_TAG",
+			    "SEARCH_RESULT_ENTRY_OBJECT_NAME_LENGTH",
+			    "SEARCH_RESULT_ENTRY_OBJECT_NAME_VALUE",
+			    "SEARCH_RESULT_ENTRY_ATTRIBUTES_TAG",
+			    "SEARCH_RESULT_ENTRY_ATTRIBUTES_LENGTH",
+			    "SEARCH_RESULT_ENTRY_ATTRIBUTES_VALUE",
+			    "SEARCH_RESULT_ENTRY_PARTIAL_ATTRIBUTE_LIST_TAG",
+			    "SEARCH_RESULT_ENTRY_PARTIAL_ATTRIBUTE_LIST_LENGTH",
+			    "SEARCH_RESULT_ENTRY_PARTIAL_ATTRIBUTE_LIST_VALUE",
+			    "SEARCH_RESULT_ENTRY_TYPE_TAG",
+			    "SEARCH_RESULT_ENTRY_TYPE_LENGTH",
+			    "SEARCH_RESULT_ENTRY_TYPE_VALUE",
+			    "SEARCH_RESULT_ENTRY_VALS_TAG",
+			    "SEARCH_RESULT_ENTRY_VALS_LENGTH",
+			    "SEARCH_RESULT_ENTRY_VALS_VALUE",
+			    "SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_TAG",
+			    "SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_LENGTH",
+			    "SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_VALUE",
+			    "SEARCH_RESULT_ENTRY_ATTRIBUTE_VALUE_OR_LIST_TAG",
+			    "LAST_SEARCH_RESULT_ENTRY_STATE"
+        };
+    
     /** The instance */
     private static LdapStatesEnum instance = new LdapStatesEnum();
 
@@ -1214,6 +1293,7 @@
             case SEARCH_RESULT_DONE_GRAMMAR : return "SEARCH_RESULT_DONE_GRAMMAR";
             case SEARCH_REQUEST_GRAMMAR     : return "SEARCH_REQUEST_GRAMMAR";
             case FILTER_GRAMMAR             : return "FILTER_GRAMMAR";
+            case SEARCH_RESULT_ENTRY_GRAMMAR: return "SEARCH_RESULT_ENTRY_GRAMMAR";
         	default                         : return "UNKNOWN";
         }
     }
@@ -1285,6 +1365,10 @@
         {
             return "FILTER_GRAMMAR";
         }
+        else if (grammar instanceof SearchResultEntryGrammar)
+        {
+            return "SEARCH_RESULT_ENTRY_GRAMMAR";
+        }
         else 
         {
             return "UNKNOWN GRAMMAR";
@@ -1356,6 +1440,9 @@
 
                 case FILTER_GRAMMAR :
                     return ( ( state == GRAMMAR_END ) ? "FILTER_END_STATE" : FilterString[state] );
+                    
+                case SEARCH_RESULT_ENTRY_GRAMMAR :
+                    return ( ( state == GRAMMAR_END ) ? "SEARCH_RESULT_ENTRY_END_STATE" : SearchResultEntryString[state] );
                     
                 default :
                     return "UNKNOWN";

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/UnBindRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/UnBindRequestGrammar.java?rev=191635&r1=191634&r2=191635&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/UnBindRequestGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/UnBindRequestGrammar.java Mon Jun 20 23:58:04 2005
@@ -84,14 +84,14 @@
         // LdapMessage ::= ... UnBindRequest ...
         // UnbindRequest ::= [APPLICATION 2] NULL (Length)
         super.transitions[LdapStatesEnum.UNBIND_REQUEST_TAG][0x42]    = new GrammarTransition(
-                LdapStatesEnum.UNBIND_REQUEST_TAG, LdapStatesEnum.UNBIND_REQUEST_LENGTH, null );
+                LdapStatesEnum.UNBIND_REQUEST_TAG, LdapStatesEnum.UNBIND_REQUEST_VALUE, null );
 
         // LdapMessage ::= ... UnBindRequest ...
         // UnbindRequest ::= [APPLICATION 2] NULL (Value)
         // We have to check that the length is null (the Value is empty). This is the end of this grammar.
         // We also have to allocate a UnBindRequest
-        super.transitions[LdapStatesEnum.UNBIND_REQUEST_LENGTH][0x42] = new GrammarTransition(
-                LdapStatesEnum.UNBIND_REQUEST_LENGTH, LdapStatesEnum.GRAMMAR_END,
+        super.transitions[LdapStatesEnum.UNBIND_REQUEST_VALUE][0x42] = new GrammarTransition(
+                LdapStatesEnum.UNBIND_REQUEST_VALUE, LdapStatesEnum.GRAMMAR_END,
                 new GrammarAction( "Init UnBindRequest" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
@@ -102,8 +102,6 @@
                         LdapMessage      ldapMessage          =
                             ldapMessageContainer.getLdapMessage();
 
-                        checkLength( ldapMessage, ldapMessageContainer.getCurrentTLV() );
-
                         // Now, we can allocate the UnBindRequest Object
                         UnBindRequest unBindRequest = new UnBindRequest();
 
@@ -117,8 +115,6 @@
                             throw new DecoderException("The length of a UnBindRequest must be null");
                         }
 
-                        unBindRequest.setExpectedLength( expectedLength );
-                        unBindRequest.setCurrentLength( 0 );
                         unBindRequest.setParent( ldapMessage );
 
                         // And we associate it to the ldapMessage Object