directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r209523 - in /directory/sandbox/trunk/asn1-new-codec/src: java/org/apache/asn1/ldap/codec/grammars/ java/org/apache/asn1/ldap/pojo/ perfs/org/apache/ans1/ber/ test/org/apache/asn1/ldap/codec/
Date Wed, 06 Jul 2005 21:49:27 GMT
Author: elecharny
Date: Wed Jul  6 14:49:25 2005
New Revision: 209523

URL: http://svn.apache.org/viewcvs?rev=209523&view=rev
Log:
I'm a little bit lazzy tnite. So only a big commit !
- added toString() methods to many pojos
- added all the missing pojo accessors in the LdapMessage class
- a lot of minor Javadoc and comment fixes
- corrected a big bug in ModifyRequest : the modifications where not stored, except the last one !
- set some pojo's members as transient, preparing the file streaming of LdapMessage
- XXXResponse messages now inherits from LdapResponse instead of Response, to avoid a collision 
in ExtendedResponse, where we also have a Response object.

Modified:
    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/ModifyRequestGrammar.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/pojo/AddResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/BindResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/DelResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapMessage.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResult.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNRequest.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyRequest.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyResponse.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchRequest.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchResultDone.java
    directory/sandbox/trunk/asn1-new-codec/src/perfs/org/apache/ans1/ber/LdapDecoderPerf.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java
    directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.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=209523&r1=209522&r2=209523&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 Wed Jul  6 14:49:25 2005
@@ -31,8 +31,8 @@
 import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
 import org.apache.asn1.ldap.codec.utils.LdapResultEnum;
 import org.apache.asn1.ldap.pojo.LdapMessage;
+import org.apache.asn1.ldap.pojo.LdapResponse;
 import org.apache.asn1.ldap.pojo.LdapResult;
-import org.apache.asn1.ldap.pojo.Response;
 
 import org.apache.log4j.Logger;
 
@@ -140,11 +140,10 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
                             container;
-                        LdapMessage      ldapMessage          =
+                        LdapMessage          ldapMessage          =
                             ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = new LdapResult();
+                        LdapResponse         response             = ldapMessage.getLdapResponse();
+                        LdapResult           ldapResult           = new LdapResult();
                         response.setLdapResult( ldapResult );
 
                         // We don't have to allocate a LdapResult first.
@@ -233,14 +232,13 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
                             container;
-                        LdapMessage      ldapMessage          =
+                        LdapMessage          ldapMessage          =
                             ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
+                        LdapResponse         response             = ldapMessage.getLdapResponse();
+                        LdapResult           ldapResult           = response.getLdapResult();
 
                         // Get the Value and store it in the BindResponse
-                        TLV           tlv       = ldapMessageContainer.getCurrentTLV();
+                        TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                         // We have to handle the special case of a 0 length matched DN
                         if ( tlv.getLength().getLength() == 0 )
@@ -251,7 +249,7 @@
                         {
                             ldapResult.setMatchedDN( new LdapDN( tlv.getValue().getData() ) );
                         }
-                        
+
                         return;
                     }
                 } );
@@ -279,14 +277,13 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
                             container;
-                        LdapMessage      ldapMessage          =
+                        LdapMessage          ldapMessage          =
                             ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
+                        LdapResponse         response             = ldapMessage.getLdapResponse();
+                        LdapResult           ldapResult           = response.getLdapResult();
 
                         // Get the Value and store it in the BindResponse
-                        TLV           tlv          = ldapMessageContainer.getCurrentTLV();
+                        TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                         // We have to handle the special case of a 0 length error message
                         if ( tlv.getLength().getLength() == 0 )
@@ -295,9 +292,10 @@
                         }
                         else
                         {
-                            ldapResult.setErrorMessage( new LdapString( tlv.getValue().getData() ) );
+                            ldapResult.setErrorMessage( new LdapString(
+                                    tlv.getValue().getData() ) );
                         }
-                        
+
                         return;
                     }
                 } );
@@ -349,16 +347,15 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer )
                             container;
-                        LdapMessage      ldapMessage          =
+                        LdapMessage          ldapMessage          =
                             ldapMessageContainer.getLdapMessage();
-                        Response         response             = ( Response )
-                            ldapMessage.getProtocolOp();
-                        LdapResult       ldapResult           = response.getLdapResult();
+                        LdapResponse         response             = ldapMessage.getLdapResponse();
+                        LdapResult           ldapResult           = response.getLdapResult();
 
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
 
-                        if (tlv.getLength().getLength() == 0)
+                        if ( tlv.getLength().getLength() == 0 )
                         {
                             ldapResult.addReferral( LdapURL.EMPTY_STRING );
                         }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java Wed Jul  6 14:49:25 2005
@@ -33,8 +33,6 @@
 
 import org.apache.log4j.Logger;
 
-import javax.naming.directory.DirContext;
-
 
 /**
  * This class implements the ModifyRequest LDAP message. All the actions are declared in this
@@ -75,8 +73,7 @@
         // ModifyRequest ::= [APPLICATION 6] SEQUENCE { (Tag)
         // Nothing to do.
         super.transitions[LdapStatesEnum.MODIFY_REQUEST_TAG][0x66] = new GrammarTransition(
-                LdapStatesEnum.MODIFY_REQUEST_TAG,
-                LdapStatesEnum.MODIFY_REQUEST_VALUE, null );
+                LdapStatesEnum.MODIFY_REQUEST_TAG, LdapStatesEnum.MODIFY_REQUEST_VALUE, null );
 
         // LdapMessage ::= ... ModifyRequest ...
         // ModifyRequest ::= [APPLICATION 6] SEQUENCE { (Value)
@@ -128,7 +125,8 @@
                             ldapMessageContainer.getLdapMessage();
                         ModifyRequest        modifyRequest        = ldapMessage.getModifyRequest();
 
-                        TLV                  tlv = ldapMessageContainer.getCurrentTLV();
+                        TLV                  tlv                  =
+                            ldapMessageContainer.getCurrentTLV();
 
                         // Store the value.
                         if ( tlv.getLength().getLength() == 0 )
@@ -246,11 +244,11 @@
                             ldapMessageContainer.getLdapMessage();
                         ModifyRequest        modifyRequest        = ldapMessage.getModifyRequest();
 
-                        TLV                  tlv = ldapMessageContainer.getCurrentTLV();
+                        TLV                  tlv                  =
+                            ldapMessageContainer.getCurrentTLV();
 
                         // Decode the operation type
-                        int operation = IntegerDecoder.parse( tlv.getValue(),
-                                DirContext.ADD_ATTRIBUTE, DirContext.REPLACE_ATTRIBUTE );
+                        int operation = IntegerDecoder.parse( tlv.getValue(), 0, 2 );
 
                         // Store the current operation.
                         modifyRequest.setCurrentOperation( operation );
@@ -302,7 +300,8 @@
                             ldapMessageContainer.getLdapMessage();
                         ModifyRequest        modifyRequest        = ldapMessage.getModifyRequest();
 
-                        TLV                  tlv = ldapMessageContainer.getCurrentTLV();
+                        TLV                  tlv                  =
+                            ldapMessageContainer.getCurrentTLV();
 
                         // Store the value. It can't be null
                         if ( tlv.getLength().getLength() == 0 )
@@ -373,7 +372,8 @@
                             ldapMessageContainer.getLdapMessage();
                         ModifyRequest        modifyRequest        = ldapMessage.getModifyRequest();
 
-                        TLV                  tlv = ldapMessageContainer.getCurrentTLV();
+                        TLV                  tlv                  =
+                            ldapMessageContainer.getCurrentTLV();
 
                         // Store the value. It can't be null
                         if ( tlv.getLength().getLength() == 0 )
@@ -395,7 +395,7 @@
     /**
      * Get the instance of this grammar
      *
-     * @return An instance on the SearchResultEntry Grammar
+     * @return An instance on the ModifyRequest Grammar
      */
     public static IGrammar getInstance()
     {

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=209523&r1=209522&r2=209523&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 Wed Jul  6 14:49:25 2005
@@ -16,8 +16,6 @@
  */
 package org.apache.asn1.ldap.codec.grammars;
 
-import java.util.ArrayList;
-
 import org.apache.asn1.DecoderException;
 import org.apache.asn1.ber.containers.IAsn1Container;
 import org.apache.asn1.ber.grammar.AbstractGrammar;
@@ -552,7 +550,7 @@
                         SearchRequest     searchRequest =
                             ldapMessageContainer.getLdapMessage().getSearchRequest();
 
-                        searchRequest.setAttributes( new ArrayList() );
+                        searchRequest.initAttributes();
 
                         return;
                     }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AddResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AddResponse.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AddResponse.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/AddResponse.java Wed Jul  6 14:49:25 2005
@@ -22,7 +22,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddResponse extends Response
+public class AddResponse extends LdapResponse
 {
     //~ Constructors -------------------------------------------------------------------------------
 

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/BindResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/BindResponse.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/BindResponse.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/BindResponse.java Wed Jul  6 14:49:25 2005
@@ -28,7 +28,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BindResponse extends Response
+public class BindResponse extends LdapResponse
 {
     //~ Instance fields ----------------------------------------------------------------------------
 

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/CompareResponse.java Wed Jul  6 14:49:25 2005
@@ -22,7 +22,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareResponse extends Response
+public class CompareResponse extends LdapResponse
 {
     //~ Constructors -------------------------------------------------------------------------------
 

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/DelResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/DelResponse.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/DelResponse.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/DelResponse.java Wed Jul  6 14:49:25 2005
@@ -22,7 +22,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DelResponse extends Response
+public class DelResponse extends LdapResponse
 {
     //~ Constructors -------------------------------------------------------------------------------
 
@@ -35,9 +35,9 @@
     }
 
     /**
-     * Get a String representation of an DelResponse
+     * Get a String representation of a DelResponse
      *
-     * @return An DelResponse String 
+     * @return A DelResponse String 
      */
     public String toString()
     {

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedResponse.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedResponse.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ExtendedResponse.java Wed Jul  6 14:49:25 2005
@@ -29,7 +29,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExtendedResponse extends Response
+public class ExtendedResponse extends LdapResponse
 {
     //~ Instance fields ----------------------------------------------------------------------------
 

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapMessage.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapMessage.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapMessage.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapMessage.java Wed Jul  6 14:49:25 2005
@@ -26,8 +26,8 @@
 
 
 /**
- * The main ldapObject : every Ldap Message are encapsulated in it. It has a
- * messageId and Control.
+ * The main ldapObject : every Ldap Message are encapsulated in it. It contains
+ * a message Id, a operation (protocolOp) and one ore more Controls.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -47,7 +47,7 @@
     //~ Constructors -------------------------------------------------------------------------------
 
     /**
-     * Creates a new Spnego object.
+     * Creates a new LdapMessage object.
      */
     public LdapMessage()
     {
@@ -69,9 +69,9 @@
     }
 
     /**
-     * Set the Control array
+     * Add a control to the Controls array
      *
-     * @param control The Control array to store
+     * @param control The Control to add
      */
     public void addControl( Control control )
     {
@@ -100,24 +100,46 @@
     }
 
     /**
-     * Get the encapsulated message.
+     * Get the encapsulated Ldap response.
      *
-     * @return Returns the protocolOP.
+     * @return Returns the Ldap response.
      */
-    public Asn1Object getProtocolOp()
+    public LdapResponse getLdapResponse()
     {
-        return protocolOp;
+        return ( LdapResponse )protocolOp;
     }
 
     /**
-     * Get a BindResponse ldapObject, assuming that the caller knows that
+     * Get a AbandonRequest ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the BindResponse ldapObject.
+     * @return Returns the AbandonRequest ldapObject.
      */
-    public BindResponse getBindResponse()
+    public AbandonRequest getAbandonRequest()
     {
-        return ( BindResponse ) protocolOp;
+        return ( AbandonRequest ) protocolOp;
+    }
+
+    /**
+     * Get a AddRequest ldapObject, assuming that the caller knows that
+     * it is the LdapMessage exact type.
+     *
+     * @return Returns the AddRequest ldapObject.
+     */
+    public AddRequest getAddRequest()
+    {
+        return ( AddRequest ) protocolOp;
+    }
+
+    /**
+     * Get a AddResponse ldapObject, assuming that the caller knows that
+     * it is the LdapMessage exact type.
+     *
+     * @return Returns the AddResponse ldapObject.
+     */
+    public AddResponse getAddResponse()
+    {
+        return ( AddResponse ) protocolOp;
     }
 
     /**
@@ -132,47 +154,80 @@
     }
 
     /**
-     * Get a SearchRequest ldapObject, assuming that the caller knows that
+     * Get a BindResponse ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the SearchRequest ldapObject.
+     * @return Returns the BindResponse ldapObject.
      */
-    public SearchRequest getSearchRequest()
+    public BindResponse getBindResponse()
     {
-        return ( SearchRequest ) protocolOp;
+        return ( BindResponse ) protocolOp;
     }
 
     /**
-     * Get a SearchResultEntry ldapObject, assuming that the caller knows that
+     * Get a CompareRequest ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the SearchRequestEntry ldapObject.
+     * @return Returns the CompareRequest ldapObject.
      */
-    public SearchResultEntry getSearchResultEntry()
+    public CompareRequest getCompareRequest()
     {
-        return ( SearchResultEntry ) protocolOp;
+        return ( CompareRequest ) protocolOp;
     }
 
     /**
-     * Get a SearchResultReference ldapObject, assuming that the caller knows that
+     * Get a CompareResponse ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the SearchResultReference ldapObject.
+     * @return Returns the CompareResponse ldapObject.
      */
-    public SearchResultReference getSearchResultReference()
+    public CompareResponse getCompareResponse()
     {
-        return ( SearchResultReference ) protocolOp;
+        return ( CompareResponse ) protocolOp;
     }
 
     /**
-     * Get a ModifyRequest ldapObject, assuming that the caller knows that
+     * Get a DelRequest ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the ModifyRequest ldapObject.
+     * @return Returns the DelRequest ldapObject.
      */
-    public ModifyRequest getModifyRequest()
+    public DelRequest getDelRequest()
     {
-        return ( ModifyRequest ) protocolOp;
+        return ( DelRequest ) protocolOp;
+    }
+
+    /**
+     * Get a DelResponse ldapObject, assuming that the caller knows that
+     * it is the LdapMessage exact type.
+     *
+     * @return Returns the DelResponse ldapObject.
+     */
+    public DelResponse getDelResponse()
+    {
+        return ( DelResponse ) protocolOp;
+    }
+
+    /**
+     * Get a ExtendedRequest ldapObject, assuming that the caller knows that
+     * it is the LdapMessage exact type.
+     *
+     * @return Returns the ExtendedRequest ldapObject.
+     */
+    public ExtendedRequest getExtendedRequest()
+    {
+        return ( ExtendedRequest ) protocolOp;
+    }
+
+    /**
+     * Get a ExtendedResponse ldapObject, assuming that the caller knows that
+     * it is the LdapMessage exact type.
+     *
+     * @return Returns the ExtendedResponse ldapObject.
+     */
+    public ExtendedResponse getExtendedResponse()
+    {
+        return ( ExtendedResponse ) protocolOp;
     }
 
     /**
@@ -187,91 +242,91 @@
     }
 
     /**
-     * Get a DelRequest ldapObject, assuming that the caller knows that
+     * Get a ModifyDNResponse ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the DelRequest ldapObject.
+     * @return Returns the ModifyDNResponse ldapObject.
      */
-    public DelRequest getDelRequest()
+    public ModifyDNResponse getModifyDNResponse()
     {
-        return ( DelRequest ) protocolOp;
+        return ( ModifyDNResponse ) protocolOp;
     }
 
     /**
-     * Get a CompareRequest ldapObject, assuming that the caller knows that
+     * Get a ModifyRequest ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the CompareRequest ldapObject.
+     * @return Returns the ModifyRequest ldapObject.
      */
-    public CompareRequest getCompareRequest()
+    public ModifyRequest getModifyRequest()
     {
-        return ( CompareRequest ) protocolOp;
+        return ( ModifyRequest ) protocolOp;
     }
 
     /**
-     * Get a CompareResponse ldapObject, assuming that the caller knows that
+     * Get a ModifyResponse ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the CompareResponse ldapObject.
+     * @return Returns the ModifyResponse ldapObject.
      */
-    public CompareResponse getCompareResponse()
+    public ModifyResponse getModifyResponse()
     {
-        return ( CompareResponse ) protocolOp;
+        return ( ModifyResponse ) protocolOp;
     }
 
     /**
-     * Get a AddRequest ldapObject, assuming that the caller knows that
+     * Get a SearchRequest ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the AddRequest ldapObject.
+     * @return Returns the SearchRequest ldapObject.
      */
-    public AddRequest getAddRequest()
+    public SearchRequest getSearchRequest()
     {
-        return ( AddRequest ) protocolOp;
+        return ( SearchRequest ) protocolOp;
     }
 
     /**
-     * Get a AddResponse ldapObject, assuming that the caller knows that
+     * Get a SearchResultDone ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the AddResponse ldapObject.
+     * @return Returns the SearchRequestDone ldapObject.
      */
-    public AddResponse getAddResponse()
+    public SearchResultDone getSearchResultDone()
     {
-        return ( AddResponse ) protocolOp;
+        return ( SearchResultDone ) protocolOp;
     }
 
     /**
-     * Get a AbandonRequest ldapObject, assuming that the caller knows that
+     * Get a SearchResultEntry ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the AbandonRequest ldapObject.
+     * @return Returns the SearchResultEntry ldapObject.
      */
-    public AbandonRequest getAbandonRequest()
+    public SearchResultEntry getSearchResultEntry()
     {
-        return ( AbandonRequest ) protocolOp;
+        return ( SearchResultEntry ) protocolOp;
     }
 
     /**
-     * Get a ExtendedRequest ldapObject, assuming that the caller knows that
+     * Get a SearchResultReference ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the ExtendedRequest ldapObject.
+     * @return Returns the SearchResultReference ldapObject.
      */
-    public ExtendedRequest getExtendedRequest()
+    public SearchResultReference getSearchResultReference()
     {
-        return ( ExtendedRequest ) protocolOp;
+        return ( SearchResultReference ) protocolOp;
     }
 
     /**
-     * Get a ExtendedResponse ldapObject, assuming that the caller knows that
+     * Get a UnBindRequest ldapObject, assuming that the caller knows that
      * it is the LdapMessage exact type.
      *
-     * @return Returns the ExtendedResponse ldapObject.
+     * @return Returns the UnBindRequest ldapObject.
      */
-    public ExtendedResponse getExtendedResponse()
+    public UnBindRequest getUnBindRequest()
     {
-        return ( ExtendedResponse ) protocolOp;
+        return ( UnBindRequest ) protocolOp;
     }
 
     /**

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResult.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResult.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResult.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/LdapResult.java Wed Jul  6 14:49:25 2005
@@ -186,9 +186,9 @@
     }
 
     /**
-     * Get a String representation of an AddResponse
+     * Get a String representation of a LdapResult
      *
-     * @return An AddResponse String 
+     * @return A LdapResult String 
      */
     public String toString()
     {

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNRequest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNRequest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNRequest.java Wed Jul  6 14:49:25 2005
@@ -44,7 +44,7 @@
     /** If the previous RDN is to be deleted, this flag will be set to true */
     private boolean deleteOldRDN;
 
-    /** Th eoptionnal superior, which will be concatened to the newRdn */
+    /** The optional superior, which will be concatened to the newRdn */
     private LdapDN newSuperior;
 
     //~ Constructors -------------------------------------------------------------------------------
@@ -136,4 +136,27 @@
     {
         this.newSuperior = newSuperior;
     }
+    
+    /**
+     * Get a String representation of a ModifyDNRequest
+     *
+     * @return A ModifyDNRequest String 
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    ModifyDN Response\n" );
+        sb.append( "        Entry : '" ).append( entry ).append( "'\n" );
+        sb.append( "        New RDN : '" ).append( newRDN.toString() ).append( "'\n" );
+        sb.append( "        Delete old RDN : " ).append( deleteOldRDN ).append( "\n" );
+        
+        if ( newSuperior != null )
+        {
+            sb.append( "        New superior : '" ).append( newSuperior.toString() ).append( "'\n" );
+        }
+
+        return sb.toString();
+    }    
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNResponse.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNResponse.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyDNResponse.java Wed Jul  6 14:49:25 2005
@@ -17,12 +17,12 @@
 package org.apache.asn1.ldap.pojo;
 
 /**
- * An ModifyResponse Message. Its syntax is :
+ * An ModifyDNResponse Message. Its syntax is :
  *   ModifyDNResponse ::= [APPLICATION 13] LDAPResult
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModifyDNResponse extends Response
+public class ModifyDNResponse extends LdapResponse
 {
     //~ Constructors -------------------------------------------------------------------------------
 
@@ -32,5 +32,21 @@
     public ModifyDNResponse()
     {
         super( );
+    }
+
+    /**
+     * Get a String representation of a ModifyDNResponse
+     *
+     * @return A ModifyDNResponse String 
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Modify DN Response\n" );
+        sb.append( super.toString() );
+
+        return sb.toString();
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyRequest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyRequest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyRequest.java Wed Jul  6 14:49:25 2005
@@ -21,10 +21,14 @@
 import org.apache.asn1.ldap.codec.primitives.LdapString;
 import org.apache.asn1.primitives.OctetString;
 
+import org.apache.log4j.Logger;
+
 import java.util.ArrayList;
 
+import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
 import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
 
 
@@ -49,19 +53,28 @@
  */
 public class ModifyRequest extends Asn1Object
 {
+    //~ Static fields/initializers -----------------------------------------------------------------
+
+    /** The logger */
+    private static final transient Logger log = Logger.getLogger( ModifyRequest.class );
+
+    /** Logging speed up  */
+    private static final transient boolean DEBUG = log.isDebugEnabled();
+
     //~ Instance fields ----------------------------------------------------------------------------
+
     /** The DN to be modified. */
     private LdapDN object;
-    
+
     /** The modifications list. This is an array of ModificationItem. */
     private ArrayList modifications;
 
     /** The current attribute being decoded */
-    private Attribute currentAttribute;
-    
+    private transient Attribute currentAttribute;
+
     /** A local storage for the operation */
-    private int currentOperation;
-    
+    private transient int currentOperation;
+
     //~ Constructors -------------------------------------------------------------------------------
 
     /**
@@ -81,7 +94,7 @@
     {
         modifications = new ArrayList();
     }
-    
+
     /**
      * Get the entry's attributes
      *
@@ -95,11 +108,12 @@
     /**
      * Add a new modification to the list
      *
-     */
-    public void addModification(int operation)
+     * @param operation The type of operation (add, delete or replace)
+    */
+    public void addModification( int operation )
     {
         currentOperation = operation;
-        
+
         if ( currentAttribute == null )
         {
             modifications = new ArrayList();
@@ -107,67 +121,154 @@
     }
 
     /**
-     * Create a new attributeValue
+     * Add a new attributeTypeAndValue
+     * 
      * @param type The attribute's name
      */
     public void addAttributeTypeAndValues( LdapString type )
     {
         currentAttribute = new BasicAttribute( type.toString() );
-        modifications.add(currentAttribute);
-    }
 
-    /**
-     * Set the modification opeation
-     * @param type The attribute's name
-     */
-    public void setOperations( int operation )
-    {
+        int operation = 0;
+
+        switch ( currentOperation )
+        {
+
+            case 0 : // add
+                operation = DirContext.ADD_ATTRIBUTE;
+                break;
+
+            case 1 : // delete
+                operation = DirContext.REMOVE_ATTRIBUTE;
+                break;
+
+            case 2 : // replace
+                operation = DirContext.REPLACE_ATTRIBUTE;
+                break;
+        }
+
         ModificationItem modification = new ModificationItem( operation, currentAttribute );
         modifications.add( modification );
     }
 
     /**
      * Add a new value to the current attribute
-     * @param value
+     * 
+     * @param value The value to add
      */
     public void addAttributeValue( OctetString value )
     {
         currentAttribute.add( value );
     }
-    
+
     /**
      * Get the modification's DN
+     * 
      * @return Returns the object.
      */
-    public String getObject() 
+    public String getObject()
     {
-        return ( object == null ? "" : object.toString() );
+        return ( ( object == null ) ? "" : object.toString() );
     }
-    
+
     /**
      * Set the modification DN.
-     * @param object The object to set.
+     * 
+     * @param object The DN to set.
      */
-    public void setObject(LdapDN object) 
+    public void setObject( LdapDN object )
     {
         this.object = object;
     }
-    
+
     /**
      * Get the current operation
+     * 
      * @return Returns the currentOperation.
      */
-    public int getCurrentOperation() 
+    public int getCurrentOperation()
     {
         return currentOperation;
     }
-    
+
     /**
      * Store the current operation
+     * 
      * @param currentOperation The currentOperation to set.
      */
-    public void setCurrentOperation(int currentOperation) 
+    public void setCurrentOperation( int currentOperation )
     {
         this.currentOperation = currentOperation;
+    }
+
+    /**
+     * Get a String representation of a ModifyRequest
+     *
+     * @return A ModifyRequest String 
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Modify Request\n" );
+        sb.append( "        Object : '" ).append( object ).append( "'\n" );
+
+        if ( modifications != null )
+        {
+
+            for ( int i = 0; i < modifications.size(); i++ )
+            {
+
+                ModificationItem modification = ( ModificationItem ) modifications.get( i );
+
+                sb.append( "            Modification[" ).append( i ).append( "]\n" );
+                sb.append( "                Operation : " );
+
+                switch ( modification.getModificationOp() )
+                {
+
+                    case DirContext.ADD_ATTRIBUTE :
+                        sb.append( " add\n" );
+                        break;
+
+                    case DirContext.REPLACE_ATTRIBUTE :
+                        sb.append( " replace\n" );
+                        break;
+
+                    case DirContext.REMOVE_ATTRIBUTE :
+                        sb.append( " delete\n" );
+                        break;
+                }
+
+                sb.append( "                Modification\n" );
+
+                Attribute attribute = modification.getAttribute();
+
+                try
+                {
+                    sb.append( "                    Type : '" ).append( attribute.getID() ).append(
+                        "'\n" );
+                    sb.append( "                    Vals\n" );
+
+                    for ( int j = 0; j < attribute.size(); j++ )
+                    {
+
+
+                        OctetString attributeValue = ( OctetString ) attribute.get( j );
+                        sb.append( "                        Val[" ).append( j ).append( "] : '" )
+                          .append( attributeValue.toString() ).append( "' \n" );
+
+                    }
+                }
+                catch ( NamingException ne )
+                {
+                    log.error( "Naming exception will printing the '" + attribute.getID() +
+                        "'" );
+                }
+            }
+        }
+
+        return sb.toString();
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyResponse.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyResponse.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyResponse.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/ModifyResponse.java Wed Jul  6 14:49:25 2005
@@ -22,7 +22,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModifyResponse extends Response
+public class ModifyResponse extends LdapResponse
 {
     //~ Constructors -------------------------------------------------------------------------------
 
@@ -32,5 +32,21 @@
     public ModifyResponse()
     {
         super( );
+    }
+
+    /**
+     * Get a String representation of a ModifyResponse
+     *
+     * @return A ModifyResponse String 
+     */
+    public String toString()
+    {
+
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Modify Response\n" );
+        sb.append( super.toString() );
+
+        return sb.toString();
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchRequest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchRequest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchRequest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchRequest.java Wed Jul  6 14:49:25 2005
@@ -49,22 +49,23 @@
     private int sizeLimit;
 
     /** The time limit (max time to process the response before returning the result) */
-    private int     timeLimit;
+    private int timeLimit;
 
-    /** DOCUMENT ME! */
+    /** An indicator as to whether search results will contain
+     both attribute types and values, or just attribute types.  Setting
+     this field to TRUE causes only attribute types (no values) to be
+     returned.  Setting this field to FALSE causes both attribute types
+     and values to be returned. */
     private boolean typesOnly;
 
     /** The filter tree */
     private Filter filter;
 
-    /** The length of the attributes */
-    private transient int attributesExpectedLength;
-    
     /** The list of attributes to get */
-    private ArrayList  attributes;
-    
+    private ArrayList attributes;
+
     /** The current filter. This is used while decoding a PDU */
-    private Filter currentFilter;
+    private transient Filter currentFilter;
 
     //~ Constructors -------------------------------------------------------------------------------
 
@@ -74,7 +75,7 @@
     public SearchRequest()
     {
         super( );
-        
+
         currentFilter = null;
     }
 
@@ -95,32 +96,31 @@
      * 
      * @param attribute The attribute to add to the list
      */
-    public void addAttribute (LdapString attribute) {
-        attributes.add(attribute);
+    public void addAttribute( LdapString attribute )
+    {
+        attributes.add( attribute );
     }
-    
+
     /**
-     * DOCUMENT ME!
-     *
-     * @param attributes The attributes to set.
+     * Initialize the attributes list
      */
-    public void setAttributes( ArrayList attributes )
+    public void initAttributes()
     {
-        this.attributes = attributes;
+        attributes = new ArrayList();
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the base object
      *
      * @return Returns the baseObject.
      */
     public String getBaseObject()
     {
-        return ( baseObject == null ? null : baseObject.toString() );
+        return ( ( baseObject == null ) ? null : baseObject.toString() );
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the base object
      *
      * @param baseObject The baseObject to set.
      */
@@ -130,7 +130,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the derefAliases flag
      *
      * @return Returns the derefAliases.
      */
@@ -140,7 +140,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the derefAliases flag
      *
      * @param derefAliases The derefAliases to set.
      */
@@ -150,7 +150,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the filter
      *
      * @return Returns the filter.
      */
@@ -160,7 +160,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the filter
      *
      * @param filter The filter to set.
      */
@@ -170,7 +170,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the search scope
      *
      * @return Returns the scope.
      */
@@ -180,7 +180,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the search scope
      *
      * @param scope The scope to set.
      */
@@ -190,7 +190,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the size limit
      *
      * @return Returns the sizeLimit.
      */
@@ -200,7 +200,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the size limit
      *
      * @param sizeLimit The sizeLimit to set.
      */
@@ -210,7 +210,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the time limit
      *
      * @return Returns the timeLimit.
      */
@@ -220,7 +220,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the time limit
      *
      * @param timeLimit The timeLimit to set.
      */
@@ -230,7 +230,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Get the typesOnly flag
      *
      * @return Returns the typesOnly.
      */
@@ -240,7 +240,7 @@
     }
 
     /**
-     * DOCUMENT ME!
+     * Set the typesOnly flag
      *
      * @param typesOnly The typesOnly to set.
      */
@@ -248,34 +248,24 @@
     {
         this.typesOnly = typesOnly;
     }
-    
+
     /**
+     * Get the current dilter
+     *
      * @return Returns the currentFilter.
      */
-    public Filter getCurrentFilter() 
+    public Filter getCurrentFilter()
     {
         return currentFilter;
     }
-    
+
     /**
+     * Set the current dilter
+     *
      * @param currentFilter The currentFilter to set.
      */
-    public void setCurrentFilter(Filter currentFilter) 
+    public void setCurrentFilter( Filter currentFilter )
     {
         this.currentFilter = currentFilter;
-    }
-    
-    /**
-     * @return Returns the attributesExpectedLength.
-     */
-    public int getAttributesExpectedLength() {
-        return attributesExpectedLength;
-    }
-    
-    /**
-     * @param attributesExpectedLength The attributesExpectedLength to set.
-     */
-    public void setAttributesExpectedLength(int attributesExpectedLength) {
-        this.attributesExpectedLength = attributesExpectedLength;
     }
 }

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchResultDone.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchResultDone.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchResultDone.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/pojo/SearchResultDone.java Wed Jul  6 14:49:25 2005
@@ -24,7 +24,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultDone extends Response
+public class SearchResultDone extends LdapResponse
 {
     //~ Constructors -------------------------------------------------------------------------------
 

Modified: directory/sandbox/trunk/asn1-new-codec/src/perfs/org/apache/ans1/ber/LdapDecoderPerf.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/perfs/org/apache/ans1/ber/LdapDecoderPerf.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/perfs/org/apache/ans1/ber/LdapDecoderPerf.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/perfs/org/apache/ans1/ber/LdapDecoderPerf.java Wed Jul  6 14:49:25 2005
@@ -117,7 +117,7 @@
             //bindRequestContainer.free();
             LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer )
                 .getLdapMessage();
-            BindRequest br      = ( BindRequest ) ( message.getProtocolOp() );
+            BindRequest br      = message.getBindRequest();
 
             System.out.println( "BindRequest decoded :" );
             System.out.println( "	MessageId 	= " + message.getMessageId() );

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/DelResponseTest.java Wed Jul  6 14:49:25 2005
@@ -89,7 +89,7 @@
     	
         // Check the decoded DelResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        DelResponse delResponse      = ( DelResponse ) ( message.getProtocolOp() );
+        DelResponse delResponse      = message.getDelResponse();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, delResponse.getLdapResult().getResultCode() );

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/LdapDecoderTest.java Wed Jul  6 14:49:25 2005
@@ -79,9 +79,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode a BindRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -92,8 +93,9 @@
             Assert.fail( de.getMessage() );
         }
 
+        // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br      = ( BindRequest ) ( message.getProtocolOp() );
+        BindRequest br      = message.getBindRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 3, br.getVersion() );
@@ -126,9 +128,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode a BindRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -139,8 +142,9 @@
             Assert.fail( de.getMessage() );
         }
 
+        // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br      = ( BindRequest ) ( message.getProtocolOp() );
+        BindRequest br      = message.getBindRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 3, br.getVersion() );
@@ -171,10 +175,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
-        // First block of data
+        // Decode a BindRequest PDU first block of data
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -198,6 +202,7 @@
 
         stream.flip();
 
+        // Decode a BindRequest PDU second block of data
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -208,8 +213,9 @@
             Assert.fail( de.getMessage() );
         }
 
+        // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        BindRequest br      = ( BindRequest ) ( message.getProtocolOp() );
+        BindRequest br      = message.getBindRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 3, br.getVersion() );
@@ -248,9 +254,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode a BindRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -294,9 +301,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode a BindRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -339,9 +347,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode a BindRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyDNResponseTest.java Wed Jul  6 14:49:25 2005
@@ -73,9 +73,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode the ModifyDNResponse PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -86,8 +87,9 @@
             Assert.fail( de.getMessage() );
         }
     	
+        // Check the decoded ModifyDNResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyDNResponse modifyDNResponse      = ( ModifyDNResponse ) ( message.getProtocolOp() );
+        ModifyDNResponse modifyDNResponse      = message.getModifyDNResponse();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, modifyDNResponse.getLdapResult().getResultCode() );

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyRequestTest.java Wed Jul  6 14:49:25 2005
@@ -24,6 +24,7 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.ModificationItem;
 
 import org.apache.asn1.DecoderException;
 import org.apache.asn1.ber.Asn1Decoder;
@@ -84,7 +85,7 @@
                 0x04, 0x05, 'P', 'a', 'r', 'i', 's',
 
                 0x30, 0x14,         //      modification    SEQUENCE OF *SEQUENCE* {
-                0x0A, 0x01, 0x02,   //         operation       ENUMERATED {
+                0x0A, 0x01, 0x00,   //         operation       ENUMERATED {
                 					//             add     (0),
                 					//             delete  (1),
                 					//             replace (2) },
@@ -97,9 +98,10 @@
 
         stream.flip();
 
-        // Allocate a ModifyRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode a ModifyRequest PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -110,9 +112,10 @@
             Assert.fail( de.getMessage() );
         }
     	
+        // Check the decoded PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
         ModifyRequest modifyRequest      = message.getModifyRequest();
-
+        
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "cn=testModify, ou=users, ou=system", modifyRequest.getObject() );
 
@@ -135,7 +138,8 @@
         attrsVals.add("[74][65][73][74]");
         typesVals.put("attrs", attrsVals);
         
-        BasicAttribute attributeValue = (BasicAttribute)modifications.get( 1 );
+        ModificationItem modification = (ModificationItem)modifications.get( 1 );
+        BasicAttribute attributeValue = (BasicAttribute)modification.getAttribute();
             
         Assert.assertTrue( expectedTypes.contains( attributeValue.getID() ) );
             

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/ModifyResponseTest.java Wed Jul  6 14:49:25 2005
@@ -73,9 +73,10 @@
 
         stream.flip();
 
-        // Allocate a BindRequest Container
+        // Allocate a LdapMessage Container
         IAsn1Container ldapMessageContainer = new LdapMessageContainer();
 
+        // Decode a ModifyResponse PDU
         try
         {
             ldapDecoder.decode( stream, ldapMessageContainer );
@@ -86,8 +87,9 @@
             Assert.fail( de.getMessage() );
         }
     	
+        // Check the decoded ModifyResponse PDU
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        ModifyResponse modifyResponse      = ( ModifyResponse ) ( message.getProtocolOp() );
+        ModifyResponse modifyResponse      = message.getModifyResponse();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, modifyResponse.getLdapResult().getResultCode() );

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchRequestTest.java Wed Jul  6 14:49:25 2005
@@ -39,6 +39,8 @@
 import junit.framework.TestCase;
 
 /**
+ * A test case for SearchRequest messages
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public class SearchRequestTest extends TestCase {
@@ -129,7 +131,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -276,7 +278,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -419,7 +421,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -545,7 +547,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -638,7 +640,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -734,7 +736,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -831,7 +833,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -927,7 +929,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1023,7 +1025,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1120,7 +1122,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1216,7 +1218,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "uid=akarasulu,dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1306,7 +1308,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 33, message.getMessageId() );
         Assert.assertEquals( "dc=example,dc=com", sr.getBaseObject().toString() );
@@ -1411,7 +1413,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchRequest sr      = ( SearchRequest ) ( message.getProtocolOp() );
+        SearchRequest sr      = message.getSearchRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( "dc=example,dc=com", sr.getBaseObject().toString() );

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/SearchResultDoneTest.java Wed Jul  6 14:49:25 2005
@@ -87,7 +87,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        SearchResultDone searchResultDone      = ( SearchResultDone ) ( message.getProtocolOp() );
+        SearchResultDone searchResultDone      = message.getSearchResultDone();
 
         Assert.assertEquals( 1, message.getMessageId() );
         Assert.assertEquals( 0, searchResultDone.getLdapResult().getResultCode() );

Modified: directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java?rev=209523&r1=209522&r2=209523&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/test/org/apache/asn1/ldap/codec/UnBindRequestTest.java Wed Jul  6 14:49:25 2005
@@ -74,7 +74,7 @@
         }
     	
         LdapMessage message = ( ( LdapMessageContainer ) ldapMessageContainer ).getLdapMessage();
-        UnBindRequest br      = ( UnBindRequest ) ( message.getProtocolOp() );
+        UnBindRequest br      = message.getUnBindRequest();
 
         Assert.assertEquals( 1, message.getMessageId() );
     }



Mime
View raw message