directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r191766 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java
Date Wed, 22 Jun 2005 05:25:28 GMT
Author: elecharny
Date: Tue Jun 21 22:25:28 2005
New Revision: 191766

URL: http://svn.apache.org/viewcvs?rev=191766&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

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=191766&r1=191765&r2=191766&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
Tue Jun 21 22:25:28 2005
@@ -80,43 +80,6 @@
                 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(
-                LdapStatesEnum.LDAP_RESULT_CODE_LENGTH, LdapStatesEnum.LDAP_RESULT_CODE_VALUE,
-                new GrammarAction( "LdapResult Length" )
-                {
-                    public void action( IAsn1Container container ) throws DecoderException
-                    {
-
-                        // We have to store the expected Length of the PDU
-                        LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
-                            container;
-                        LdapMessage      ldapMessage          =
-                            ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-
-                        // We have to allocate a LdapResult now
-                        LdapResult ldapResult = null;
-
-                        ldapResult = new LdapResult();
-                        response.setLdapResult( ldapResult );
-
-                        TLV tlv = ldapMessageContainer.getCurrentTLV();
-
-                        ldapResult.setExpectedLength( tlv.getLength().getLength() );
-                        ldapResult.setCurrentLength( 0 );
-                        ldapResult.setParent( response );
-
-                        checkLength( response, tlv );
-
-                        return;
-                    }
-                } );
-        */
-
-        // LDAPResult --> SEQUENCE {
         //    resultCode    ENUMERATED { ... (Value)
         // The result code. The different values are :
         //  success                      (0),
@@ -256,41 +219,6 @@
 
         // LDAPResult --> SEQUENCE {
         //    ...
-        //    matchedDN   LDAPDN, (Length)
-        // The tag is 0x04. We have to check the Length
-        /*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
-                    {
-
-                        LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
-                            container;
-                        LdapMessage      ldapMessage          =
-                            ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
-
-                        TLV                  tlv                  =
-                            ldapMessageContainer.getCurrentTLV();
-
-                        checkLength( response, tlv );
-
-                        // We have to handle the special case of a 0 length matched DN
-                        if ( tlv.getLength().getLength() == 0 )
-                        {
-                            ldapResult.setMatchedDN( LdapDN.EMPTY_STRING );
-                        }
-                    }
-                } );
-        */
-
-        // LDAPResult --> SEQUENCE {
-        //    ...
         //    matchedDN   LDAPDN, (Value)
         // We store the LDAPDN after having checked that it is valid.
         super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE][0x04] =
@@ -338,41 +266,6 @@
 
         // 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] =
-            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
-                    {
-
-                        LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
-                            container;
-                        LdapMessage      ldapMessage          =
-                            ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
-
-                        TLV                  tlv                  =
-                            ldapMessageContainer.getCurrentTLV();
-
-                        checkLength( response, tlv );
-
-                        // We have to handle the special case of a 0 length error message
-                        if ( tlv.getLength().getLength() == 0 )
-                        {
-                            ldapResult.setErrorMessage( LdapString.EMPTY_STRING );
-                        }
-                    }
-                } );
-        */
-
-        // LDAPResult --> SEQUENCE {
-        //    ...
         //    errorMessage   LDAPString, (Value)
         // Stores the value.
         super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][0x04] =
@@ -432,83 +325,12 @@
             new GrammarTransition( LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
                 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] =
-            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
-                    {
-
-                        LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
-                            container;
-                        LdapMessage      ldapMessage          =
-                            ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
-
-                        TLV                  tlv                  =
-                            ldapMessageContainer.getCurrentTLV();
-
-                        checkLength( response, tlv );
-
-                        // We will use the LdapString Object to check the expected length
of the following
-                        // referrals. This is quite a trick, but as this Object expected
length is never
-                        // used, it's just ok.
-                        ldapResult.setExpectedLength( ldapMessageContainer.getCurrentTLV()
-                            .getLength().getLength() );
-                        ldapResult.setCurrentLength( 0 );
-
-                    }
-                } );
-        */
-
         // 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_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] =
-            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
-                    {
-
-                        LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
-                            container;
-                        LdapMessage      ldapMessage          =
-                            ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
-
-                        TLV                  tlv                  =
-                            ldapMessageContainer.getCurrentTLV();
-
-                        checkLength( ldapResult, tlv );
-
-                        // We have to handle the special case of a 0 length referral
-                        if ( tlv.getLength().getLength() == 0 )
-                        {
-                            ldapResult.addReferral( LdapString.EMPTY_STRING );
-                        }
-                    }
-                } );
-        */
 
         // Referral ::= SEQUENCE OF LDAPURL (Length)
         // We may have other referrals, but wa may also have finished to read the LdapResult.



Mime
View raw message