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/19 16:39:53 UTC

svn commit: r191341 - in /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars: BindRequestGrammar.java FilterGrammar.java LdapMessageGrammar.java LdapResultGrammar.java SearchRequestGrammar.java SearchResultDoneGrammar.java

Author: elecharny
Date: Sun Jun 19 07:39:52 2005
New Revision: 191341

URL: http://svn.apache.org/viewcvs?rev=191341&view=rev
Log:
Eliminated the refences to MutableString.

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/FilterGrammar.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
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchResultDoneGrammar.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=191341&r1=191340&r2=191341&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 Sun Jun 19 07:39:52 2005
@@ -30,9 +30,8 @@
 import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
 import org.apache.asn1.ldap.pojo.BindRequest;
 import org.apache.asn1.ldap.pojo.LdapMessage;
-import org.apache.asn1.ldap.pojo.SaslAuthentication;
+import org.apache.asn1.ldap.pojo.SaslCredentials;
 import org.apache.asn1.ldap.pojo.SimpleAuthentication;
-import org.apache.asn1.util.MutableString;
 
 import org.apache.log4j.Logger;
 
@@ -209,7 +208,7 @@
                         // We have to handle the special case of a 0 length name
                         if (tlv.getLength().getLength() == 0)
                         {
-                            bindRequestMessage.setName( MutableString.EMPTY_STRING );
+                            bindRequestMessage.setName( (LdapDN)LdapDN.EMPTY_STRING );
                         }
                         
                         return;
@@ -234,15 +233,15 @@
                         // Get the Value and store it in the BindRequest
                         TLV             tlv                = ldapMessageContainer.getCurrentTLV();
 
-
-                        bindRequestMessage.setName( LdapDN.parseDN(tlv.getValue().getData() ) );
+                        LdapDN name = new LdapDN(tlv.getValue().getData());
+                        bindRequestMessage.setName( name );
                         return;
                     }
                 } );
 
         // BindRequest ::= ... authentication AuthenticationChoice }
         // AuthenticationChoice ::= CHOICE {
-        // The tag might be either 0x80 (SimpleAuthentication) or 0x83 (SaslAuthentication)
+        // The tag might be either 0x80 (SimpleAuthentication) or 0x83 (SaslCredentials)
         //--------------------------------------------------------------------------------------------
         // If it's 0x80, it is a SimpleAuthentication.
         //--------------------------------------------------------------------------------------------
@@ -359,10 +358,10 @@
                         
                         checkLength( bindRequestMessage, tlv );
 
-                        // Create the SaslAuthentication Object
-                        SaslAuthentication authentication = null;
+                        // Create the SaslCredentials Object
+                        SaslCredentials authentication = null;
 
-                        authentication = new SaslAuthentication();
+                        authentication = new SaslCredentials();
 
                         authentication.setParent( bindRequestMessage );
 
@@ -371,7 +370,7 @@
                         // We have to handle the special case of a 0 length mechanism
                         if (tlv.getLength().getLength() == 0)
                         {
-                            authentication.setMechanism( MutableString.EMPTY_STRING );
+                            authentication.setMechanism( LdapString.EMPTY_STRING );
                         }
 
                         return;
@@ -399,9 +398,9 @@
                         BindRequest        bindRequestMessage = 
                             ldapMessageContainer.getLdapMessage().getBindRequest();
                         
-                        SaslAuthentication saslAuthentication = bindRequestMessage.getSaslAuthentication();
+                        SaslCredentials saslAuthentication = bindRequestMessage.getSaslAuthentication();
 
-                        MutableString mechanism = LdapString.parse(
+                        LdapString mechanism = new LdapString(
                                 ldapMessageContainer.getCurrentTLV().getValue().getData() );
                         
                         saslAuthentication.setMechanism( mechanism );
@@ -456,7 +455,7 @@
                         // We have to handle the special case of a 0 length credentials
                         if (tlv.getLength().getLength() == 0)
                         {
-                            SaslAuthentication saslAuthentication = bindRequestMessage
+                            SaslCredentials saslAuthentication = bindRequestMessage
                                 .getSaslAuthentication();
 
                             saslAuthentication.setCredentials( new byte[]{} );
@@ -470,7 +469,7 @@
         //        ...
         //        credentials     OCTET STRING OPTIONAL } (Value)
         //
-        // We have to get the Credentials and store it in the SaslAuthentication.
+        // We have to get the Credentials and store it in the SaslCredentials.
         // Two different following states are possible :
         // - a Controls tag (0x80)
         // - or nothing at all (end of the BindRequest).
@@ -490,7 +489,7 @@
                         BindRequest        bindRequestMessage = 
                         ldapMessageContainer.getLdapMessage().getBindRequest();
                         
-                        SaslAuthentication saslAuthentication = bindRequestMessage
+                        SaslCredentials saslAuthentication = bindRequestMessage
                                 .getSaslAuthentication();
 
                         // Get the Value and store it in the BindRequest

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java?rev=191341&r1=191340&r2=191341&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java Sun Jun 19 07:39:52 2005
@@ -41,7 +41,6 @@
 import org.apache.asn1.ldap.pojo.filters.PresentFilter;
 import org.apache.asn1.ldap.pojo.filters.SubstringFilter;
 import org.apache.asn1.primitives.OctetString;
-import org.apache.asn1.util.MutableString;
 
 import org.apache.log4j.Logger;
 
@@ -563,7 +562,7 @@
                         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
                         TLV tlv            = ldapMessageContainer.getCurrentTLV();
-                        MutableString attributeDesc = LdapString.parse(tlv.getValue().getData());
+                        LdapString attributeDesc = new LdapString(tlv.getValue().getData());
                         
                         AttributeValueAssertion assertion = new AttributeValueAssertion();
                         assertion.setAttributeDesc(attributeDesc);
@@ -685,7 +684,7 @@
                         SearchRequest searchRequest = ldapMessage.getSearchRequest();
 
                         TLV tlv            = ldapMessageContainer.getCurrentTLV();
-                        MutableString attributeDesc = LdapString.parse(tlv.getValue().getData());
+                        LdapString attributeDesc = new LdapString(tlv.getValue().getData());
                         
                         AttributeValueAssertion assertion = new AttributeValueAssertion();
                         assertion.setAttributeDesc(attributeDesc);
@@ -757,7 +756,7 @@
                         }
 
                         // Store the value.
-                        presentFilter.setAttributeDescription(LdapString.parse(tlv.getValue().getData()));
+                        presentFilter.setAttributeDescription(new LdapString(tlv.getValue().getData()));
                         //searchRequest.setCurrentFilter(presentFilter);
                         
                         // We now have to get back to the nearest filter which is not terminal.
@@ -896,7 +895,7 @@
 
                         // Store the value.
                         SubstringFilter substringFilter = (SubstringFilter)searchRequest.getCurrentFilter();
-                        substringFilter.setType(LdapString.parse(tlv.getValue().getData()));
+                        substringFilter.setType(new LdapString(tlv.getValue().getData()));
                     }
                 } );
 
@@ -1020,7 +1019,7 @@
 
                         // Store the value.
                         SubstringFilter substringFilter = (SubstringFilter)searchRequest.getCurrentFilter();
-                        substringFilter.setInitialSubstrings(LdapString.parse(tlv.getValue().getData()));
+                        substringFilter.setInitialSubstrings(new LdapString(tlv.getValue().getData()));
                     }
                 });
                 
@@ -1109,7 +1108,7 @@
 
                         // Store the value.
                         SubstringFilter substringFilter = (SubstringFilter)searchRequest.getCurrentFilter();
-                        substringFilter.addAnySubstrings(LdapString.parse(tlv.getValue().getData()));
+                        substringFilter.addAnySubstrings(new LdapString(tlv.getValue().getData()));
                     }
                 });
                 
@@ -1210,7 +1209,7 @@
 
                         // Store the value.
                         SubstringFilter substringFilter = (SubstringFilter)searchRequest.getCurrentFilter();
-                        substringFilter.setFinalSubstrings(LdapString.parse(tlv.getValue().getData()));
+                        substringFilter.setFinalSubstrings(new LdapString(tlv.getValue().getData()));
                     }
                 });
                 
@@ -1504,7 +1503,7 @@
 
                         // Store the value.
                         ExtensibleMatchFilter extensibleMatchFilter = (ExtensibleMatchFilter)searchRequest.getCurrentFilter();
-                        extensibleMatchFilter.setMatchingRule(LdapString.parse(tlv.getValue().getData()));
+                        extensibleMatchFilter.setMatchingRule(new LdapString(tlv.getValue().getData()));
                     }
                 });
                 
@@ -1582,7 +1581,7 @@
 
                         // Store the value.
                         ExtensibleMatchFilter extensibleMatchFilter = (ExtensibleMatchFilter)searchRequest.getCurrentFilter();
-                        extensibleMatchFilter.setType(LdapString.parse(tlv.getValue().getData()));
+                        extensibleMatchFilter.setType(new LdapString(tlv.getValue().getData()));
                     }
                 });
                 

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=191341&r1=191340&r2=191341&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 Sun Jun 19 07:39:52 2005
@@ -180,6 +180,7 @@
         // If the Tag is 0x60, then it's a BindRequest. Nothing to do while the length is not checked.
         // If the Tag is 0x61, then it's a BindResponse.
         // If the Tag is 0x63, then it's a SearchRequest.
+        // If the Tag is 0x64, then it's a SearchResultEntry.
         // If the Tag is 0x65, then it's a SearchResultDone
         // If the Tag is 0x67, then it's a ModifyResponse.
         // If the Tag is 0x69, then it's an AddResponse.
@@ -234,6 +235,15 @@
         // Nothing to do while the length is not checked.
         super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x63] = new GrammarTransition(
                 LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.SEARCH_REQUEST_GRAMMAR_SWITCH, null );
+
+        //--------------------------------------------------------------------------------------------
+        // SearchResultEntry Message.
+        //--------------------------------------------------------------------------------------------
+        // LdapMessage ::= ... SearchResultEntry ...
+        // SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ... (Tag)
+        // Nothing to do while the length is not checked.
+        super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x64] = new GrammarTransition(
+                LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.SEARCH_RESULT_ENTRY_GRAMMAR_SWITCH, null );
 
         //--------------------------------------------------------------------------------------------
         // SearchResultDone Message.

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=191341&r1=191340&r2=191341&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 Sun Jun 19 07:39:52 2005
@@ -32,7 +32,6 @@
 import org.apache.asn1.ldap.pojo.LdapMessage;
 import org.apache.asn1.ldap.pojo.LdapResult;
 import org.apache.asn1.ldap.pojo.Response;
-import org.apache.asn1.util.MutableString;
 
 import org.apache.log4j.Logger;
 
@@ -282,7 +281,7 @@
                         // We have to handle the special case of a 0 length matched DN
                         if ( tlv.getLength().getLength() == 0 )
                         {
-                            ldapResult.setMatchedDN( MutableString.EMPTY_STRING );
+                            ldapResult.setMatchedDN( LdapDN.EMPTY_STRING );
                         }
                     }
                 } );
@@ -311,9 +310,7 @@
                         // Get the Value and store it in the BindResponse
                         TLV           tlv       = ldapMessageContainer.getCurrentTLV();
 
-                        MutableString matchedDN = LdapDN.parseDN(
-                                tlv.getValue().getData() );
-                        ldapResult.setMatchedDN( matchedDN );
+                        ldapResult.setMatchedDN( new LdapDN( tlv.getValue().getData() ) );
                         return;
                     }
                 } );
@@ -356,7 +353,7 @@
                         // We have to handle the special case of a 0 length error message
                         if ( tlv.getLength().getLength() == 0 )
                         {
-                            ldapResult.setErrorMessage( MutableString.EMPTY_STRING );
+                            ldapResult.setErrorMessage( LdapString.EMPTY_STRING );
                         }
                     }
                 } );
@@ -384,9 +381,7 @@
                         // Get the Value and store it in the BindResponse
                         TLV           tlv          = ldapMessageContainer.getCurrentTLV();
 
-                        MutableString errorMessage = LdapString.parse(
-                                tlv.getValue().getData() );
-                        ldapResult.setErrorMessage( errorMessage );
+                        ldapResult.setErrorMessage( new LdapString( tlv.getValue().getData() ) );
                         return;
                     }
                 } );
@@ -486,7 +481,7 @@
                         // We have to handle the special case of a 0 length referral
                         if ( tlv.getLength().getLength() == 0 )
                         {
-                            ldapResult.addReferral( MutableString.EMPTY_STRING );
+                            ldapResult.addReferral( LdapString.EMPTY_STRING );
                         }
                     }
                 } );
@@ -516,9 +511,7 @@
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
 
-                        MutableString        referral = LdapString.parse(
-                                tlv.getValue().getData() );
-                        ldapResult.addReferral( referral );
+                        ldapResult.addReferral( new LdapString( tlv.getValue().getData() ) );
                     }
                 } );
 

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java?rev=191341&r1=191340&r2=191341&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java Sun Jun 19 07:39:52 2005
@@ -33,7 +33,6 @@
 import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
 import org.apache.asn1.ldap.pojo.LdapMessage;
 import org.apache.asn1.ldap.pojo.SearchRequest;
-import org.apache.asn1.util.MutableString;
 
 import org.apache.log4j.Logger;
 
@@ -185,11 +184,11 @@
                         TLV                  tlv = ldapMessageContainer.getCurrentTLV();
 
                         // We have to check that this is a correct DN
-                        MutableString baseObject = null;
+                        LdapDN baseObject = null;
                         
                         try
                         {
-                            baseObject = LdapDN.parseDN(tlv.getValue().getData());
+                            baseObject = new LdapDN(tlv.getValue().getData());
                         }
                         catch (DecoderException de)
                         {
@@ -830,7 +829,7 @@
 
                         TLV                  tlv = ldapMessageContainer.getCurrentTLV();
                         
-                        searchRequest.addAttribute( LdapString.parse(tlv.getValue().getData()));
+                        searchRequest.addAttribute( new LdapString(tlv.getValue().getData()));
 
                         return;
                     }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchResultDoneGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchResultDoneGrammar.java?rev=191341&r1=191340&r2=191341&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchResultDoneGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchResultDoneGrammar.java Sun Jun 19 07:39:52 2005
@@ -76,7 +76,7 @@
         // SearchResultDone ::= [APPLICATION 5] LDAPResult (Length)
         super.transitions[LdapStatesEnum.SEARCH_RESULT_DONE_LENGTH][0x65] = new GrammarTransition(
                 LdapStatesEnum.SEARCH_RESULT_DONE_LENGTH, LdapStatesEnum.SEARCH_RESULT_DONE_VALUE,
-                new GrammarAction( "Init DelResponse" )
+                new GrammarAction( "Init search Result Done" )
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {