directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
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 GMT
Author: elecharny
Date: Mon May 23 23:33:56 2005
New Revision: 178095

URL: http://svn.apache.org/viewcvs?rev=178095&view=rev
Log:
- Suppressed the pooling mechanism
- added the handling of UnbindRequest

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

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=178095&r1=178094&r2=178095&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
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;
 
 import org.apache.log4j.Logger;
 
@@ -87,24 +85,15 @@
                 {
                     public void action( IAsn1Container container ) throws DecoderException
                     {
-                    	try {
-	                    	LdapMessageContainer ldapMessageContainer = (LdapMessageContainer)container;
-	
-	                        // First, create a empty LdapMessage POJO
-	                    	LdapMessagePOJO ldapMessage = ( LdapMessagePOJO )
-	                            ldapMessageContainer.getPoolManager().allocate(
-	                                    LdapPoolEnum.LDAP_MESSAGE_POJO_POOL );
-	
-	                        // Then stores it into the container
-	                        ldapMessageContainer.setLdapMessage(ldapMessage);
-	                        
-	                        return;
-	                    }
-	                    catch ( PoolException pe )
-	                    {
-	                        throw new DecoderException(
-	                            "Cannot allocate a LdapMessage Pojo : " + pe.getMessage() );
-	                    }
+                    	LdapMessageContainer ldapMessageContainer = (LdapMessageContainer)container;
+
+                        // First, create a empty LdapMessage POJO
+                    	LdapMessagePOJO ldapMessage = new LdapMessagePOJO();
+
+                        // Then stores it into the container
+                        ldapMessageContainer.setLdapMessage(ldapMessage);
+                        
+                        return;
                     }
                 } );
 
@@ -186,6 +175,7 @@
                 } );
 
         //********************************************************************************************
+        // If the Tag is 0x42, then it's a UnBindRequest. 
         // 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. 
         //********************************************************************************************
@@ -205,5 +195,13 @@
         // BindResponse ::= [APPLICATION 1] SEQUENCE { ... (Tag)
         // We have to switch to the BindResponse grammar
         super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x61] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.BIND_RESPONSE_GRAMMAR_SWITCH, null);
+
+        //--------------------------------------------------------------------------------------------
+        // UnBindRequest Message.
+        //--------------------------------------------------------------------------------------------
+        // LdapMessage ::= ... UnBindRequest ...
+        // UnbindRequest ::= [APPLICATION 2] NULL (Tag)
+        // We have to switch to the UnBindRequest grammar
+        super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x42] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.UNBIND_REQUEST_GRAMMAR_SWITCH, null);
     }
 }



Mime
View raw message