directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r366690 [1/2] - in /directory/trunk: apacheds/src/main/java/org/apache/ldap/server/partition/ ldap-common/src/main/java/org/apache/ldap/common/message/ ldap-common/src/test/java/org/apache/ldap/common/message/ ldap-protocol/src/main/java/or...
Date Sat, 07 Jan 2006 07:19:21 GMT
Author: akarasulu
Date: Fri Jan  6 23:18:44 2006
New Revision: 366690

URL: http://svn.apache.org/viewcvs?rev=366690&view=rev
Log:
changes ...

 o cleaned up code with formatting, import, headers, @author tags
 o rearranged msg hierarchy to make result response returning requests generate
   the result response with LdapResult to return
 o cleaned up test cases and handlers that depended on this code


Added:
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponseRequest.java   (with props)
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/HandlerUtil.java   (with props)
Modified:
    directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponseImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequest.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequest.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ManyReplyRequest.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequest.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequest.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponse.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SingleReplyRequest.java
    directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/UnbindRequest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AddRequestImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindRequestImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindResponseImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/CompareRequestImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/DeleteRequestImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyDnRequestImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyRequestImplTest.java
    directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseDoneImplTest.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/LdapProtocolProvider.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/AddHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/BindHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/CompareHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/DeleteHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ExtendedHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyDnHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/ModifyHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/PersistentSearchListener.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchHandler.java
    directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/SearchResponseIterator.java

Modified: directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java
URL: http://svn.apache.org/viewcvs/directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java (original)
+++ directory/trunk/apacheds/src/main/java/org/apache/ldap/server/partition/DirectoryPartitionNexusProxy.java Fri Jan  6 23:18:44 2006
@@ -385,42 +385,45 @@
     public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
             throws NamingException
     {
-        SearchResultFilteringEnumeration results = ( SearchResultFilteringEnumeration ) 
-            search( base, env, filter, searchCtls, null );
+        NamingEnumeration ne = search( base, env, filter, searchCtls, null );
         
-        if ( searchCtls.getTimeLimit() + searchCtls.getCountLimit() > 0 )
+        if ( ne instanceof SearchResultFilteringEnumeration )
         {
-            // this will be he last filter added so other filters before it must 
-            // have passed/approved of the entry to be returned back to the client
-            // so the candidate we have is going to be returned for sure
-            results.addResultFilter( new SearchResultFilter(){
-                final long startTime = System.currentTimeMillis();
-                int count = 1;  // with prefetch we've missed one which is ok since 1 is the minimum
-                public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) throws NamingException
-                {
-                    if ( controls.getTimeLimit() > 0 )
+            SearchResultFilteringEnumeration results = ( SearchResultFilteringEnumeration ) ne;
+            if ( searchCtls.getTimeLimit() + searchCtls.getCountLimit() > 0 )
+            {
+                // this will be he last filter added so other filters before it must 
+                // have passed/approved of the entry to be returned back to the client
+                // so the candidate we have is going to be returned for sure
+                results.addResultFilter( new SearchResultFilter(){
+                    final long startTime = System.currentTimeMillis();
+                    int count = 1;  // with prefetch we've missed one which is ok since 1 is the minimum
+                    public boolean accept( Invocation invocation, SearchResult result, SearchControls controls ) throws NamingException
                     {
-                        long runtime = System.currentTimeMillis() - startTime;
-                        if ( runtime > controls.getTimeLimit() )
+                        if ( controls.getTimeLimit() > 0 )
                         {
-                            throw new LdapTimeLimitExceededException();
+                            long runtime = System.currentTimeMillis() - startTime;
+                            if ( runtime > controls.getTimeLimit() )
+                            {
+                                throw new LdapTimeLimitExceededException();
+                            }
                         }
+                        
+                        if ( controls.getCountLimit() > 0 )
+                        {
+                           if ( count > controls.getCountLimit() )
+                           {
+                               throw new LdapSizeLimitExceededException();
+                           }
+                        }
+                        
+                        count++;
+                        return true;
                     }
-                    
-                    if ( controls.getCountLimit() > 0 )
-                    {
-                       if ( count > controls.getCountLimit() )
-                       {
-                           throw new LdapSizeLimitExceededException();
-                       }
-                    }
-                    
-                    count++;
-                    return true;
-                }
-            });
+                });
+            }
         }
-        return results;
+        return ne;
     }
 
 

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AbstractResultResponse.java Fri Jan  6 23:18:44 2006
@@ -24,11 +24,10 @@
  * @author $Author: akarasulu $
  * @version $Revision$
  */
-public abstract class AbstractResultResponse
-    extends AbstractResponse implements ResultResponse
+public abstract class AbstractResultResponse extends AbstractResponse implements ResultResponse
 {
     /** Response result components */
-    private LdapResult result;
+    private LdapResult result = new LdapResultImpl( this );
 
 
     // ------------------------------------------------------------------------
@@ -43,8 +42,7 @@
      * @param id the response eliciting this Request
      * @param type the message type of the response
      */
-    protected AbstractResultResponse( final int id,
-        final MessageTypeEnum type )
+    protected AbstractResultResponse( final int id, final MessageTypeEnum type )
     {
         super( id, type );
     }
@@ -63,18 +61,6 @@
     public LdapResult getLdapResult()
     {
         return result;
-    }
-
-
-    /**
-     * Sets the LdapResult components of this Response.
-     *
-     * @param ldapResult the LdapResult for this Response.
-     */
-    public void setLdapResult( LdapResult ldapResult )
-    {
-        lockCheck( "Attempt to alter the LdapResult for a locked Response!" );
-        result = ldapResult;
     }
 
 

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -25,8 +25,7 @@
 /**
  * Lockable add request implemenation.
  *
- * @author <a href="mailto:dev@directory.apache.org">
- * Apache Directory Project</a>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
 public class AddRequestImpl extends AbstractAbandonableRequest implements AddRequest
@@ -34,10 +33,9 @@
     static final long serialVersionUID = 7534132448349520346L;
     /** Distinguished name of the new entry. */
     private String entry;
-    
     /** A MultiMap of the new entry's attributes and their values */
     private Attributes attributes;
-
+    private AddResponse response;
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -121,6 +119,22 @@
     public MessageTypeEnum getResponseType()
     {
         return RESP_TYPE;
+    }
+    
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new AddResponseImpl( getMessageId() );
+        }
+        
+        return response;
     }
 
 

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponse.java Fri Jan  6 23:18:44 2006
@@ -35,8 +35,7 @@
  * @author $Author: akarasulu $
  * @version $Revision$
  */
-public interface AddResponse
-    extends ResultResponse
+public interface AddResponse extends ResultResponse
 {
     /** Add response message type enumeration value */
     MessageTypeEnum TYPE = MessageTypeEnum.ADDRESPONSE ;

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponseImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponseImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponseImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/AddResponseImpl.java Fri Jan  6 23:18:44 2006
@@ -20,10 +20,10 @@
 /**
  * Lockable AddResponse implementation.
  * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class AddResponseImpl
-    extends AbstractResultResponse implements AddResponse
+public class AddResponseImpl extends AbstractResultResponse implements AddResponse
 {
     // ------------------------------------------------------------------------
     // Constructors
@@ -57,5 +57,4 @@
 
         return sb.toString();
     }
-    
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -45,6 +45,7 @@
     private boolean isSimple = true;
     /** Bind behavoir exhibity by protocol version */
     private boolean isVersion3 = true;
+    public BindResponse response;
 
 
     // ------------------------------------------------------------------------
@@ -253,8 +254,24 @@
     {
         return RESP_TYPE;
     }
+    
 
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new BindResponseImpl( getMessageId() );
+        }
+        
+        return response;
+    }
 
+    
     public boolean equals( Object obj )
     {
         if ( obj == this )

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/BindResponse.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: BindResponse.java,v 1.5 2003/07/31 21:44:49 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -32,12 +22,10 @@
  * request message.  BindResponse consists simply of an indication from the
  * server of the status of the client's request for authentication.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
- * @version $Revision$
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
  */
-public interface BindResponse
-    extends ResultResponse
+public interface BindResponse extends ResultResponse
 {
     /** Bind response message type enumeration value */
     MessageTypeEnum TYPE = MessageTypeEnum.BINDRESPONSE ;

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequest.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: CompareRequest.java,v 1.5 2003/04/30 00:04:14 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -31,8 +21,7 @@
  * Compare request protocol message that tests an entry to see if it abides by
  * an attribute value assertion.
  * 
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
 public interface CompareRequest extends SingleReplyRequest, AbandonableRequest

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.ldap.common.message;
 
+
 import java.util.Arrays;
 
 import org.apache.ldap.common.util.StringTools;
@@ -24,8 +25,7 @@
 /**
  * Lockable comparison request implementation.
  * 
- * @author <a href="mailto:dev@directory.apache.org">
- * Apache Directory Project</a>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
 public class CompareRequestImpl extends AbstractAbandonableRequest implements CompareRequest
@@ -37,6 +37,7 @@
     private String attrId;
     /** The value of the attribute used in the comparison */
     private byte[] attrVal;
+    private CompareResponse response;
 
 
     // ------------------------------------------------------------------------
@@ -161,6 +162,21 @@
         return RESP_TYPE;
     }
 
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new CompareResponseImpl( getMessageId() );
+        }
+        
+        return response;
+    }
 
     /**
      * Checks to see if an object is equivalent to this CompareRequest.

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/CompareResponse.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: CompareResponse.java,v 1.2 2003/05/02 00:49:06 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -31,12 +21,10 @@
  * Compare protocol response message used to confirm the results of a compare
  * request message.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public interface CompareResponse
-    extends ResultResponse
+public interface CompareResponse extends ResultResponse
 {
     /** Compare response message type enumeration value */
     MessageTypeEnum TYPE = MessageTypeEnum.COMPARERESPONSE ;

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequest.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: DeleteRequest.java,v 1.4 2003/04/27 16:54:28 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -31,8 +21,7 @@
  * Delete request protocol message used to remove an existing leaf entry from
  * the directory.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
 public interface DeleteRequest extends SingleReplyRequest, AbandonableRequest

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -20,8 +20,7 @@
 /**
  * Lockable delete request implementation.
  * 
- * @author <a href="mailto:dev@directory.apache.org">
- * Apache Directory Project</a>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
 public class DeleteRequestImpl extends AbstractAbandonableRequest implements DeleteRequest
@@ -29,6 +28,7 @@
     static final long serialVersionUID = 3187847454305567542L;
     /** The distinguished name of the entry to delete */
     private String name;
+    private DeleteResponse response;
 
 
     // ------------------------------------------------------------------------
@@ -95,6 +95,22 @@
     }
 
 
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new DeleteResponseImpl( getMessageId() );
+        }
+        
+        return response;
+    }
+
+    
     /**
      * Checks to see if an object is equivalent to this DeleteRequest.  First
      * there's a quick test to see if the obj is the same object as this

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/DeleteResponse.java Fri Jan  6 23:18:44 2006
@@ -14,30 +14,18 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: DeleteResponse.java,v 1.2 2003/05/02 00:49:06 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
 
 
 /**
  * Delete protocol response message used to confirm the results of a delete
  * request message.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public interface DeleteResponse
-    extends ResultResponse
+public interface DeleteResponse extends ResultResponse
 {
     /** Delete response message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.DELRESPONSE ;
+    MessageTypeEnum TYPE = MessageTypeEnum.DELRESPONSE;
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequest.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: ExtendedRequest.java,v 1.4 2003/07/31 21:44:48 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -54,16 +44,15 @@
  *  OCTET STRING.
  * <pre><br>
  * 
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
 public interface ExtendedRequest extends SingleReplyRequest
 {
     /** Extended request message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDREQ ;
+    MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDREQ;
     /** Extended response message type enumeration value */
-    MessageTypeEnum RESP_TYPE = ExtendedResponse.TYPE ;
+    MessageTypeEnum RESP_TYPE = ExtendedResponse.TYPE;
 
     /**
      * Gets the Object Idendifier corresponding to the extended request type.
@@ -71,14 +60,14 @@
      *
      * @return the dotted-decimal representation as a String of the OID
      */
-    String getOid() ;
+    String getOid();
 
     /**
      * Sets the Object Idendifier corresponding to the extended request type.
      *
-     * @param a_oid the dotted-decimal representation as a String of the OID
+     * @param oid the dotted-decimal representation as a String of the OID
      */
-    void setOid( String a_oid ) ;
+    void setOid( String oid );
 
     /**
      * Gets the extended request's <b>requestValue</b> portion of the PDU.  The
@@ -87,12 +76,12 @@
      *
      * @return byte array of data
      */
-    byte [] getPayload() ;
+    byte [] getPayload();
 
     /**
      * Sets the extended request's <b>requestValue</b> portion of the PDU.
      *
-     * @param a_payload byte array of data encapsulating ext. req. parameters
+     * @param payload byte array of data encapsulating ext. req. parameters
      */
-    void setPayload( byte [] a_payload ) ;
+    void setPayload( byte [] payload );
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -28,14 +28,14 @@
  * Apache Directory Project</a>
  * @version $Rev$
  */
-public class ExtendedRequestImpl
-    extends AbstractRequest implements ExtendedRequest
+public class ExtendedRequestImpl extends AbstractRequest implements ExtendedRequest
 {
     static final long serialVersionUID = 7916990159044177480L;
     /** Extended request's Object Identifier or <b>requestName</b> */
     private String oid;
     /** Extended request's payload or <b>requestValue</b> */
     private byte [] payload;
+    private ExtendedResponse response;
 
 
     // -----------------------------------------------------------------------
@@ -123,6 +123,22 @@
     public MessageTypeEnum getResponseType()
     {
         return RESP_TYPE;
+    }
+    
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new ExtendedResponseImpl( getMessageId() );
+        }
+        
+        return response;
     }
 
 

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ExtendedResponse.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: ExtendedResponse.java,v 1.4 2003/07/31 21:44:48 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -31,15 +21,13 @@
  * Extended protocol response message used to confirm the results of a extended
  * request message.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public interface ExtendedResponse
-    extends ResultResponse
+public interface ExtendedResponse extends ResultResponse
 {
     /** Extended response message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDRESP ;
+    MessageTypeEnum TYPE = MessageTypeEnum.EXTENDEDRESP;
 
     /**
      * Gets the OID uniquely identifying this extended response (a.k.a. its
@@ -47,27 +35,26 @@
      *
      * @return the OID of the extended response type.
      */
-    String getResponseName() ;
+    String getResponseName();
 
     /**
-     * Sets the OID uniquely identifying this extended response (a.k.a. its
-     * name).
+     * Sets the OID uniquely identifying this extended response (a.k.a. its name).
      *
-     * @param a_oid the OID of the extended response type.
+     * @param oid the OID of the extended response type.
      */
-    void setResponseName( String a_oid ) ;
+    void setResponseName( String oid );
 
     /**
      * Gets the reponse OID specific encoded response values.
      *
      * @return the response specific encoded response values.
      */
-    byte [] getResponse() ;
+    byte [] getResponse();
 
     /**
      * Sets the reponse OID specific encoded response values.
      *
-     * @param a_value the response specific encoded response values.
+     * @param value the response specific encoded response values.
      */
-    void setResponse( byte [] a_value ) ;
+    void setResponse( byte [] value );
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ManyReplyRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ManyReplyRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ManyReplyRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ManyReplyRequest.java Fri Jan  6 23:18:44 2006
@@ -25,7 +25,7 @@
  * Apache Directory Project</a>
  * @version $Rev$
  */
-public interface ManyReplyRequest extends Request
+public interface ManyReplyRequest extends ResultResponseRequest
 {
     /**
      * Gets the various types of messages that can be generated by this kind of

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequest.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: ModifyDnRequest.java,v 1.4 2003/07/31 21:44:48 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -65,16 +55,15 @@
  * Note that this operation can move an entry and change its Rdn at the same
  * time in fact it might have no choice to comply with name forms.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
 public interface ModifyDnRequest extends SingleReplyRequest, AbandonableRequest
 {
     /** Modify DN request message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.MODDNREQUEST ;
+    MessageTypeEnum TYPE = MessageTypeEnum.MODDNREQUEST;
     /** Modify DN response message type enumeration value */
-    MessageTypeEnum RESP_TYPE = ModifyDnResponse.TYPE ;
+    MessageTypeEnum RESP_TYPE = ModifyDnResponse.TYPE;
 
     /**
      * Gets the entry's distinguished name representing the <b>entry</b> PDU
@@ -82,15 +71,15 @@
      *
      * @return the distinguished name of the entry.
      */
-    String getName() ;
+    String getName();
 
     /**
      * Sets the entry's distinguished name representing the <b>entry</b> PDU
      * field.
      *
-     * @param a_name the distinguished name of the entry.
+     * @param name the distinguished name of the entry.
      */
-    void setName( String a_name ) ;
+    void setName( String name );
 
     /**
      * Gets the new relative distinguished name for the entry which represents
@@ -98,15 +87,15 @@
      *
      * @return the relative dn with one component
      */
-    String getNewRdn() ;
+    String getNewRdn();
 
     /**
      * Sets the new relative distinguished name for the entry which represents
      * the PDU's <b>newrdn</b> field.
      *
-     * @param a_newRdn the relative dn with one component
+     * @param newRdn the relative dn with one component
      */
-    void setNewRdn( String a_newRdn ) ;
+    void setNewRdn( String newRdn );
 
     /**
      * Gets the flag which determines if the old Rdn attribute is to be removed
@@ -115,17 +104,17 @@
      *
      * @return true if the old rdn is to be deleted, false if it is not
      */
-    boolean getDeleteOldRdn() ;
+    boolean getDeleteOldRdn();
 
     /**
      * Sets the flag which determines if the old Rdn attribute is to be removed
      * from the entry when the new Rdn is used in its stead.  This property
      * corresponds to the <b>deleteoldrdn</p> PDU field.
      *
-     * @param a_deleteOldRdn true if the old rdn is to be deleted, false if it
+     * @param deleteOldRdn true if the old rdn is to be deleted, false if it
      * is not
      */
-    void setDeleteOldRdn( boolean a_deleteOldRdn ) ;
+    void setDeleteOldRdn( boolean deleteOldRdn );
 
     /**
      * Gets the optional distinguished name of the new superior entry where the
@@ -135,7 +124,7 @@
      *
      * @return the dn of the superior entry the candidate entry is moved under.
      */
-    String getNewSuperior() ;
+    String getNewSuperior();
 
     /**
      * Sets the optional distinguished name of the new superior entry where the
@@ -144,10 +133,10 @@
      * rather than a move operation.  Setting this property to a non-null value
      * toggles the move flag obtained via the <code>isMove</code> method.
      *
-     * @param a_newSuperior the dn of the superior entry the candidate entry
+     * @param newSuperior the dn of the superior entry the candidate entry
      * for DN modification is moved under.
      */
-    void setNewSuperior( String a_newSuperior ) ;
+    void setNewSuperior( String newSuperior );
 
     /**
      * Gets whether or not this request is a DN change resulting in a move
@@ -157,5 +146,5 @@
      * @return true if the newSuperior property is <b>NOT</b> null, false
      * otherwise.
      */
-    boolean isMove() ;
+    boolean isMove();
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -28,16 +28,18 @@
     static final long serialVersionUID = 1233507339633051696L;
     
     /** PDU's modify Dn candidate <b>entry</b> distinguished name property */
-    private String name ;
+    private String name;
     
     /** PDU's <b>newrdn</b> relative distinguished name property */
-    private String newRdn ;
+    private String newRdn;
     
     /** PDU's <b>newSuperior</b> distinguished name property */
-    private String newSuperior ;
+    private String newSuperior;
     
     /** PDU's <b>deleteOldRdn</b> flag */
-    private boolean deleteOldRdn = false ;
+    private boolean deleteOldRdn = false;
+    
+    private ModifyDnResponse response;
 
 
     // -----------------------------------------------------------------------
@@ -53,7 +55,7 @@
      */
     public ModifyDnRequestImpl( final int id )
     {
-        super( id, TYPE ) ;
+        super( id, TYPE );
     }
 
 
@@ -71,7 +73,7 @@
      */
     public boolean getDeleteOldRdn()
     {
-        return deleteOldRdn ;
+        return deleteOldRdn;
     }
 
 
@@ -86,8 +88,8 @@
     public void setDeleteOldRdn( boolean deleteOldRdn )
     {
         lockCheck(
-            "Attempt to toggle deleteOldRdn flag of locked ModifyDnRequest!" ) ;
-        this.deleteOldRdn = deleteOldRdn ;
+            "Attempt to toggle deleteOldRdn flag of locked ModifyDnRequest!" );
+        this.deleteOldRdn = deleteOldRdn;
     }
 
 
@@ -101,7 +103,7 @@
      */
     public boolean isMove()
     {
-        return newSuperior != null ;
+        return newSuperior != null;
     }
 
 
@@ -113,7 +115,7 @@
      */
     public String getName()
     {
-        return name ;
+        return name;
     }
 
 
@@ -125,8 +127,8 @@
      */
     public void setName( String name )
     {
-        lockCheck( "Attempt to alter entry name on locked ModifyDnRequest!" ) ;
-        this.name = name ;
+        lockCheck( "Attempt to alter entry name on locked ModifyDnRequest!" );
+        this.name = name;
     }
 
 
@@ -138,7 +140,7 @@
      */
     public String getNewRdn()
     {
-        return newRdn ;
+        return newRdn;
     }
 
 
@@ -150,8 +152,8 @@
      */
     public void setNewRdn( String newRdn )
     {
-        lockCheck( "Atttempt to alter the newRdn of locked ModifyDnRequest!" ) ;
-        this.newRdn = newRdn ;
+        lockCheck( "Atttempt to alter the newRdn of locked ModifyDnRequest!" );
+        this.newRdn = newRdn;
     }
 
 
@@ -165,7 +167,7 @@
      */
     public String getNewSuperior()
     {
-        return newSuperior ;
+        return newSuperior;
     }
 
 
@@ -181,7 +183,7 @@
      */
     public void setNewSuperior( String newSuperior )
     {
-    	this.newSuperior = newSuperior ;
+    	this.newSuperior = newSuperior;
     }
 
 
@@ -198,7 +200,23 @@
      */
     public MessageTypeEnum getResponseType()
     {
-        return RESP_TYPE ;
+        return RESP_TYPE;
+    }
+    
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new ModifyDnResponseImpl( getMessageId() );
+        }
+        
+        return response;
     }
 
 

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyDnResponse.java Fri Jan  6 23:18:44 2006
@@ -14,16 +14,6 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: ModifyDnResponse.java,v 1.2 2003/05/02 00:49:07 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
 package org.apache.ldap.common.message ;
 
 
@@ -31,13 +21,11 @@
  * Modify DN protocol response message used to confirm the results of a modify
  * DN request message.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public interface ModifyDnResponse
-    extends ResultResponse
+public interface ModifyDnResponse extends ResultResponse
 {
     /** Modify DN response message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.MODDNRESPONSE ;
+    MessageTypeEnum TYPE = MessageTypeEnum.MODDNRESPONSE;
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequest.java Fri Jan  6 23:18:44 2006
@@ -14,22 +14,12 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: ModifyRequest.java,v 1.4 2003/07/31 21:44:48 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
 
 
-import java.util.Collection ;
+import java.util.Collection;
 
-import javax.naming.directory.ModificationItem ;
+import javax.naming.directory.ModificationItem;
 
 
 /**
@@ -96,16 +86,15 @@
  * borrow good ideas and familiar signatures, interfaces and classes where we
  * can.
  * 
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
 public interface ModifyRequest extends SingleReplyRequest, AbandonableRequest
 {
     /** Modify request message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYREQUEST ;
+    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYREQUEST;
     /** Modify response message type enumeration value */
-    MessageTypeEnum RESP_TYPE = ModifyResponse.TYPE ;
+    MessageTypeEnum RESP_TYPE = ModifyResponse.TYPE;
 
     /**
      * Gets the distinguished name of the entry to be modified by this request.
@@ -113,15 +102,15 @@
      *
      * @return the DN of the modified entry.
      */
-    String getName() ;
+    String getName();
 
     /**
      * Sets the distinguished name of the entry to be modified by this request.
      * This property represents the PDU's <b>object</b> field.
      *
-     * @param a_name the DN of the modified entry.
+     * @param name the DN of the modified entry.
      */
-    void setName( String a_name ) ;
+    void setName( String name );
 
     /**
      * Gets an immutable Collection of modification items representing the
@@ -130,21 +119,21 @@
      * @return an immutatble Collection of ModificationItem instances.
      * @see javax.naming.directory.ModificationItem
      */
-    Collection getModificationItems() ;
+    Collection getModificationItems();
 
     /**
      * Adds a ModificationItem to the set of modifications composing this modify
      * request.
      *
-     * @param a_mod a ModificationItem to add.
+     * @param mod a ModificationItem to add.
      */
-    void addModification( ModificationItem a_mod ) ;
+    void addModification( ModificationItem mod );
 
     /**
      * Removes a ModificationItem to the set of modifications composing this
      * modify request.
      *
-     * @param a_mod a ModificationItem to remove.
+     * @param mod a ModificationItem to remove.
      */
-    void removeModification( ModificationItem a_mod ) ;
+    void removeModification( ModificationItem mod );
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -49,9 +49,10 @@
     private static final transient Logger log = LoggerFactory.getLogger( ModifyRequestImpl.class );
 
     /** Dn of the entry to modify or PDU's <b>object</b> field */
-    private String name ;
+    private String name;
     /** Sequence of modifications or PDU's <b>modification</b> seqence field */
-    private ArrayList mods = new ArrayList() ;
+    private ArrayList mods = new ArrayList();
+    private ModifyResponse response;
 
 
     // ------------------------------------------------------------------------
@@ -67,7 +68,7 @@
      */
     public ModifyRequestImpl( final int id )
     {
-        super( id, TYPE ) ;
+        super( id, TYPE );
     }
 
 
@@ -85,7 +86,7 @@
      */
     public Collection getModificationItems()
     {
-        return Collections.unmodifiableCollection( mods ) ;
+        return Collections.unmodifiableCollection( mods );
     }
 
 
@@ -97,7 +98,7 @@
      */
     public String getName()
     {
-        return name ;
+        return name;
     }
 
 
@@ -109,8 +110,8 @@
      */
     public void setName( String name )
     {
-        lockCheck( "Attempt to alter object name of locked ModifyRequest!" ) ;
-        this.name = name ;
+        lockCheck( "Attempt to alter object name of locked ModifyRequest!" );
+        this.name = name;
     }
 
 
@@ -122,8 +123,8 @@
      */
     public void addModification( ModificationItem mod )
     {
-        lockCheck( "Attempt to add modification to locked ModifyRequest!" ) ;
-        mods.add( mod ) ;
+        lockCheck( "Attempt to add modification to locked ModifyRequest!" );
+        mods.add( mod );
     }
 
 
@@ -135,8 +136,8 @@
      */
     public void removeModification( ModificationItem mod )
     {
-        lockCheck( "Attempt to remove modification to locked ModifyRequest!" ) ;
-        mods.remove( mod ) ;
+        lockCheck( "Attempt to remove modification to locked ModifyRequest!" );
+        mods.remove( mod );
     }
 
 
@@ -153,7 +154,23 @@
      */
     public MessageTypeEnum getResponseType()
     {
-        return RESP_TYPE ;
+        return RESP_TYPE;
+    }
+    
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new ModifyResponseImpl( getMessageId() );
+        }
+        
+        return response;
     }
 
 

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ModifyResponse.java Fri Jan  6 23:18:44 2006
@@ -14,30 +14,17 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: ModifyResponse.java,v 1.2 2003/05/02 00:49:07 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
 
 
 /**
  * Modify protocol response message used to confirm the results of a modify
  * request message.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
  * @version $Revision$
  */
-public interface ModifyResponse
-    extends ResultResponse
+public interface ModifyResponse extends ResultResponse
 {
     /** Modify response message type enumeration value */
-    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYRESPONSE ;
+    MessageTypeEnum TYPE = MessageTypeEnum.MODIFYRESPONSE;
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponse.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponse.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponse.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponse.java Fri Jan  6 23:18:44 2006
@@ -14,39 +14,20 @@
  *   limitations under the License.
  *
  */
-
-/*
- * $Id: ResultResponse.java,v 1.1 2003/05/02 00:49:07 akarasulu Exp $
- *
- * -- (c) LDAPd Group                                                    --
- * -- Please refer to the LICENSE.txt file in the root directory of      --
- * -- any LDAPd project for copyright and distribution information.      --
- *
- */
-
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
 
 /**
  * An LDAP Response that contains an LDAPResult structure within it.
  *
- * @author <a href="mailto:aok123@bellsouth.net">Alex Karasulu</a>
- * @author $Author: akarasulu $
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Revision$
  */
-public interface ResultResponse
-    extends Response
+public interface ResultResponse extends Response
 {
     /**
      * Gets the LdapResult components of this Response.
      *
      * @return the LdapResult for this Response.
      */
-    LdapResult getLdapResult() ;
-
-    /**
-     * Sets the LdapResult components of this Response.
-     *
-     * @param a_result the LdapResult for this Response.
-     */
-    void setLdapResult( LdapResult a_result ) ;
+    LdapResult getLdapResult();
 }

Added: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponseRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponseRequest.java?rev=366690&view=auto
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponseRequest.java (added)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponseRequest.java Fri Jan  6 23:18:44 2006
@@ -0,0 +1,36 @@
+/*
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *
+ */
+package org.apache.ldap.common.message;
+
+
+/**
+ * A request who's one or more responses contains an LdapResult.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public interface ResultResponseRequest extends Request
+{
+    /**
+     * If called for the first time, this methohd creates a result containing 
+     * response object for this request.
+     * 
+     * @return a result containing response with defaults and the messageId set
+     * in response to this specific request
+     */
+    ResultResponse getResultResponse();
+}

Propchange: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/ResultResponseRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SearchRequestImpl.java Fri Jan  6 23:18:44 2006
@@ -14,15 +14,15 @@
  *   limitations under the License.
  *
  */
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
 
 
-import java.util.ArrayList ;
-import java.util.Collection ;
-import java.util.Collections ;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 
-import org.apache.ldap.common.filter.ExprNode ;
+import org.apache.ldap.common.filter.ExprNode;
 import org.apache.ldap.common.filter.BranchNormalizedVisitor;
 
 
@@ -37,21 +37,23 @@
 {
     static final long serialVersionUID = -5655881944020886218L;
     /** Search base distinguished name */
-    private String baseDn ;
+    private String baseDn;
     /** Search filter expression tree's root node */
-    private ExprNode filter ;
+    private ExprNode filter;
     /** Search scope enumeration value */
-    private ScopeEnum scope ;
+    private ScopeEnum scope;
     /** Types only return flag */
-    private boolean typesOnly ;
+    private boolean typesOnly;
     /** Max size in entries to return */
-    private int sizeLimit ;
+    private int sizeLimit;
     /** Max seconds to wait for search to complete */
-    private int timeLimit ;
+    private int timeLimit;
     /** Alias dereferencing mode enumeration value */
-    private DerefAliasesEnum derefAliases ;
+    private DerefAliasesEnum derefAliases;
     /** Attributes to return */
-    private Collection attributes = new ArrayList() ;
+    private Collection attributes = new ArrayList();
+    /** The final result containing SearchResponseDone response */
+    private SearchResponseDone response;
 
 
     // ------------------------------------------------------------------------
@@ -60,14 +62,13 @@
 
 
     /**
-     * Creates a Lockable SearcRequest implementing object used to search the
-     * DIT.
+     * Creates a Lockable SearcRequest implementing object used to search the DIT.
      *
      * @param id the sequential message identifier
      */
     public SearchRequestImpl( final int id )
     {
-        super( id, TYPE ) ;
+        super( id, TYPE );
     }
 
 
@@ -103,7 +104,7 @@
      */
     public Collection getAttributes()
     {
-        return Collections.unmodifiableCollection( attributes ) ;
+        return Collections.unmodifiableCollection( attributes );
     }
 
 
@@ -114,7 +115,7 @@
      */
     public String getBase()
     {
-        return baseDn ;
+        return baseDn;
     }
 
 
@@ -125,8 +126,8 @@
      */
     public void setBase( String base )
     {
-        lockCheck( "Attempt to alter search base of locked SearchRequest!" ) ;
-        baseDn = base ;
+        lockCheck( "Attempt to alter search base of locked SearchRequest!" );
+        baseDn = base;
     }
 
 
@@ -137,7 +138,7 @@
      */
     public DerefAliasesEnum getDerefAliases()
     {
-        return derefAliases ;
+        return derefAliases;
     }
 
 
@@ -149,8 +150,8 @@
     public void setDerefAliases( DerefAliasesEnum derefAliases )
     {
         lockCheck(
-        "Attempt to alter alias dereferencing mode of locked SearchRequest!" ) ;
-        this.derefAliases = derefAliases ;
+        "Attempt to alter alias dereferencing mode of locked SearchRequest!" );
+        this.derefAliases = derefAliases;
     }
 
 
@@ -161,7 +162,7 @@
      */
     public ExprNode getFilter()
     {
-        return filter ;
+        return filter;
     }
 
 
@@ -173,8 +174,8 @@
      */
     public void setFilter( ExprNode filter )
     {
-        lockCheck( "Attempt to alter search filter of locked SearchRequest!" ) ;
-        this.filter = filter ;
+        lockCheck( "Attempt to alter search filter of locked SearchRequest!" );
+        this.filter = filter;
     }
 
 
@@ -186,7 +187,7 @@
      */
     public MessageTypeEnum [] getResponseTypes()
     {
-        return ( MessageTypeEnum [] ) RESPONSE_TYPES.clone() ;
+        return ( MessageTypeEnum [] ) RESPONSE_TYPES.clone();
     }
 
 
@@ -197,7 +198,7 @@
      */
     public ScopeEnum getScope()
     {
-        return scope ;
+        return scope;
     }
 
 
@@ -208,8 +209,8 @@
      */
     public void setScope( ScopeEnum scope )
     {
-        lockCheck( "Attempt to alter search scope of locked SearchReqest!" ) ;
-        this.scope = scope ;
+        lockCheck( "Attempt to alter search scope of locked SearchReqest!" );
+        this.scope = scope;
     }
 
 
@@ -223,7 +224,7 @@
      */
     public int getSizeLimit()
     {
-        return sizeLimit ;
+        return sizeLimit;
     }
 
 
@@ -237,8 +238,8 @@
      */
     public void setSizeLimit( int entriesMax )
     {
-        lockCheck( "Attempt to alter size limit on locked SearchRequest!" ) ;
-        sizeLimit = entriesMax ;
+        lockCheck( "Attempt to alter size limit on locked SearchRequest!" );
+        sizeLimit = entriesMax;
     }
 
 
@@ -251,7 +252,7 @@
      */
     public int getTimeLimit()
     {
-        return timeLimit ;
+        return timeLimit;
     }
 
 
@@ -264,8 +265,8 @@
      */
     public void setTimeLimit( int secondsMax )
     {
-        lockCheck( "Attempt to alter time limit on locked SearchRequest!" ) ;
-        timeLimit = secondsMax ;
+        lockCheck( "Attempt to alter time limit on locked SearchRequest!" );
+        timeLimit = secondsMax;
     }
 
 
@@ -279,7 +280,7 @@
      */
     public boolean getTypesOnly()
     {
-        return typesOnly ;
+        return typesOnly;
     }
 
 
@@ -294,8 +295,8 @@
     public void setTypesOnly( boolean typesOnly )
     {
         lockCheck(
-            "Attempt to alter typesOnly flag of locked SearchRequest!" ) ;
-        this.typesOnly = typesOnly ;
+            "Attempt to alter typesOnly flag of locked SearchRequest!" );
+        this.typesOnly = typesOnly;
     }
 
 
@@ -307,8 +308,8 @@
     public void addAttribute( String attribute )
     {
         lockCheck(
-            "Attempt to add return attribute to locked SearchRequest!" ) ;
-        attributes.add( attribute ) ;
+            "Attempt to add return attribute to locked SearchRequest!" );
+        attributes.add( attribute );
     }
 
 
@@ -320,8 +321,24 @@
     public void removeAttribute( String attribute )
     {
         lockCheck(
-            "Attempt to remove return attribute from locked SearchRequest!" ) ;
-        attributes.remove( attribute ) ;
+            "Attempt to remove return attribute from locked SearchRequest!" );
+        attributes.remove( attribute );
+    }
+    
+
+    /**
+     * The result containing response for this request.
+     * 
+     * @return the result containing response for this request
+     */
+    public ResultResponse getResultResponse()
+    {
+        if ( response == null )
+        {
+            response = new SearchResponseDoneImpl( getMessageId() );
+        }
+        
+        return response;
     }
 
 
@@ -426,6 +443,6 @@
         req.getFilter().printToBuffer( buf );
         String reqFilterString = buf.toString();
 
-        return myFilterString.equals( reqFilterString ) ;
+        return myFilterString.equals( reqFilterString );
     }
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SingleReplyRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SingleReplyRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SingleReplyRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/SingleReplyRequest.java Fri Jan  6 23:18:44 2006
@@ -14,17 +14,16 @@
  *   limitations under the License.
  *
  */
-package org.apache.ldap.common.message ;
+package org.apache.ldap.common.message;
 
 
 /**
  * Super interface for all request messages returning only one type of response.
  *
- * @author <a href="mailto:dev@directory.apache.org">
- * Apache Directory Project</a>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface SingleReplyRequest extends Request
+public interface SingleReplyRequest extends ResultResponseRequest
 {
     /**
      * Gets the protocol response message type for this request which produces
@@ -32,5 +31,5 @@
      *
      * @return the message type of the response.
      */
-    MessageTypeEnum getResponseType() ;
+    MessageTypeEnum getResponseType();
 }

Modified: directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/UnbindRequest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/UnbindRequest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/UnbindRequest.java (original)
+++ directory/trunk/ldap-common/src/main/java/org/apache/ldap/common/message/UnbindRequest.java Fri Jan  6 23:18:44 2006
@@ -20,8 +20,8 @@
 /**
  * Unbind protocol request message used to end a client session.
  * 
- * @author <a href="mailto:dev@directory.apache.org"> Apache Directory
- *         Project</a> $Rev$
+ * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a> 
+ * @version $Rev$
  */
 public interface UnbindRequest extends Request
 {

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AbstractResultResponseTest.java Fri Jan  6 23:18:44 2006
@@ -48,8 +48,12 @@
      */
     public void testEqualsExactCopy()
     {
-        LdapResultImpl r0 = new LdapResultImpl( null );
-        LdapResultImpl r1 = new LdapResultImpl( null );
+        AbstractResultResponse msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
+            private static final long serialVersionUID = 1L;};
+        AbstractResultResponse msg1 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
+            private static final long serialVersionUID = 1L;};
+        LdapResult r0 = msg0.getLdapResult();
+        LdapResult r1 = msg1.getLdapResult();
 
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
@@ -68,14 +72,6 @@
         refs1.addLdapUrl( "ldap://someserver.com" );
         refs1.addLdapUrl( "ldap://anotherserver.org" );
 
-        AbstractResultResponse msg0;
-        AbstractResultResponse msg1;
-        msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
-            private static final long serialVersionUID = 1L;};
-        msg0.setLdapResult( r0 );
-        msg1 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
-            private static final long serialVersionUID = 1L;};
-        msg1.setLdapResult( r1 );
         assertTrue( msg0.equals( msg1 ) );
         assertTrue( msg1.equals( msg0 ) );
     }
@@ -86,8 +82,12 @@
      */
     public void testNotEqualsDiffResult()
     {
-        LdapResultImpl r0 = new LdapResultImpl( null );
-        LdapResultImpl r1 = new LdapResultImpl( null );
+        AbstractResultResponse msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
+            private static final long serialVersionUID = 1L;};
+        AbstractResultResponse msg1 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
+            private static final long serialVersionUID = 1L;};
+        LdapResult r0 = msg0.getLdapResult();
+        LdapResult r1 = msg1.getLdapResult();
 
         r0.setErrorMessage( "blah blah blah" );
         r1.setErrorMessage( "blah blah blah" );
@@ -106,14 +106,6 @@
         refs1.addLdapUrl( "ldap://someserver.com" );
         refs1.addLdapUrl( "ldap://anotherserver.org" );
 
-        AbstractResultResponse msg0;
-        AbstractResultResponse msg1;
-        msg0 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
-            private static final long serialVersionUID = 1L;};
-        msg0.setLdapResult( r0 );
-        msg1 = new AbstractResultResponse( 5, MessageTypeEnum.BINDREQUEST ) {
-            private static final long serialVersionUID = 1L;};
-        msg1.setLdapResult( r1 );
         assertFalse( msg0.equals( msg1 ) );
         assertFalse( msg1.equals( msg0 ) );
     }

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AddRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AddRequestImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AddRequestImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/AddRequestImplTest.java Fri Jan  6 23:18:44 2006
@@ -261,6 +261,11 @@
             public void addAbandonListener(AbandonListener listener)
             {
             }
+
+            public ResultResponse getResultResponse()
+            {
+                return null;
+            }
         };
 
         AddRequestImpl req1 = new AddRequestImpl( 5 );

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindRequestImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindRequestImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindRequestImplTest.java Fri Jan  6 23:18:44 2006
@@ -301,17 +301,9 @@
             {
             }
 
-            public void abandon()
-            {
-            }
-
-            public boolean isAbandoned()
-            {
-                return false;
-            }
-
-            public void addAbandonListener(AbandonListener listener)
+            public ResultResponse getResultResponse()
             {
+                return null;
             }
         };
 

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindResponseImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindResponseImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindResponseImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/BindResponseImplTest.java Fri Jan  6 23:18:44 2006
@@ -86,22 +86,6 @@
 
 
     /**
-     * Tests to make sure newly created objects with same different saslCreds
-     * are not equal.
-     */
-    public void testNotEqualsNewWithDiffLdapResult()
-    {
-        BindResponseImpl resp0 = new BindResponseImpl( 1 );
-        resp0.setLdapResult( new LdapResultImpl( resp0 ) );
-        BindResponseImpl resp1 = new BindResponseImpl( 1 );
-        assertFalse( "different result objects should not be equal",
-                resp0.equals( resp1 ) );
-        assertFalse( "different result objects should not be equal",
-                resp1.equals( resp0 ) );
-    }
-
-
-    /**
      * Tests for equality of two fully loaded identical BindResponse PDUs.
      */
     public void testEqualsWithTheWorks()
@@ -127,9 +111,7 @@
         refs1.addLdapUrl( "ldap://anotherserver.org" );
 
         BindResponseImpl resp0 = new BindResponseImpl( 1 );
-        resp0.setLdapResult( r0 );
         BindResponseImpl resp1 = new BindResponseImpl( 1 );
-        resp1.setLdapResult( r1 );
 
         resp0.setServerSaslCreds( "password".getBytes() );
         resp1.setServerSaslCreds( "password".getBytes() );

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/CompareRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/CompareRequestImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/CompareRequestImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/CompareRequestImplTest.java Fri Jan  6 23:18:44 2006
@@ -240,6 +240,11 @@
             public void addAbandonListener(AbandonListener listener)
             {
             }
+
+            public ResultResponse getResultResponse()
+            {
+                return null;
+            }
         };
 
         CompareRequestImpl req1 = new CompareRequestImpl( 5 );

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/DeleteRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/DeleteRequestImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/DeleteRequestImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/DeleteRequestImplTest.java Fri Jan  6 23:18:44 2006
@@ -29,8 +29,7 @@
 /**
  * TestCase for the methods of the DeleteRequestImpl class.
  *
- * @author <a href="mailto:dev@directory.apache.org"> Apache Directory
- *         Project</a>
+ * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
  * @version $Rev$
  */
 public class DeleteRequestImplTest extends TestCase
@@ -184,6 +183,11 @@
 
             public void addAbandonListener(AbandonListener listener)
             {
+            }
+
+            public ResultResponse getResultResponse()
+            {
+                return null;
             }
         };
 

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedRequestImplTest.java Fri Jan  6 23:18:44 2006
@@ -29,8 +29,7 @@
 /**
  * TestCase for the ExtendedRequestImpl class.
  *
- * @author <a href="mailto:dev@directory.apache.org"> Apache Directory
- *         Project</a>
+ * @author <a href="mailto:dev@directory.apache.org"> Apache Directory Project</a>
  * @version $Rev$
  */
 public class ExtendedRequestImplTest extends TestCase
@@ -204,17 +203,9 @@
                 return false;
             }
 
-            public void abandon()
-            {
-            }
-
-            public boolean isAbandoned()
-            {
-                return false;
-            }
-
-            public void addAbandonListener(AbandonListener listener)
+            public ResultResponse getResultResponse()
             {
+                return null;
             }
         };
 

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ExtendedResponseImplTest.java Fri Jan  6 23:18:44 2006
@@ -29,8 +29,7 @@
 /**
  * TestCase for the ExtendedResponseImpl class.
  *
- * @author <a href="mailto:dev@directory.apache.org"> Apache Directory
- *         Project</a>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
 public class ExtendedResponseImplTest extends TestCase
@@ -46,8 +45,7 @@
         ExtendedResponseImpl response = new ExtendedResponseImpl( 45 );
         response.setResponse( "Hello World!".getBytes() );
         response.setResponseName( "1.1.1.1" );
-        LdapResultImpl result = new LdapResultImpl( response );
-        response.setLdapResult( result );
+        LdapResult result = response.getLdapResult();
         result.setMatchedDn( "dc=example,dc=com" );
         result.setResultCode( ResultCodeEnum.SUCCESS );
         ReferralImpl refs = new ReferralImpl( result );
@@ -119,10 +117,6 @@
                 result.setReferral( refs );
 
                 return result;
-            }
-
-            public void setLdapResult( LdapResult a_result )
-            {
             }
 
             public MessageTypeEnum getType()

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyDnRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyDnRequestImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyDnRequestImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyDnRequestImplTest.java Fri Jan  6 23:18:44 2006
@@ -288,6 +288,11 @@
             public void addAbandonListener(AbandonListener listener)
             {
             }
+
+            public ResultResponse getResultResponse()
+            {
+                return null;
+            }
         };
 
         ModifyDnRequestImpl req1 = getRequest();

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyRequestImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyRequestImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyRequestImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/ModifyRequestImplTest.java Fri Jan  6 23:18:44 2006
@@ -349,6 +349,11 @@
             public void addAbandonListener(AbandonListener listener)
             {
             }
+
+            public ResultResponse getResultResponse()
+            {
+                return null;
+            }
         };
 
         ModifyRequestImpl req1 = getRequest();

Modified: directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseDoneImplTest.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseDoneImplTest.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseDoneImplTest.java (original)
+++ directory/trunk/ldap-common/src/test/java/org/apache/ldap/common/message/SearchResponseDoneImplTest.java Fri Jan  6 23:18:44 2006
@@ -43,8 +43,7 @@
     {
         // Construct the Search response to test with results and referrals
         SearchResponseDoneImpl response = new SearchResponseDoneImpl( 45 );
-        LdapResultImpl result = new LdapResultImpl( response );
-        response.setLdapResult( result );
+        LdapResult result = response.getLdapResult();
         result.setMatchedDn( "dc=example,dc=com" );
         result.setResultCode( ResultCodeEnum.SUCCESS );
         ReferralImpl refs = new ReferralImpl( result );
@@ -98,10 +97,6 @@
                 result.setReferral( refs );
 
                 return result;
-            }
-
-            public void setLdapResult( LdapResult a_result )
-            {
             }
 
             public MessageTypeEnum getType()

Modified: directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/LdapProtocolProvider.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/LdapProtocolProvider.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/LdapProtocolProvider.java (original)
+++ directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/LdapProtocolProvider.java Fri Jan  6 23:18:44 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.ldap.server.protocol;
 
+
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
@@ -400,9 +401,5 @@
         {
             SessionLog.warn( session, "Unexpected exception.", cause );
         }
-    }
-    
-    public static void main(String[] args) throws Exception {
-        new LdapProtocolProvider();
     }
 }

Modified: directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/AddHandler.java
URL: http://svn.apache.org/viewcvs/directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/AddHandler.java?rev=366690&r1=366689&r2=366690&view=diff
==============================================================================
--- directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/AddHandler.java (original)
+++ directory/trunk/ldap-protocol/src/main/java/org/apache/ldap/server/protocol/support/AddHandler.java Fri Jan  6 23:18:44 2006
@@ -16,19 +16,19 @@
  */
 package org.apache.ldap.server.protocol.support;
 
+
 import javax.naming.NamingException;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.ldap.common.exception.LdapException;
 import org.apache.ldap.common.message.AddRequest;
-import org.apache.ldap.common.message.AddResponse;
-import org.apache.ldap.common.message.AddResponseImpl;
-import org.apache.ldap.common.message.LdapResultImpl;
+import org.apache.ldap.common.message.LdapResult;
 import org.apache.ldap.common.message.ResultCodeEnum;
 import org.apache.ldap.common.util.ExceptionUtils;
 import org.apache.ldap.server.protocol.SessionRegistry;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.demux.MessageHandler;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -46,15 +46,13 @@
     public void messageReceived( IoSession session, Object request )
     {
         AddRequest req = ( AddRequest ) request;
+        LdapResult result = req.getResultResponse().getLdapResult();
         
         if ( log.isDebugEnabled() )
         {
             log.debug( "Received a Add message : " + req.toString() );
         }
 
-        AddResponse resp = new AddResponseImpl( req.getMessageId() );
-        resp.setLdapResult( new LdapResultImpl( resp ) );
-
         try
         {
             LdapContext ctx = SessionRegistry.getSingleton().getLdapContext( session, null, true );
@@ -80,8 +78,8 @@
                 code = ResultCodeEnum.getBestEstimate( e, req.getType() );
             }
 
-            resp.getLdapResult().setResultCode( code );
-            resp.getLdapResult().setErrorMessage( msg );
+            result.setResultCode( code );
+            result.setErrorMessage( msg );
             
             if ( ( e.getResolvedName() != null ) &&
                     ( ( code == ResultCodeEnum.NOSUCHOBJECT ) ||
@@ -89,14 +87,14 @@
                       ( code == ResultCodeEnum.INVALIDDNSYNTAX ) ||
                       ( code == ResultCodeEnum.ALIASDEREFERENCINGPROBLEM ) ) )
             {
-                resp.getLdapResult().setMatchedDn( e.getResolvedName().toString() );
+                result.setMatchedDn( e.getResolvedName().toString() );
             }
 
-            session.write( resp );
+            session.write( req.getResultResponse() );
             return;
         }
 
-        resp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
-        session.write( resp );
+        result.setResultCode( ResultCodeEnum.SUCCESS );
+        session.write( req.getResultResponse() );
     }
 }



Mime
View raw message