directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063122 - 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 03:22:13 GMT
Author: akarasulu
Date: Tue Jan 25 03:22:11 2011
New Revision: 1063122

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

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/ModifyDnResponseDecorator.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/ModifyDnResponseImpl.java
  (contents, props changed)
      - copied, changed from r1063086, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponseImpl.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponseImpl.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/Dsmlv2ResponseGrammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.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/ModifyDnNoDResponse.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnRequestImpl.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.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=1063122&r1=1063121&r2=1063122&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 03:22:11 2011
@@ -69,7 +69,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
-import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;

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=1063122&r1=1063121&r2=1063122&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 03:22:11 2011
@@ -56,7 +56,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.model.message.LdapResult;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
-import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
 import org.apache.directory.shared.ldap.message.ModifyResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ReferralImpl;

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java?rev=1063122&r1=1063121&r2=1063122&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
Tue Jan 25 03:22:11 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
-import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
 import org.dom4j.Element;
 
 

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=1063122&r1=1063121&r2=1063122&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 03:22:11 2011
@@ -96,7 +96,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
-import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;

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=1063122&r1=1063121&r2=1063122&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 03:22:11 2011
@@ -1023,11 +1023,12 @@ public class LdapEncoder
      * Length(ModifyDNResponse) = Length(0x6D) + Length(L1) + L1
      * </pre>
      */
-    private int computeModifyDnResponseLength( ModifyDnResponseImpl modifyDnResponse )
+    private int computeModifyDnResponseLength( ModifyDnResponseDecorator decorator )
     {
+        ModifyDnResponse modifyDnResponse = decorator.getModifyDnResponse();
         int modifyDnResponseLength = computeLdapResultLength( modifyDnResponse.getLdapResult()
);
 
-        modifyDnResponse.setModifyDnResponseLength( modifyDnResponseLength );
+        decorator.setModifyDnResponseLength( modifyDnResponseLength );
 
         return 1 + TLV.getNbBytes( modifyDnResponseLength ) + modifyDnResponseLength;
     }
@@ -2107,14 +2108,15 @@ public class LdapEncoder
      * 
      * @param buffer The buffer where to put the PDU
      */
-    private void encodeModifyDnResponse( ByteBuffer buffer, ModifyDnResponseImpl modifyDnResponse
)
+    private void encodeModifyDnResponse( ByteBuffer buffer, ModifyDnResponseDecorator decorator
)
         throws EncoderException
     {
+        ModifyDnResponse modifyDnResponse = decorator.getModifyDnResponse();
         try
         {
             // The ModifyResponse Tag
             buffer.put( LdapConstants.MODIFY_DN_RESPONSE_TAG );
-            buffer.put( TLV.getBytes( modifyDnResponse.getModifyDnResponseLength() ) );
+            buffer.put( TLV.getBytes( decorator.getModifyDnResponseLength() ) );
 
             // The LdapResult
             encodeLdapResult( buffer, modifyDnResponse.getLdapResult() );
@@ -2430,7 +2432,7 @@ public class LdapEncoder
                 return computeModifyDnRequestLength( ( ModifyDnRequestDecorator ) decorator
);
 
             case MODIFYDN_RESPONSE:
-                return computeModifyDnResponseLength( ( ModifyDnResponseImpl ) message );
+                return computeModifyDnResponseLength( ( ModifyDnResponseDecorator ) decorator
);
 
             case SEARCH_REQUEST:
                 return computeSearchRequestLength( ( SearchRequestImpl ) message );
@@ -2520,7 +2522,7 @@ public class LdapEncoder
                 break;
 
             case MODIFYDN_RESPONSE:
-                encodeModifyDnResponse( bb, ( ModifyDnResponseImpl ) message );
+                encodeModifyDnResponse( bb, ( ModifyDnResponseDecorator ) decorator );
                 break;
 
             case SEARCH_REQUEST:

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=1063122&r1=1063121&r2=1063122&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 03:22:11 2011
@@ -75,6 +75,8 @@ public class MessageDecorator
                 return new IntermediateResponseDecorator( ( IntermediateResponse ) decoratedMessage
);
             case MODIFYDN_REQUEST:
                 return new ModifyDnRequestDecorator( ( ModifyDnRequest ) decoratedMessage
);
+            case MODIFYDN_RESPONSE:
+                return new ModifyDnResponseDecorator( ( ModifyDnResponse ) decoratedMessage
);
             case SEARCH_RESULT_REFERENCE:
                 return new SearchResultReferenceDecorator( ( SearchResultReference ) decoratedMessage
);
             default:

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/ModifyDnResponseDecorator.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/ModifyDnResponseDecorator.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/ModifyDnResponseDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java&r1=1063097&r2=1063122&rev=1063122&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/ModifyDnResponseDecorator.java
Tue Jan 25 03:22:11 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.ModifyDnResponse;
 
 
 /**
@@ -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 ModifyDnResponseDecorator extends MessageDecorator
 {
+    /** The encoded modifyDnResponse length */
+    private int modifyDnResponseLength;
+
 
     /**
-     * Makes a Foo encodable.
+     * Makes a ModifyDnResponse encodable.
      *
-     * @param decoratedMessage the decorated Foo
+     * @param decoratedMessage the decorated ModifyDnResponse
      */
-    public FooDecorator( AddRequest decoratedMessage )
+    public ModifyDnResponseDecorator( ModifyDnResponse decoratedMessage )
     {
         super( decoratedMessage );
     }
 
 
-    public AddRequest getAddRequest()
+    public ModifyDnResponse getModifyDnResponse()
+    {
+        return ( ModifyDnResponse ) getMessage();
+    }
+
+
+    /**
+     * @param modifyDnResponseLength The encoded ModifyDnResponse's length
+     */
+    public void setModifyDnResponseLength( int modifyDnResponseLength )
+    {
+        this.modifyDnResponseLength = modifyDnResponseLength;
+    }
+
+
+    /**
+     * Stores the encoded length for the ModifyDnResponse
+     * @return The encoded length
+     */
+    public int getModifyDnResponseLength()
     {
-        return ( AddRequest ) getMessage();
+        return modifyDnResponseLength;
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/ModifyDnNoDResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/ModifyDnNoDResponse.java?rev=1063122&r1=1063121&r2=1063122&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/ModifyDnNoDResponse.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/extended/nod/ModifyDnNoDResponse.java
Tue Jan 25 03:22:11 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.ModifyDnResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
 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/ModifyDnRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnRequestImpl.java?rev=1063122&r1=1063121&r2=1063122&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnRequestImpl.java
Tue Jan 25 03:22:11 2011
@@ -20,8 +20,6 @@
 package org.apache.directory.shared.ldap.model.message;
 
 
-import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
-import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnResponseImpl.java
(from r1063086, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponseImpl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnResponseImpl.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnResponseImpl.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponseImpl.java&r1=1063086&r2=1063122&rev=1063122&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/ModifyDnResponseImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/ModifyDnResponseImpl.java
Tue Jan 25 03:22:11 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.ModifyDnResponse;
 
+
 /**
  * ModifyDnResponse implementation
  * 
@@ -30,13 +31,6 @@ import org.apache.directory.shared.ldap.
  */
 public class ModifyDnResponseImpl extends AbstractResultResponse implements ModifyDnResponse
 {
-    /** The encoded modifyDnResponse length */
-    private int modifyDnResponseLength;
-
-    // ------------------------------------------------------------------------
-    // Constructors
-    // ------------------------------------------------------------------------
-
     static final long serialVersionUID = 996870775343263543L;
 
 
@@ -61,25 +55,6 @@ public class ModifyDnResponseImpl extend
 
 
     /**
-     * @return The encoded ModifyDnResponse's length
-     */
-    /* No Qualifier*/void setModifyDnResponseLength( int modifyDnResponseLength )
-    {
-        this.modifyDnResponseLength = modifyDnResponseLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the ModifyDnResponse
-     * @param modifyDnResponseLength The encoded length
-     */
-    /* No Qualifier*/int getModifyDnResponseLength()
-    {
-        return modifyDnResponseLength;
-    }
-
-
-    /**
      * Get a String representation of a ModifyDNResponse
      * 
      * @return A ModifyDNResponse String

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

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java?rev=1063122&r1=1063121&r2=1063122&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/modifyDn/ModifyDNRequestTest.java
Tue Jan 25 03:22:11 2011
@@ -36,11 +36,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.ResponseCarryingException;
 import org.apache.directory.shared.ldap.message.LdapEncoder;
-import org.apache.directory.shared.ldap.model.message.Control;
-import org.apache.directory.shared.ldap.model.message.Message;
-import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
-import org.apache.directory.shared.ldap.message.ModifyDnResponseImpl;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.model.message.*;
+import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -284,7 +281,7 @@ public class ModifyDNRequestTest
             assertTrue( de instanceof ResponseCarryingException );
             Message response = ( ( ResponseCarryingException ) de ).getResponse();
             assertTrue( response instanceof ModifyDnResponseImpl );
-            assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ( ( ModifyDnResponseImpl ) response
).getLdapResult()
+            assertEquals( ResultCodeEnum.INVALID_DN_SYNTAX, ( (ModifyDnResponseImpl) response
).getLdapResult()
                 .getResultCode() );
             return;
         }



Mime
View raw message