directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063105 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ shared/trunk/ldap/src/main/java/org/apache/directory/shared...
Date Tue, 25 Jan 2011 02:22:11 GMT
Author: akarasulu
Date: Tue Jan 25 02:22:10 2011
New Revision: 1063105

URL: http://svn.apache.org/viewvc?rev=1063105&view=rev
Log:
added encoding decorator to decouple DeleteResponseImpl

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/DeleteResponseDecorator.java
      - copied, changed from r1063097, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteResponseImpl.java
  (contents, props changed)
      - copied, changed from r1063086, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteResponseImpl.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteResponseImpl.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/DeleteNoDResponse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteRequestImpl.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Tue Jan 25 02:22:10 2011
@@ -62,7 +62,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.ldap.model.message.DeleteRequestImpl;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
-import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
+import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.LdapResult;

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/DelResponseDsml.java
Tue Jan 25 02:22:10 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
+import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.dom4j.Element;
 
 

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
Tue Jan 25 02:22:10 2011
@@ -51,7 +51,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
 import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
-import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
+import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.model.message.LdapResult;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
Tue Jan 25 02:22:10 2011
@@ -86,7 +86,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.ldap.model.message.DeleteRequestImpl;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
-import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
+import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
Tue Jan 25 02:22:10 2011
@@ -697,11 +697,12 @@ public class LdapEncoder
      * 
      * Length(DelResponse) = Length(0x6B) + Length(L1) + L1
      */
-    private int computeDeleteResponseLength( DeleteResponseImpl deleteResponse )
+    private int computeDeleteResponseLength( DeleteResponseDecorator decorator )
     {
+        DeleteResponse deleteResponse = decorator.getDeleteResponse();
         int deleteResponseLength = computeLdapResultLength( deleteResponse.getLdapResult()
);
 
-        deleteResponse.setDeleteResponseLength( deleteResponseLength );
+        decorator.setDeleteResponseLength( deleteResponseLength );
 
         return 1 + TLV.getNbBytes( deleteResponseLength ) + deleteResponseLength;
     }
@@ -1723,13 +1724,15 @@ public class LdapEncoder
      * 
      * @param buffer The buffer where to put the PDU
      */
-    private void encodeDeleteResponse( ByteBuffer buffer, DeleteResponseImpl deleteResponse
) throws EncoderException
+    private void encodeDeleteResponse( ByteBuffer buffer, DeleteResponseDecorator decorator
) throws EncoderException
     {
+        DeleteResponse deleteResponse = decorator.getDeleteResponse();
+
         try
         {
             // The DelResponse Tag
             buffer.put( LdapConstants.DEL_RESPONSE_TAG );
-            buffer.put( TLV.getBytes( deleteResponse.getDeleteResponseLength() ) );
+            buffer.put( TLV.getBytes( decorator.getDeleteResponseLength() ) );
 
             // The LdapResult
             encodeLdapResult( buffer, deleteResponse.getLdapResult() );
@@ -2396,7 +2399,7 @@ public class LdapEncoder
                 return computeDeleteRequestLength( ( DeleteRequestImpl ) message );
 
             case DEL_RESPONSE:
-                return computeDeleteResponseLength( ( DeleteResponseImpl ) message );
+                return computeDeleteResponseLength( ( DeleteResponseDecorator ) decorator
);
 
             case EXTENDED_REQUEST:
                 return computeExtendedRequestLength( ( ExtendedRequestImpl ) message );
@@ -2479,7 +2482,7 @@ public class LdapEncoder
                 break;
 
             case DEL_RESPONSE:
-                encodeDeleteResponse( bb, ( DeleteResponseImpl ) message );
+                encodeDeleteResponse( bb, ( DeleteResponseDecorator ) decorator );
                 break;
 
             case EXTENDED_REQUEST:

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/DeleteResponseDecorator.java
(from r1063097, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/DeleteResponseDecorator.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/DeleteResponseDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java&r1=1063097&r2=1063105&rev=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/DeleteResponseDecorator.java
Tue Jan 25 02:22:10 2011
@@ -20,9 +20,7 @@
 package org.apache.directory.shared.ldap.message.decorators;
 
 
-import org.apache.directory.shared.ldap.model.message.AddRequest;
-
-import java.util.List;
+import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 
 
 /**
@@ -30,22 +28,44 @@ import java.util.List;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class FooDecorator extends MessageDecorator
+public class DeleteResponseDecorator extends MessageDecorator
 {
+    /** The encoded deleteResponse length */
+    private int deleteResponseLength;
+
 
     /**
-     * Makes a Foo encodable.
+     * Makes a DeleteResponse encodable.
      *
-     * @param decoratedMessage the decorated Foo
+     * @param decoratedMessage the decorated DeleteResponse
      */
-    public FooDecorator( AddRequest decoratedMessage )
+    public DeleteResponseDecorator( DeleteResponse decoratedMessage )
     {
         super( decoratedMessage );
     }
 
 
-    public AddRequest getAddRequest()
+    public DeleteResponse getDeleteResponse()
+    {
+        return ( DeleteResponse ) getMessage();
+    }
+
+
+    /**
+     * Stores the encoded length for the DeleteResponse
+     * @param deleteResponseLength The encoded length
+     */
+    public void setDeleteResponseLength( int deleteResponseLength )
+    {
+        this.deleteResponseLength = deleteResponseLength;
+    }
+
+
+    /**
+     * @return The encoded DeleteResponse's length
+     */
+    public int getDeleteResponseLength()
     {
-        return ( AddRequest ) getMessage();
+        return deleteResponseLength;
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
Tue Jan 25 02:22:10 2011
@@ -65,6 +65,8 @@ public class MessageDecorator
                 return new CompareResponseDecorator( ( CompareResponse ) decoratedMessage
);
             case DEL_REQUEST:
                 return new MessageDecorator( decoratedMessage );
+            case DEL_RESPONSE:
+                return new DeleteResponseDecorator( ( DeleteResponse ) decoratedMessage );
             default:
                 return new MessageDecorator( decoratedMessage );
         }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/DeleteNoDResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/DeleteNoDResponse.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/DeleteNoDResponse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/DeleteNoDResponse.java
Tue Jan 25 02:22:10 2011
@@ -21,7 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
+import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteRequestImpl.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteRequestImpl.java
Tue Jan 25 02:22:10 2011
@@ -20,8 +20,6 @@
 package org.apache.directory.shared.ldap.model.message;
 
 
-import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
-import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.name.Dn;
 
 

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteResponseImpl.java
(from r1063086, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteResponseImpl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteResponseImpl.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteResponseImpl.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteResponseImpl.java&r1=1063086&r2=1063105&rev=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/DeleteResponseImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteResponseImpl.java
Tue Jan 25 02:22:10 2011
@@ -17,12 +17,13 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.shared.ldap.message;
+package org.apache.directory.shared.ldap.model.message;
 
 
 import org.apache.directory.shared.ldap.model.message.AbstractResultResponse;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 
+
 /**
  * DeleteResponse implementation
  * 
@@ -30,13 +31,6 @@ import org.apache.directory.shared.ldap.
  */
 public class DeleteResponseImpl extends AbstractResultResponse implements DeleteResponse
 {
-    /** The encoded deleteResponse length */
-    private int deleteResponseLength;
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
     static final long serialVersionUID = -6830004960050713586L;
 
 
@@ -61,25 +55,6 @@ public class DeleteResponseImpl extends 
 
 
     /**
-     * Stores the encoded length for the DeleteResponse
-     * @param deleteResponseLength The encoded length
-     */
-    /* No qualifier*/void setDeleteResponseLength( int deleteResponseLength )
-    {
-        this.deleteResponseLength = deleteResponseLength;
-    }
-
-
-    /**
-     * @return The encoded DeleteResponse's length
-     */
-    /* No qualifier*/int getDeleteResponseLength()
-    {
-        return deleteResponseLength;
-    }
-
-
-    /**
      * Get a String representation of a DelResponse
      * 
      * @return A DelResponse String

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/DeleteResponseImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java?rev=1063105&r1=1063104&r2=1063105&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/del/DelRequestTest.java
Tue Jan 25 02:22:10 2011
@@ -37,7 +37,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.ResponseCarryingException;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.message.DeleteRequestImpl;
-import org.apache.directory.shared.ldap.message.DeleteResponseImpl;
+import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.apache.directory.shared.ldap.message.LdapEncoder;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;



Mime
View raw message