directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 37161 - in incubator/directory/snickers/trunk: ber-codec/src/java/org/apache/snickers/ber ldap-ber-provider/src/java/org/apache/snickers/ldap ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/search ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/abandon ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/add ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/bind ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/compare ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/delete ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/extended ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modify ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modifyDn ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/unbind ldap-ber-provider/src/test/org/apache/snickers/ldap ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/abandon ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/add ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/bind ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/compare ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/delete ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/extended ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modify ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modifyDn ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/unbind
Date Sat, 28 Aug 2004 08:02:44 GMT
Author: akarasulu
Date: Sat Aug 28 01:02:43 2004
New Revision: 37161

Added:
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/DeterminateLengthVisitor.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ber-codec/src/java/org/apache/snickers/ber/DeterminateLengthVisitor.java
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/TupleEncodingVisitor.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ber-codec/src/java/org/apache/snickers/ber/TupleEncodingVisitor.java
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/TupleNodeVisitor.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ber-codec/src/java/org/apache/snickers/ber/TupleNodeVisitor.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/AttributeEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/AttributeEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/AttributesEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/AttributesEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/ModificationItemEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/ModificationItemEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/ReferralEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/ReferralEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/abandon/AbandonRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/abandon/AbandonRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/add/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/add/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/add/AddRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/add/AddRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/add/AddResponseEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/add/AddResponseEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/bind/BindRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/bind/BindRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/bind/BindResponseEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/bind/BindResponseEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/compare/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/compare/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/compare/CompareRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/compare/CompareRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/compare/CompareResponseEncoder.java   (props changed)
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/compare/CompareResponseEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/delete/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/delete/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/delete/DeleteRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/delete/DeleteRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/delete/DeleteResponseEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/delete/DeleteResponseEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/extended/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/extended/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/extended/ExtendedRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/extended/ExtendedRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/extended/ExtendedResponseEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/extended/ExtendedResponseEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modify/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modify/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modify/ModifyRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modify/ModifyRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modify/ModifyResponseEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modify/ModifyResponseEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modifyDn/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modifyDn/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnResponseEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnResponseEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchResponseDoneEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchResponseDoneEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchResponseEntryEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchResponseEntryEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchResponseReferenceEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/search/SearchResponseReferenceEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/unbind/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/unbind/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/unbind/UnbindRequestEncoder.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/unbind/UnbindRequestEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/AbstractEncoderTestCase.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/AbstractEncoderTestCase.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/EncoderUtilsTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/EncoderUtilsTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/abandon/AbandonRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/abandon/AbandonRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/add/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/add/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/add/AddRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/add/AddRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/add/AddResponseEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/add/AddResponseEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/bind/BindRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/bind/BindRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/bind/BindResponseEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/bind/BindResponseEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/compare/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/compare/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/compare/CompareRequestEncoderTest.java   (props changed)
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/compare/CompareRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/compare/CompareResponseEncoderTest.java   (props changed)
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/compare/CompareResponseEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/delete/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/delete/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/delete/DeleteRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/delete/DeleteRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/delete/DeleteResponseEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/delete/DeleteResponseEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/extended/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/extended/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/extended/ExtendedRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/extended/ExtendedRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/extended/ExtendedResponseEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/extended/ExtendedResponseEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modify/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modify/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modify/ModifyRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modify/ModifyRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modify/ModifyResponseEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modify/ModifyResponseEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modifyDn/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modifyDn/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnResponseEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/modifyDn/ModifyDnResponseEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchRequestEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchResponseDoneEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchResponseDoneEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchResponseEntryEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchResponseEntryEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchResponseReferenceEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/search/SearchResponseReferenceEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/unbind/
      - copied from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/unbind/
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/unbind/UnbindRequestEncoderTest.java
      - copied unchanged from rev 37160, incubator/directory/snickers/branches/encoder-redesign/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/unbind/UnbindRequestEncoderTest.java
Removed:
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/SnickersEncoderTest.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/test/org/apache/snickers/ldap/encoder/AbstractEncoderTest.java
Modified:
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/Tuple.java
   incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/TupleNode.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/LdapTag.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/LdapDigesterFactory.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/search/SearchResponseDoneRule.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/EncoderUtils.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/LdapResultEncoder.java
   incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/SnickersLdapEncoder.java
Log:
merged encoder-redesign changes since 36422 into trunk

Modified: incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java
==============================================================================
--- incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java	(original)
+++ incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/DefaultMutableTupleNode.java	Sat Aug 28 01:02:43 2004
@@ -56,13 +56,20 @@
     
 
     /**
-     * Creates a node without a parent.
+     * Creates a node without a parent using a tuple.  If the tuple is primitive
+     * and has a non-null last value chunk, that value chunk is added to the
+     * list of value chunks.
      * 
      * @param tuple the tuple to set for this node
      */
     public DefaultMutableTupleNode( Tuple tuple )
     {
         this.tuple = tuple ;
+
+        if ( tuple.isPrimitive() && tuple.getLastValueChunk() != null )
+        {
+            valueChunks.add( tuple.getLastValueChunk() );
+        }
     }
     
 
@@ -485,5 +492,47 @@
         }
         
         return true ;
+    }
+
+
+    /**
+     * Recursively descends the tree at this node based on the order of the
+     * visitor.
+     *
+     * @see TupleNode#accept(TupleNodeVisitor)
+     */
+    public void accept( TupleNodeVisitor visitor )
+    {
+        if ( visitor.canVisit( this ) )
+        {
+            if ( visitor.isPrefix() )
+            {
+                ArrayList l_children = visitor.getOrder( this, children ) ;
+
+                if ( visitor.canVisit( this ) )
+                {
+                    visitor.visit( this ) ;
+                }
+
+                for ( int ii = 0; ii < l_children.size(); ii++ )
+                {
+                    ( ( TupleNode ) l_children.get( ii ) ).accept( visitor ) ;
+                }
+            }
+            else
+            {
+                ArrayList l_children = visitor.getOrder( this, children ) ;
+
+                for ( int ii = 0; ii < l_children.size(); ii++ )
+                {
+                    ( ( TupleNode ) l_children.get( ii ) ).accept( visitor ) ;
+                }
+
+                if ( visitor.canVisit( this ) )
+                {
+                    visitor.visit( this ) ;
+                }
+            }
+        }
     }
 }

Modified: incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/Tuple.java
==============================================================================
--- incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/Tuple.java	(original)
+++ incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/Tuple.java	Sat Aug 28 01:02:43 2004
@@ -65,7 +65,7 @@
     boolean isPrimitive = true ;
     /** the type class for this TLV */
     TypeClass typeClass = TypeClass.APPLICATION ;
-    /** the length for this TLV tuple */
+    /** the length for this TLV tuple's value field */
     int length = 0 ;
     /** the present value chunk buffer read for this TLV tuple */
     ByteBuffer valueChunk = EMPTY_BUFFER ;
@@ -645,6 +645,18 @@
             throw new IllegalArgumentException( "cannot support id's as large "
                     + "as " + id + " unless we start using longs for the id" ) ;
         }
+    }
+
+
+    /**
+     * Sets the value length of this Tuple.
+     *
+     * @param length the length of this tuple's value.
+     * @see Tuple#size() to get the entire determinate length of tuple
+     */
+    public void setValueLength( int length )
+    {
+        this.length = length;
     }
 
 

Modified: incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/TupleNode.java
==============================================================================
--- incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/TupleNode.java	(original)
+++ incubator/directory/snickers/trunk/ber-codec/src/java/org/apache/snickers/ber/TupleNode.java	Sat Aug 28 01:02:43 2004
@@ -117,4 +117,12 @@
      * @return true if the obj and this node are exact replicas of one another
      */
     boolean equals( Object obj ) ;
+
+    /**
+     * Element/node accept method for visitor pattern.
+     *
+     * @param visitor the tuple node tree structure visitor
+     * @see TupleNodeVisitor
+     */
+    void accept( TupleNodeVisitor visitor ) ;
 }

Modified: incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/LdapTag.java
==============================================================================
--- incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/LdapTag.java	(original)
+++ incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/LdapTag.java	Sat Aug 28 01:02:43 2004
@@ -202,11 +202,19 @@
             EXTENDED_RESPONSE_ID ) ;
 
 
-    /** Context specific 6 tag */
+    /** Context specific 8 tag */
+    public static final ContextSpecificTag CONTEXT_SPECIFIC_TAG_11 =
+            new ContextSpecificTag( 11, true );
+
+    /** Context specific 8 tag */
+    public static final ContextSpecificTag CONTEXT_SPECIFIC_TAG_10 =
+            new ContextSpecificTag( 10, true );
+
+    /** Context specific 8 tag */
     public static final ContextSpecificTag CONTEXT_SPECIFIC_TAG_8 =
             new ContextSpecificTag( 8, true );
 
-    /** Context specific 6 tag */
+    /** Context specific 7 tag */
     public static final ContextSpecificTag CONTEXT_SPECIFIC_TAG_7 =
             new ContextSpecificTag( 7, true );
 

Modified: incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/LdapDigesterFactory.java
==============================================================================
--- incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/LdapDigesterFactory.java	(original)
+++ incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/LdapDigesterFactory.java	Sat Aug 28 01:02:43 2004
@@ -420,12 +420,12 @@
     {
         int[] pattern = new int[2] ;
 
-        // modify pattern and addRule for the SearchResponseDone
+        // modify pattern and addRule for the SearchResponseDoneEncoder
         pattern[0] = UniversalTag.SEQUENCE_SEQUENCE_OF.getPrimitiveTag() ;
         pattern[1] = LdapTag.SEARCH_RESULT_DONE.getPrimitiveTag() ;
         digester.addRule( pattern, new SearchResponseDoneRule() ) ;
 
-        // modify pattern and addRule for the SearchResponseDone
+        // modify pattern and addRule for the SearchResponseDoneEncoder
         pattern = new int[3] ;
         pattern[0] = UniversalTag.SEQUENCE_SEQUENCE_OF.getPrimitiveTag() ;
         pattern[1] = LdapTag.SEARCH_RESULT_DONE.getPrimitiveTag() ;

Modified: incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/search/SearchResponseDoneRule.java
==============================================================================
--- incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/search/SearchResponseDoneRule.java	(original)
+++ incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/decoder/search/SearchResponseDoneRule.java	Sat Aug 28 01:02:43 2004
@@ -22,7 +22,7 @@
 
 
 /**
- * A digester rule which fires to build SearchResponseDone containment trees.
+ * A digester rule which fires to build SearchResponseDoneEncoder containment trees.
  * 
  * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory
  * Project</a>
@@ -31,7 +31,7 @@
 public class SearchResponseDoneRule extends ResultResponseRule
 {
     /**
-     * Creates a digester rule which fires to build SearchResponseDone
+     * Creates a digester rule which fires to build SearchResponseDoneEncoder
      * containment trees.
      */
     public SearchResponseDoneRule()

Modified: incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/EncoderUtils.java
==============================================================================
--- incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/EncoderUtils.java	(original)
+++ incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/EncoderUtils.java	Sat Aug 28 01:02:43 2004
@@ -16,9 +16,8 @@
  */
 package org.apache.snickers.ldap.encoder;
 
-import org.apache.snickers.ber.TupleEventConsumer;
-import org.apache.snickers.ber.TagEnum;
-import org.apache.snickers.ber.Tuple;
+
+import org.apache.snickers.ber.*;
 import org.apache.snickers.ber.primitives.UniversalTag;
 import org.apache.snickers.ber.primitives.PrimitiveUtils;
 
@@ -26,77 +25,136 @@
 
 
 /**
- * Common utilities used by encoders.
+ * Common utilities used by encoders for encoding primitive types into
+ * TupleNodes.
  * 
  * @author <a href="mailto:directory-dev@incubator.apache.org"> Apache Directory
  *         Project</a> $Rev$
  */
 public class EncoderUtils
 {
-    public static void encodePrimitive( String octets,
-                                        TupleEventConsumer consumer )
+    /**
+     * Encodes a Java String into a TupleNode.  The tag of the Tuple contained
+     * within the returned TupleNode defaults to a UNIVERSAL OCTET_STRING.
+     *
+     * @param octets the String value to encode
+     * @return the TupleNode containing the Tuple for the integer value
+     */
+    public static TupleNode encode( String octets )
     {
-        encodePrimitive( UniversalTag.OCTET_STRING, octets, consumer );
+        return encode( UniversalTag.OCTET_STRING, octets );
     }
 
 
-    public static void encodePrimitive( TagEnum tag, String octets,
-                                        TupleEventConsumer consumer )
+    /**
+     * Encodes a Java String into a TupleNode.
+     *
+     * @param tag the tag enumeration to use for the Tuple
+     * @param octets the String value to encode
+     * @return the TupleNode containing the Tuple for the string value
+     */
+    public static TupleNode encode( TagEnum tag, String octets )
     {
         Tuple t = new Tuple();
         t.setTag( tag, true );
-        consumer.tag( t );
         ByteBuffer chunk = ByteBuffer.wrap( octets.getBytes() );
         t.setLength( chunk.remaining() );
-        consumer.length( t );
         t.setLastValueChunk( chunk );
-        consumer.chunkedValue( t, chunk );
-        consumer.finish( t );
+        return new DefaultMutableTupleNode( t );
+    }
+
+
+    /**
+     * Encodes a Java byte[] into a TupleNode.  The tag of the Tuple contained
+     * within the returned TupleNode defaults to a UNIVERSAL OCTET_STRING.
+     *
+     * @param octets the byte[] to encode
+     * @return the TupleNode containing the Tuple for the byte[]
+     */
+    public static TupleNode encode( byte[] octets )
+    {
+        return encode( UniversalTag.OCTET_STRING, octets );
+    }
+
+
+    /**
+     * Encodes a Java byte[] into a TupleNode.
+     *
+     * @param tag the tag enumeration to use for the Tuple
+     * @param octets the byte[] to encode
+     * @return the TupleNode containing the Tuple for the byte[] value
+     */
+    public static TupleNode encode( TagEnum tag, byte[] octets )
+    {
+        Tuple t = new Tuple();
+        t.setTag( tag, true );
+        ByteBuffer chunk = ByteBuffer.wrap( octets );
+        t.setLength( chunk.remaining() );
+        t.setLastValueChunk( chunk );
+        return new DefaultMutableTupleNode( t );
     }
 
 
-    public static void encodePrimitive( int intval,
-                                        TupleEventConsumer consumer )
+    /**
+     * Encodes a primitive Java integer into a TupleNode.  The tag of the Tuple
+     * contained within the returned TupleNode defaults to a UNIVERSAL INTEGER.
+     *
+     * @param intval the integer value to encode
+     * @return the TupleNode containing the Tuple for the integer value
+     */
+    public static TupleNode encode( int intval )
     {
-        encodePrimitive( UniversalTag.INTEGER, intval, consumer );
+        return encode( UniversalTag.INTEGER, intval );
     }
 
 
-    public static void encodePrimitive( TagEnum tag, int intval,
-                                        TupleEventConsumer consumer )
+    /**
+     * Encodes a primitive Java integer into a TupleNode.
+     *
+     * @param tag the tag enumeration to use for the Tuple
+     * @param intval the integer value to encode
+     * @return the TupleNode containing the Tuple for the integer value
+     */
+    public static TupleNode encode( TagEnum tag, int intval )
     {
         Tuple t = new Tuple();
         t.setTag( tag, true );
-        consumer.tag( t );
         ByteBuffer chunk = ByteBuffer.wrap(
                 PrimitiveUtils.encodeInt( intval ) );
         t.setLength( chunk.remaining() );
-        consumer.length( t );
         t.setLastValueChunk( chunk );
-        consumer.chunkedValue( t, chunk );
-        consumer.finish( t );
+        return new DefaultMutableTupleNode( t );
     }
 
 
-    public static void encodePrimitive( boolean bool,
-                                        TupleEventConsumer consumer )
+    /**
+     * Encodes a boolean value into a TupleNode.  The tag defaults in this case
+     * to a UNIVERSAL BOOLEAN.
+     *
+     * @param bool the true or false value to encode
+     * @return the TupleNode containing the Tuple for the boolean value
+     */
+    public static TupleNode encode( boolean bool )
     {
-        encodePrimitive( UniversalTag.BOOLEAN, bool, consumer );
+        return encode( UniversalTag.BOOLEAN, bool );
     }
 
 
-    public static void encodePrimitive( TagEnum tag, boolean bool,
-                                        TupleEventConsumer consumer )
+    /**
+     * Encodes a boolean value into a TupleNode.
+     *
+     * @param tag the tag used for the boolean value
+     * @param bool the boolean value
+     * @return the TupleNode containing the Tuple for the boolean value
+     */
+    public static TupleNode encode( TagEnum tag, boolean bool )
     {
         Tuple t = new Tuple();
         t.setTag( tag, true );
-        consumer.tag( t );
         ByteBuffer chunk = ByteBuffer.wrap(
                 PrimitiveUtils.encodeBoolean( bool ) );
         t.setLength( chunk.remaining() );
-        consumer.length( t );
         t.setLastValueChunk( chunk );
-        consumer.chunkedValue( t, chunk );
-        consumer.finish( t );
+        return new DefaultMutableTupleNode( t );
     }
 }

Modified: incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/LdapResultEncoder.java
==============================================================================
--- incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/LdapResultEncoder.java	(original)
+++ incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/LdapResultEncoder.java	Sat Aug 28 01:02:43 2004
@@ -16,181 +16,68 @@
  */
 package org.apache.snickers.ldap.encoder;
 
+
 import org.apache.snickers.ber.*;
 import org.apache.snickers.ber.primitives.UniversalTag;
-import org.apache.snickers.ber.primitives.PrimitiveUtils;
-import org.apache.snickers.ldap.LdapTag;
 import org.apache.ldap.common.message.LdapResult;
-import org.apache.ldap.common.message.ResultCodeEnum;
-import org.apache.ldap.common.message.Referral;
-
-import java.nio.ByteBuffer;
-import java.util.Iterator;
-import java.util.ArrayList;
 
 
 /**
- * Encodes the elements of an LdapResult into some top level tuple.
+ * Encodes the elements of an LdapResult as TLV tuples into a top level tuple
+ * node.
  *
  * @author <a href="mailto:directory-dev@incubator.apache.org"> Apache Directory
  *         Project</a> $Rev$
  */
-public class LdapResultEncoder implements TupleEventProducer
+public class LdapResultEncoder
 {
-    TupleEventConsumer consumer = null;
-    Tuple tmp = new Tuple();
-
-
-    public void attach( TupleEventConsumer consumer )
-    {
-        this.consumer = consumer;
-    }
-
-
-    public void encode( LdapResult result )
-    {
-        // Encode the result code
-        tmp.setTag( UniversalTag.ENUMERATED, true );
-        ByteBuffer chunk = ByteBuffer.wrap( PrimitiveUtils
-                .encodeInt( result.getResultCode().getValue() ) ) ;
-        consumer.tag( tmp );
-        tmp.setLength( 1 );
-        consumer.length( tmp );
-        tmp.setLastValueChunk( chunk );
-        consumer.chunkedValue( tmp, chunk );
-        consumer.finish( tmp );
-
-        // Encode the matchedDN
-        tmp.setTag( UniversalTag.OCTET_STRING, true );
-        chunk = ByteBuffer.wrap( result.getMatchedDn().getBytes() );
-        consumer.tag( tmp );
-        tmp.setLength( chunk.remaining() );
-        consumer.length( tmp );
-        tmp.setLastValueChunk( chunk );
-        consumer.chunkedValue( tmp, chunk );
-        consumer.finish( tmp );
-
-        // Encode the errorMsg
-        tmp.setTag( UniversalTag.OCTET_STRING, true );
-        chunk = ByteBuffer.wrap( result.getErrorMessage().getBytes() );
-        consumer.tag( tmp );
-        tmp.setLength( chunk.remaining() );
-        consumer.length( tmp );
-        tmp.setLastValueChunk( chunk );
-        consumer.chunkedValue( tmp, chunk );
-        consumer.finish( tmp );
-
-        if ( result.getReferral() != null &&
-                result.getReferral().getLdapUrls().size() > 0 )
-        {
-            Tuple referrals = new Tuple();
-            referrals.setTag( LdapTag.REFERRAL_TAG, false );
-            consumer.tag( referrals );
-            referrals.setLength( Length.INDEFINATE );
-            consumer.length( referrals );
-
-            Iterator list = result.getReferral().getLdapUrls().iterator();
-            while( list.hasNext() )
-            {
-                tmp.setTag( UniversalTag.OCTET_STRING, true );
-                consumer.tag( tmp );
-                chunk = ByteBuffer.wrap( ( (String) list.next() ).getBytes() );
-                tmp.setLength( chunk.remaining() );
-                consumer.length( tmp );
-                tmp.setLastValueChunk( chunk );
-                consumer.chunkedValue( tmp, chunk );
-                consumer.finish( tmp );
-            }
-
-            consumer.finish( referrals );
-        }
-    }
-
+    /**
+     * An instance of this encoder.
+     */
+    public static final LdapResultEncoder INSTANCE = new LdapResultEncoder();
 
     /**
      * Encodes an LdapResult fields into TupleNodes adding them to the top
-     * argument.
+     * argument.  This method is thread safe.
      *
      * @param top the topmost node to add LDAP result fields to
      * @param result the ldap result to encode
      */
     public void encode( DefaultMutableTupleNode top, LdapResult result )
     {
-        encodeResultCode( top, result.getResultCode() );
-        encodeMatchedDn( top, result.getMatchedDn() );
-        encodeErrorMsg( top, result.getErrorMessage() );
+        DefaultMutableTupleNode child = ( DefaultMutableTupleNode )
+                EncoderUtils.encode( UniversalTag.ENUMERATED,
+                        result.getResultCode().getValue() );
+        top.addLast( child );
+        child.setParent( top );
+
+        child = ( DefaultMutableTupleNode ) EncoderUtils.encode(
+                result.getMatchedDn() );
+        top.addLast( child );
+        child.setParent( top );
 
-        if ( result.getReferral() != null &&
-                result.getReferral().getLdapUrls().size() > 0 )
+        if ( result.getErrorMessage() != null )
         {
-            encodeReferral( top, result.getReferral() );
+            child = ( DefaultMutableTupleNode ) EncoderUtils.encode(
+                    result.getErrorMessage() );
+            top.addLast( child );
+            child.setParent( top );
         }
-
-    }
-
-
-    private void encodeResultCode( DefaultMutableTupleNode top,
-                                   ResultCodeEnum resultCode )
-    {
-        Tuple tlv = new Tuple();
-        tlv.setTag( UniversalTag.ENUMERATED, true );
-        ByteBuffer chunk = ByteBuffer.wrap( PrimitiveUtils
-                .encodeInt( resultCode.getValue() ) ) ;
-        tlv.setLength( 1 );
-        tlv.setLastValueChunk( chunk );
-        ArrayList list = new ArrayList(1);
-        list.add( chunk );
-        top.addLast( new DefaultMutableTupleNode( tlv, list ) );
-    }
-
-
-    private void encodeMatchedDn( DefaultMutableTupleNode top, String dn )
-    {
-        Tuple tlv = new Tuple();
-        tlv.setTag( UniversalTag.OCTET_STRING, true );
-        ByteBuffer chunk = ByteBuffer.wrap( dn.getBytes() );
-        tlv.setLength( chunk.remaining() );
-        tlv.setLastValueChunk( chunk );
-        ArrayList list = new ArrayList(1);
-        list.add( chunk );
-        top.addLast( new DefaultMutableTupleNode( tlv, list ) );
-    }
-
-
-    private void encodeErrorMsg( DefaultMutableTupleNode top, String msg )
-    {
-        Tuple tlv = new Tuple();
-        tlv.setTag( UniversalTag.OCTET_STRING, true );
-        ByteBuffer chunk = ByteBuffer.wrap( msg.getBytes() );
-        tlv.setLength( chunk.remaining() );
-        tlv.setLastValueChunk( chunk );
-        ArrayList list = new ArrayList(1);
-        list.add( chunk );
-        top.addLast( new DefaultMutableTupleNode( tlv, list ) );
-    }
-
-
-    private void encodeReferral( DefaultMutableTupleNode top, Referral ref )
-    {
-        Tuple referrals = new Tuple();
-        referrals.setTag( LdapTag.REFERRAL_TAG, false );
-        referrals.setLength( Length.INDEFINATE );
-        DefaultMutableTupleNode refs = new DefaultMutableTupleNode( referrals );
-
-        Iterator list = ref.getLdapUrls().iterator();
-        while( list.hasNext() )
+        else
         {
-            Tuple tlv = new Tuple();
-            tlv.setTag( UniversalTag.OCTET_STRING, true );
-            ByteBuffer chunk =
-                    ByteBuffer.wrap( ( ( String ) list.next()).getBytes() );
-            tlv.setLength( chunk.remaining() );
-            tlv.setLastValueChunk( chunk );
-            ArrayList values = new ArrayList(1);
-            values.add( chunk );
-            refs.addLast( new DefaultMutableTupleNode( tlv, values ) );
+            child = ( DefaultMutableTupleNode ) EncoderUtils.encode( "" );
+            top.addLast( child );
+            child.setParent( top );
         }
 
-        top.addLast( refs );
+        if ( result.getReferral() != null &&
+                result.getReferral().getLdapUrls().size() > 0 )
+        {
+
+            child = ( DefaultMutableTupleNode )
+                    ReferralEncoder.INSTANCE.encode( result.getReferral() );
+            top.addLast( child );
+            child.setParent( top );
+        }
     }
 }

Modified: incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/SnickersLdapEncoder.java
==============================================================================
--- incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/SnickersLdapEncoder.java	(original)
+++ incubator/directory/snickers/trunk/ldap-ber-provider/src/java/org/apache/snickers/ldap/encoder/SnickersLdapEncoder.java	Sat Aug 28 01:02:43 2004
@@ -22,13 +22,28 @@
 import org.apache.commons.codec.stateful.EncoderCallback;
 import org.apache.commons.codec.stateful.EncoderMonitor;
 import org.apache.ldap.common.message.*;
-import org.apache.snickers.ldap.encoder.abandon.AbandonRequestEncoder;
+import org.apache.snickers.ber.TupleNode;
+import org.apache.snickers.ber.TupleEncodingVisitor;
 import org.apache.snickers.ldap.encoder.bind.BindRequestEncoder;
 import org.apache.snickers.ldap.encoder.bind.BindResponseEncoder;
 import org.apache.snickers.ldap.encoder.search.SearchRequestEncoder;
 import org.apache.snickers.ldap.encoder.search.SearchResponseDoneEncoder;
 import org.apache.snickers.ldap.encoder.search.SearchResponseEntryEncoder;
-import org.apache.snickers.ber.BEREncoder;
+import org.apache.snickers.ldap.encoder.search.SearchResponseReferenceEncoder;
+import org.apache.snickers.ldap.encoder.unbind.UnbindRequestEncoder;
+import org.apache.snickers.ldap.encoder.delete.DeleteRequestEncoder;
+import org.apache.snickers.ldap.encoder.delete.DeleteResponseEncoder;
+import org.apache.snickers.ldap.encoder.add.AddRequestEncoder;
+import org.apache.snickers.ldap.encoder.add.AddResponseEncoder;
+import org.apache.snickers.ldap.encoder.compare.CompareRequestEncoder;
+import org.apache.snickers.ldap.encoder.compare.CompareResponseEncoder;
+import org.apache.snickers.ldap.encoder.extended.ExtendedRequestEncoder;
+import org.apache.snickers.ldap.encoder.extended.ExtendedResponseEncoder;
+import org.apache.snickers.ldap.encoder.abandon.AbandonRequestEncoder;
+import org.apache.snickers.ldap.encoder.modify.ModifyRequestEncoder;
+import org.apache.snickers.ldap.encoder.modify.ModifyResponseEncoder;
+import org.apache.snickers.ldap.encoder.modifyDn.ModifyDnRequestEncoder;
+import org.apache.snickers.ldap.encoder.modifyDn.ModifyDnResponseEncoder;
 
 
 
@@ -41,76 +56,113 @@
  */
 public class SnickersLdapEncoder implements StatefulEncoder
 {
-    AbandonRequestEncoder abandonReqEncoder = null;
-    BindRequestEncoder bindReqEncoder = null;
-    BindResponseEncoder bindRespEncoder = null;
-    SearchRequestEncoder searchReqEncoder = null;
-    SearchResponseDoneEncoder searchRespDoneEncoder = null;
-    SearchResponseEntryEncoder searchRespEntryEncoder = null;
-
     EncoderMonitor monitor;
-    BEREncoder encoder = new BEREncoder();
+    TupleEncodingVisitor encoder = new TupleEncodingVisitor();
 
 
     public void encode( Object obj ) throws EncoderException
     {
         Message msg = ( Message ) obj;
-
+        TupleNode root = null;
 
         switch( msg.getType().getValue() )
         {
             case( MessageTypeEnum.ABANDONREQUEST_VAL ):
-                if ( abandonReqEncoder == null )
-                {
-                    abandonReqEncoder = new AbandonRequestEncoder();
-                }
-                abandonReqEncoder.attach( encoder );
-                abandonReqEncoder.encode( ( AbandonRequest ) obj );
+                root = AbandonRequestEncoder.INSTANCE
+                        .encode( ( AbandonRequest ) msg );
+                break;
+
+            case( MessageTypeEnum.ADDREQUEST_VAL ):
+                root = AddRequestEncoder.INSTANCE
+                        .encode( ( AddRequest ) msg );
+                break;
+
+            case( MessageTypeEnum.ADDRESPONSE_VAL ):
+                root = AddResponseEncoder.INSTANCE
+                        .encode( ( AddResponse ) msg );
                 break;
 
             case( MessageTypeEnum.BINDREQUEST_VAL ):
-                if ( bindReqEncoder == null )
-                {
-                    bindReqEncoder = new BindRequestEncoder();
-                }
-                bindReqEncoder.attach( encoder );
-                bindReqEncoder.encode( ( BindRequest ) obj );
+                root = BindRequestEncoder.INSTANCE
+                        .encode( ( BindRequest ) msg );
                 break;
 
             case( MessageTypeEnum.BINDRESPONSE_VAL ):
-                if ( bindRespEncoder == null )
-                {
-                    bindRespEncoder = new BindResponseEncoder();
-                }
-                bindRespEncoder.attach( encoder );
-                bindRespEncoder.encode( ( BindResponse ) obj );
+                root = BindResponseEncoder.INSTANCE
+                        .encode( ( BindResponse ) msg );
+                break;
+
+            case( MessageTypeEnum.COMPAREREQUEST_VAL ):
+                root = CompareRequestEncoder.INSTANCE
+                    .encode( ( CompareRequest ) msg );
+
+            case( MessageTypeEnum.COMPARERESPONSE_VAL ):
+                root = CompareResponseEncoder.INSTANCE
+                    .encode( ( CompareResponse ) msg );
+
+            case( MessageTypeEnum.DELREQUEST_VAL ):
+                root = DeleteRequestEncoder.INSTANCE
+                        .encode( ( DeleteRequest ) msg );
+                break;
+
+            case( MessageTypeEnum.DELRESPONSE_VAL ):
+                root = DeleteResponseEncoder.INSTANCE
+                        .encode( ( DeleteResponse ) msg );
+                break;
+
+            case( MessageTypeEnum.EXTENDEDREQ_VAL ):
+                root = ExtendedRequestEncoder.INSTANCE
+                        .encode( ( ExtendedRequest ) msg );
+                break;
+
+            case( MessageTypeEnum.EXTENDEDRESP_VAL ):
+                root = ExtendedResponseEncoder.INSTANCE
+                        .encode( ( ExtendedResponse ) msg );
+                break;
+
+            case( MessageTypeEnum.MODIFYREQUEST_VAL ):
+                root = ModifyRequestEncoder.INSTANCE
+                        .encode( ( ModifyRequest ) msg );
+                break;
+
+            case( MessageTypeEnum.MODIFYRESPONSE_VAL ):
+                root = ModifyResponseEncoder.INSTANCE
+                        .encode( ( ModifyResponse ) msg );
+                break;
+
+            case( MessageTypeEnum.MODDNREQUEST_VAL ):
+                root = ModifyDnRequestEncoder.INSTANCE
+                        .encode( ( ModifyDnRequest ) msg );
+                break;
+
+            case( MessageTypeEnum.MODDNRESPONSE_VAL ):
+                root = ModifyDnResponseEncoder.INSTANCE
+                        .encode( ( ModifyDnResponse ) msg );
                 break;
 
             case( MessageTypeEnum.SEARCHREQUEST_VAL ):
-                if ( searchReqEncoder == null )
-                {
-                    searchReqEncoder = new SearchRequestEncoder();
-                }
-                searchReqEncoder.attach( encoder );
-                searchReqEncoder.encode( ( SearchRequest ) obj );
+                root = SearchRequestEncoder.INSTANCE
+                        .encode( ( SearchRequest ) msg );
                 break;
 
             case( MessageTypeEnum.SEARCHRESDONE_VAL ):
-                if ( searchRespDoneEncoder == null )
-                {
-                    searchRespDoneEncoder = new SearchResponseDoneEncoder();
-                }
-                searchRespDoneEncoder.attach( encoder );
-                searchRespDoneEncoder.encode( ( SearchResponseDone ) obj );
+                root = SearchResponseDoneEncoder.INSTANCE
+                        .encode( ( SearchResponseDone ) msg );
                 break;
 
             case( MessageTypeEnum.SEARCHRESENTRY_VAL ):
-                if ( searchRespEntryEncoder == null )
-                {
-                    searchRespEntryEncoder = new SearchResponseEntryEncoder();
-                }
-                searchRespEntryEncoder.attach( encoder );
-                searchRespEntryEncoder.encode( ( SearchResponseEntry ) obj );
+                root = SearchResponseEntryEncoder.INSTANCE
+                        .encode( ( SearchResponseEntry ) msg );
+                break;
+
+            case( MessageTypeEnum.SEARCHRESREF_VAL ):
+                root = SearchResponseReferenceEncoder.INSTANCE
+                        .encode( ( SearchResponseReference ) msg );
+                break;
+
+            case( MessageTypeEnum.UNBINDREQUEST_VAL ):
+                root = UnbindRequestEncoder.INSTANCE
+                        .encode( ( UnbindRequest ) msg );
                 break;
 
             default:
@@ -123,6 +175,8 @@
                 
                 throw e;
         }
+
+        root.accept( encoder );
     }
 
 
@@ -136,7 +190,6 @@
             return;
         }
     }
-
 
 
     public void setEncoderMonitor( EncoderMonitor monitor )

Mime
View raw message