Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 73371 invoked from network); 24 May 2005 06:33:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 May 2005 06:33:59 -0000 Received: (qmail 56995 invoked by uid 500); 24 May 2005 06:33:58 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 56957 invoked by uid 500); 24 May 2005 06:33:58 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 56941 invoked by uid 99); 24 May 2005 06:33:58 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 23 May 2005 23:33:58 -0700 Received: (qmail 73329 invoked by uid 65534); 24 May 2005 06:33:57 -0000 Message-ID: <20050524063357.73328.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: svn commit: r178095 - /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java Date: Tue, 24 May 2005 06:33:56 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.0-dev X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: elecharny Date: Mon May 23 23:33:56 2005 New Revision: 178095 URL: http://svn.apache.org/viewcvs?rev=3D178095&view=3Drev Log: - Suppressed the pooling mechanism - added the handling of UnbindRequest Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/grammars/LdapMessageGrammar.java Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/l= dap/codec/grammars/LdapMessageGrammar.java URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/s= rc/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java?rev=3D1= 78095&r1=3D178094&r2=3D178095&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/grammars/LdapMessageGrammar.java (original) +++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/co= dec/grammars/LdapMessageGrammar.java Mon May 23 23:33:56 2005 @@ -25,10 +25,8 @@ import org.apache.asn1.ber.tlv.TLV; import org.apache.asn1.ber.tlv.Value; import org.apache.asn1.ldap.codec.LdapMessageContainer; -import org.apache.asn1.ldap.codec.LdapPoolEnum; import org.apache.asn1.ldap.codec.utils.IntegerDecoder; import org.apache.asn1.ldap.pojo.LdapMessagePOJO; -import org.apache.asn1.util.pools.PoolException; =20 import org.apache.log4j.Logger; =20 @@ -87,24 +85,15 @@ { public void action( IAsn1Container container ) throws = DecoderException { - try { - LdapMessageContainer ldapMessageContainer =3D (LdapM= essageContainer)container; -=09 - // First, create a empty LdapMessage POJO - LdapMessagePOJO ldapMessage =3D ( LdapMessagePOJO ) - ldapMessageContainer.getPoolManager().allocat= e( - LdapPoolEnum.LDAP_MESSAGE_POJO_POOL ); -=09 - // Then stores it into the container - ldapMessageContainer.setLdapMessage(ldapMessage); - =20 - return; - } - catch ( PoolException pe ) - { - throw new DecoderException( - "Cannot allocate a LdapMessage Pojo : " + pe.= getMessage() ); - } + LdapMessageContainer ldapMessageContainer =3D (LdapMe= ssageContainer)container; + + // First, create a empty LdapMessage POJO + LdapMessagePOJO ldapMessage =3D new LdapMessagePOJO(); + + // Then stores it into the container + ldapMessageContainer.setLdapMessage(ldapMessage); + =20 + return; } } ); =20 @@ -186,6 +175,7 @@ } ); =20 //****************************************************************= **************************** + // If the Tag is 0x42, then it's a UnBindRequest.=20 // If the Tag is 0x60, then it's a BindRequest. Nothing to do whil= e the length is not checked. // If the Tag is 0x61, then it's a BindResponse.=20 //****************************************************************= **************************** @@ -205,5 +195,13 @@ // BindResponse ::=3D [APPLICATION 1] SEQUENCE { ... (Tag) // We have to switch to the BindResponse grammar super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x61] =3D new Gr= ammarTransition( LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.BIND_RESPON= SE_GRAMMAR_SWITCH, null); + + //----------------------------------------------------------------= ---------------------------- + // UnBindRequest Message. + //----------------------------------------------------------------= ---------------------------- + // LdapMessage ::=3D ... UnBindRequest ... + // UnbindRequest ::=3D [APPLICATION 2] NULL (Tag) + // We have to switch to the UnBindRequest grammar + super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x42] =3D new Gr= ammarTransition( LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.UNBIND_REQU= EST_GRAMMAR_SWITCH, null); } }