directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1065284 [1/2] - in /directory/shared/trunk: ./ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ ldap/src/main/java/org/apache/directory/shared/ldap/...
Date Sun, 30 Jan 2011 14:16:27 GMT
Author: akarasulu
Date: Sun Jan 30 14:16:26 2011
New Revision: 1065284

URL: http://svn.apache.org/viewvc?rev=1065284&view=rev
Log:
Ok fixed the message hierachy. Problem is we were trying to reuse too much.
The message hiearchy in the dsml parser uses the message hierarchy in the
codec, which uses the message hierarchy in the model. The stuff in the dsml
parser was not using the right hierarchy so I fixed that.

Added:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java
      - copied, changed from r1065263, directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesFactory.java
Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BatchResponse.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.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/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModDNResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/CompareRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/DelRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyDNRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IControlFactory.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/ILdapCodecService.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ResponseDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/util/JndiUtils.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestControlFactory.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestLdapCodecService.java
    directory/shared/trunk/pom.xml

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -21,9 +21,11 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.ResponseDecorator;
+import org.apache.directory.shared.ldap.codec.ICodecControl;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
+import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
 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.Response;
 import org.dom4j.Element;
 
 
@@ -32,7 +34,7 @@ import org.dom4j.Element;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractResponseDsml extends ResponseDecorator implements DsmlDecorator
+public abstract class AbstractResponseDsml<E extends Response> extends MessageDecorator<E> implements DsmlDecorator
 {
 
     /**
@@ -40,9 +42,9 @@ public abstract class AbstractResponseDs
      *
      * @param ldapMessage the LDAP message to decorate
      */
-    public AbstractResponseDsml( Message ldapMessage )
+    public AbstractResponseDsml( ILdapCodecService codec, E ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -75,7 +77,7 @@ public abstract class AbstractResponseDs
     /**
      * {@inheritDoc}
      */
-    public Control getCurrentControl()
+    public ICodecControl<? extends Control> getCurrentControl()
     {
         // TODO Auto-generated method stub
         return null;

Copied: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java (from r1065263, directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java?p2=directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java&p1=directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java&r1=1065263&r2=1065284&rev=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AbstractResultResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -21,9 +21,11 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
+import org.apache.directory.shared.ldap.codec.ICodecControl;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.ResponseDecorator;
 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.ResultResponse;
 import org.dom4j.Element;
 
 
@@ -32,7 +34,7 @@ import org.dom4j.Element;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractResponseDsml extends ResponseDecorator implements DsmlDecorator
+public abstract class AbstractResultResponseDsml<E extends ResultResponse> extends ResponseDecorator<E> implements DsmlDecorator
 {
 
     /**
@@ -40,9 +42,9 @@ public abstract class AbstractResponseDs
      *
      * @param ldapMessage the LDAP message to decorate
      */
-    public AbstractResponseDsml( Message ldapMessage )
+    public AbstractResultResponseDsml( ILdapCodecService codec, E ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -75,7 +77,7 @@ public abstract class AbstractResponseDs
     /**
      * {@inheritDoc}
      */
-    public Control getCurrentControl()
+    public ICodecControl<? extends Control> getCurrentControl()
     {
         // TODO Auto-generated method stub
         return null;

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AddResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -21,6 +21,7 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
 import org.apache.directory.shared.ldap.model.message.AddResponseImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddResponseDsml extends AbstractResponseDsml
+public class AddResponseDsml extends AbstractResultResponseDsml<AddResponse>
 {
     /**
      * Creates a new getDecoratedMessage() of AddResponseDsml.
      */
-    public AddResponseDsml()
+    public AddResponseDsml( ILdapCodecService codec )
     {
-        super( new AddResponseImpl() );
+        super( codec, new AddResponseImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class AddResponseDsml extends Abs
      * @param ldapMessage
      *      the message to decorate
      */
-    public AddResponseDsml( AddResponse ldapMessage )
+    public AddResponseDsml( ILdapCodecService codec, AddResponse ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class AddResponseDsml extends Abs
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class AddResponseDsml extends Abs
     {
         Element element = root.addElement( "addResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( AddResponse ) getDecoratedMessage() ).getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( AddResponse ) getDecorated() ).getLdapResult(), getDecorated() );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/AuthResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -21,6 +21,7 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.model.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AuthResponseDsml extends AbstractResponseDsml
+public class AuthResponseDsml extends AbstractResultResponseDsml<BindResponse>
 {
     /**
      * Creates a new getDecoratedMessage() of AuthResponseDsml.
      */
-    public AuthResponseDsml()
+    public AuthResponseDsml( ILdapCodecService codec )
     {
-        super( new BindResponseImpl() );
+        super( codec, new BindResponseImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class AuthResponseDsml extends Ab
      * @param ldapMessage
      *      the message to decorate
      */
-    public AuthResponseDsml( BindResponse ldapMessage )
+    public AuthResponseDsml( ILdapCodecService codec, BindResponse ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class AuthResponseDsml extends Ab
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class AuthResponseDsml extends Ab
     {
         Element element = root.addElement( "authResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( BindResponse ) getDecoratedMessage() ).getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( BindResponse ) getDecorated() ).getLdapResult(), getDecorated() );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BatchResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BatchResponse.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BatchResponse.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/BatchResponse.java Sun Jan 30 14:16:26 2011
@@ -56,7 +56,7 @@ public class BatchResponse
 
 
     /**
-     * Adds a reponse
+     * Adds a response
      *
      * @param response
      *      the response to add
@@ -70,7 +70,7 @@ public class BatchResponse
 
 
     /**
-     * Gets the current reponse
+     * Gets the current response
      *
      * @return
      *      the current response
@@ -105,12 +105,12 @@ public class BatchResponse
 
 
     /**
-     * Gets the List of all the reponses
+     * Gets the List of all the responses
      *
      * @return
      *      the List of all the responses
      */
-    public List getResponses()
+    public List<Response> getResponses()
     {
         return responses;
     }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/CompareResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -21,6 +21,7 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 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.MessageTypeEnum;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareResponseDsml extends AbstractResponseDsml
+public class CompareResponseDsml extends AbstractResultResponseDsml<CompareResponse>
 {
     /**
      * Creates a new getDecoratedMessage() of CompareResponseDsml.
      */
-    public CompareResponseDsml()
+    public CompareResponseDsml( ILdapCodecService codec )
     {
-        super( new CompareResponseImpl() );
+        super( codec, new CompareResponseImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class CompareResponseDsml extends
      * @param ldapMessage
      *      the message to decorate
      */
-    public CompareResponseDsml( CompareResponse ldapMessage )
+    public CompareResponseDsml( ILdapCodecService codec, CompareResponse ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class CompareResponseDsml extends
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class CompareResponseDsml extends
     {
         Element element = root.addElement( "compareResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( CompareResponse ) getDecoratedMessage() ).getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( CompareResponse ) getDecorated() ).getLdapResult(), getDecorated() );
         ldapResultDsml.toDsml( element );
         return element;
     }

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=1065284&r1=1065283&r2=1065284&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 Sun Jan 30 14:16:26 2011
@@ -21,6 +21,7 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.DeleteResponseImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DelResponseDsml extends AbstractResponseDsml
+public class DelResponseDsml extends AbstractResultResponseDsml<DeleteResponse>
 {
     /**
      * Creates a new getDecoratedMessage() of DelResponseDsml.
      */
-    public DelResponseDsml()
+    public DelResponseDsml( ILdapCodecService codec )
     {
-        super( new DeleteResponseImpl() );
+        super( codec, new DeleteResponseImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class DelResponseDsml extends Abs
      * @param ldapMessage
      *      the message to decorate
      */
-    public DelResponseDsml( DeleteResponse ldapMessage )
+    public DelResponseDsml( ILdapCodecService codec, DeleteResponse ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class DelResponseDsml extends Abs
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class DelResponseDsml extends Abs
     {
         Element element = root.addElement( "delResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( (DeleteResponse) getDecoratedMessage() ).getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( (DeleteResponse) getDecorated() ).getLdapResult(), getDecorated() );
         ldapResultDsml.toDsml( element );
         return 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=1065284&r1=1065283&r2=1065284&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 Sun Jan 30 14:16:26 2011
@@ -39,6 +39,8 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.Tag;
 import org.apache.directory.shared.dsmlv2.reponse.ErrorResponse.ErrorResponseType;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
 import org.apache.directory.shared.ldap.codec.decorators.AddResponseDecorator;
@@ -90,7 +92,9 @@ public final class Dsmlv2ResponseGrammar
 {
     /** The instance of grammar. Dsmlv2ResponseGrammar is a singleton */
     private static Dsmlv2ResponseGrammar instance = new Dsmlv2ResponseGrammar();
-
+    
+    private ILdapCodecService codec = new DefaultLdapCodecService();
+    
     /** The DSMLv2 description tags */
     private static final Set<String> DSMLV2_DESCR_TAGS;
     static
@@ -794,7 +798,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddResponseDecorator addResponse = new AddResponseDecorator( new AddResponseImpl() );
+            AddResponseDecorator addResponse = new AddResponseDecorator( codec, new AddResponseImpl() );
 
             container.getBatchResponse().addResponse( addResponse );
 
@@ -836,7 +840,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BindResponseDecorator bindResponse = new BindResponseDecorator( new BindResponseImpl() );
+            BindResponseDecorator bindResponse = new BindResponseDecorator( codec, new BindResponseImpl() );
 
             container.getBatchResponse().addResponse( bindResponse );
 
@@ -879,7 +883,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareResponseDecorator compareResponse = new CompareResponseDecorator( new CompareResponseImpl() );
+            CompareResponseDecorator compareResponse = new CompareResponseDecorator( codec, new CompareResponseImpl() );
 
             container.getBatchResponse().addResponse( compareResponse );
 
@@ -921,7 +925,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DeleteResponseDecorator delResponse = new DeleteResponseDecorator( new DeleteResponseImpl() );
+            DeleteResponseDecorator delResponse = new DeleteResponseDecorator( codec, new DeleteResponseImpl() );
 
             container.getBatchResponse().addResponse( delResponse );
 
@@ -963,7 +967,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyResponseDecorator modifyResponse = new ModifyResponseDecorator( new ModifyResponseImpl() );
+            ModifyResponseDecorator modifyResponse = new ModifyResponseDecorator( codec, new ModifyResponseImpl() );
 
             container.getBatchResponse().addResponse( modifyResponse );
 
@@ -1005,7 +1009,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyDnResponseDecorator modifyDNResponse = new ModifyDnResponseDecorator( new ModifyDnResponseImpl() );
+            ModifyDnResponseDecorator modifyDNResponse = new ModifyDnResponseDecorator( codec, new ModifyDnResponseImpl() );
 
             container.getBatchResponse().addResponse( modifyDNResponse );
 
@@ -1059,11 +1063,11 @@ public final class Dsmlv2ResponseGrammar
 
             if ( attributeValue != null )
             {
-                extendedResponse = new ExtendedResponseDecorator( new ExtendedResponseImpl( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ) );
+                extendedResponse = new ExtendedResponseDecorator( codec, new ExtendedResponseImpl( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ) );
             }
             else
             {
-                extendedResponse = new ExtendedResponseDecorator( new ExtendedResponseImpl( -1 ) );
+                extendedResponse = new ExtendedResponseDecorator( codec, new ExtendedResponseImpl( -1 ) );
             }
 
             container.getBatchResponse().addResponse( extendedResponse );
@@ -1558,7 +1562,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultEntryDecorator searchResultEntry = new SearchResultEntryDecorator( new SearchResultEntryImpl() );
+            SearchResultEntryDecorator searchResultEntry = new SearchResultEntryDecorator( codec, new SearchResultEntryImpl() );
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
@@ -1605,7 +1609,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultReferenceDecorator searchResultReference = new SearchResultReferenceDecorator( new SearchResultReferenceImpl() );
+            SearchResultReferenceDecorator searchResultReference = new SearchResultReferenceDecorator( codec, new SearchResultReferenceImpl() );
 
             SearchResponse searchResponse = ( SearchResponse ) container.getBatchResponse().getCurrentResponse();
 
@@ -1633,7 +1637,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultDoneDecorator searchResultDone = new SearchResultDoneDecorator( new SearchResultDoneImpl() );
+            SearchResultDoneDecorator searchResultDone = new SearchResultDoneDecorator( codec, new SearchResultDoneImpl() );
 
             searchResultDone.getLdapResult();
 

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ExtendedResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -23,6 +23,7 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.asn1.util.OID;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponseImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -37,14 +38,14 @@ import org.dom4j.QName;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExtendedResponseDsml extends AbstractResponseDsml
+public class ExtendedResponseDsml extends AbstractResultResponseDsml<ExtendedResponse>
 {
     /**
      * Creates a new getDecoratedMessage() of ExtendedResponseDsml.
      */
-    public ExtendedResponseDsml()
+    public ExtendedResponseDsml( ILdapCodecService codec )
     {
-        super( new ExtendedResponseImpl( "" ) );
+        super( codec, new ExtendedResponseImpl( "" ) );
     }
 
 
@@ -54,9 +55,9 @@ public class ExtendedResponseDsml extend
      * @param ldapMessage
      *      the message to decorate
      */
-    public ExtendedResponseDsml( ExtendedResponse ldapMessage )
+    public ExtendedResponseDsml( ILdapCodecService codec, ExtendedResponse ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -65,7 +66,7 @@ public class ExtendedResponseDsml extend
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -75,10 +76,10 @@ public class ExtendedResponseDsml extend
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "extendedResponse" );
-        ExtendedResponse extendedResponse = ( ExtendedResponse ) getDecoratedMessage();
+        ExtendedResponse extendedResponse = ( ExtendedResponse ) getDecorated();
 
         // LDAP Result
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( extendedResponse.getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( extendedResponse.getLdapResult(), getDecorated() );
         ldapResultDsml.toDsml( element );
 
         // ResponseName
@@ -122,7 +123,7 @@ public class ExtendedResponseDsml extend
      */
     public String getResponseName()
     {
-        return ( ( ExtendedResponse ) getDecoratedMessage() ).getResponseName();
+        return ( ( ExtendedResponse ) getDecorated() ).getResponseName();
     }
 
 
@@ -133,7 +134,7 @@ public class ExtendedResponseDsml extend
      */
     public void setResponseName( OID responseName )
     {
-        ( ( ExtendedResponse ) getDecoratedMessage() ).setResponseName( responseName.toString() );
+        ( ( ExtendedResponse ) getDecorated() ).setResponseName( responseName.toString() );
     }
 
 
@@ -144,7 +145,7 @@ public class ExtendedResponseDsml extend
      */
     public Object getResponseValue()
     {
-        return ( ( ExtendedResponse ) getDecoratedMessage() ).getResponseValue();
+        return ( ( ExtendedResponse ) getDecorated() ).getResponseValue();
     }
 
 
@@ -155,6 +156,6 @@ public class ExtendedResponseDsml extend
      */
     public void setResponseValue( byte[] response )
     {
-        ( ( ExtendedResponse ) getDecoratedMessage() ).setResponseValue( response );
+        ( ( ExtendedResponse ) getDecorated() ).setResponseValue( response );
     }
 }

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=1065284&r1=1065283&r2=1065284&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 Sun Jan 30 14:16:26 2011
@@ -21,6 +21,7 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponse;
 import org.apache.directory.shared.ldap.model.message.ModifyDnResponseImpl;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModDNResponseDsml extends AbstractResponseDsml
+public class ModDNResponseDsml extends AbstractResultResponseDsml<ModifyDnResponse>
 {
     /**
      * Creates a new getDecoratedMessage() of ModDNResponseDsml.
      */
-    public ModDNResponseDsml()
+    public ModDNResponseDsml( ILdapCodecService codec )
     {
-        super( new ModifyDnResponseImpl() );
+        super( codec, new ModifyDnResponseImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class ModDNResponseDsml extends A
      * @param ldapMessage
      *      the message to decorate
      */
-    public ModDNResponseDsml( ModifyDnResponse ldapMessage )
+    public ModDNResponseDsml( ILdapCodecService codec, ModifyDnResponse ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class ModDNResponseDsml extends A
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class ModDNResponseDsml extends A
     {
         Element element = root.addElement( "modDNResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyDnResponse ) getDecoratedMessage() ).getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( ModifyDnResponse ) getDecorated() ).getLdapResult(), getDecorated() );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ModifyResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -21,6 +21,7 @@
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
 import org.apache.directory.shared.ldap.model.message.ModifyResponseImpl;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModifyResponseDsml extends AbstractResponseDsml
+public class ModifyResponseDsml extends AbstractResultResponseDsml<ModifyResponse>
 {
     /**
      * Creates a new getDecoratedMessage() of ModifyResponseDsml.
      */
-    public ModifyResponseDsml()
+    public ModifyResponseDsml( ILdapCodecService codec )
     {
-        super( new ModifyResponseImpl() );
+        super( codec, new ModifyResponseImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class ModifyResponseDsml extends 
      * @param ldapMessage
      *      the message to decorate
      */
-    public ModifyResponseDsml( ModifyResponse ldapMessage )
+    public ModifyResponseDsml( ILdapCodecService codec, ModifyResponse ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class ModifyResponseDsml extends 
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class ModifyResponseDsml extends 
     {
         Element element = root.addElement( "modifyResponse" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( (ModifyResponse) getDecoratedMessage() ).getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( (ModifyResponse) getDecorated() ).getLdapResult(), getDecorated() );
         ldapResultDsml.toDsml( element );
         return element;
     }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java Sun Jan 30 14:16:26 2011
@@ -24,7 +24,9 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.Message;
+import org.apache.directory.shared.ldap.model.message.ResultResponse;
 import org.dom4j.Element;
 
 
@@ -35,7 +37,7 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResponseDsml extends AbstractResponseDsml
+public class SearchResponseDsml extends AbstractResultResponseDsml<ResultResponse>
 {
     /** The responses */
     private List<DsmlDecorator> responses = new ArrayList<DsmlDecorator>();
@@ -44,9 +46,9 @@ public class SearchResponseDsml extends 
     /**
      * Creates a new getDecoratedMessage() of SearchResponseDsml.
      */
-    public SearchResponseDsml()
+    public SearchResponseDsml( ILdapCodecService codec )
     {
-        super( null );
+        super( codec, null );
     }
 
 
@@ -55,9 +57,9 @@ public class SearchResponseDsml extends 
      *
      * @param response the LDAP response message to decorate
      */
-    public SearchResponseDsml( Message response )
+    public SearchResponseDsml( ILdapCodecService codec, Message response )
     {
-        super( response );
+        super( codec, ( ResultResponse ) response );
     }
 
 
@@ -97,9 +99,9 @@ public class SearchResponseDsml extends 
         Element element = root.addElement( "searchResponse" );
 
         // RequestID
-        if ( getDecoratedMessage() != null )
+        if ( getDecorated() != null )
         {
-            int requestID = getDecoratedMessage().getMessageId();
+            int requestID = getDecorated().getMessageId();
             if ( requestID > 0 )
             {
                 element.addAttribute( "requestID", "" + requestID );

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultDoneDsml.java Sun Jan 30 14:16:26 2011
@@ -17,10 +17,10 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.SearchResultDone;
 import org.apache.directory.shared.ldap.model.message.SearchResultDoneImpl;
@@ -32,14 +32,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultDoneDsml extends AbstractResponseDsml
+public class SearchResultDoneDsml extends AbstractResultResponseDsml<SearchResultDone>
 {
     /**
      * Creates a new getDecoratedMessage() of SearchResultDoneDsml.
      */
-    public SearchResultDoneDsml()
+    public SearchResultDoneDsml( ILdapCodecService codec )
     {
-        super( new SearchResultDoneImpl() );
+        super( codec, new SearchResultDoneImpl() );
     }
 
 
@@ -49,9 +49,9 @@ public class SearchResultDoneDsml extend
      * @param ldapMessage
      *      the message to decorate
      */
-    public SearchResultDoneDsml( SearchResultDone ldapMessage )
+    public SearchResultDoneDsml( ILdapCodecService codec, SearchResultDone ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +60,7 @@ public class SearchResultDoneDsml extend
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +71,7 @@ public class SearchResultDoneDsml extend
     {
         Element element = root.addElement( "searchResultDone" );
 
-        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( SearchResultDone ) getDecoratedMessage() ).getLdapResult(), getDecoratedMessage() );
+        LdapResultDsml ldapResultDsml = new LdapResultDsml( ( ( SearchResultDone ) getDecorated() ).getLdapResult(), getDecorated() );
         if ( ldapResultDsml != null )
         {
             ldapResultDsml.toDsml( element );

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java Sun Jan 30 14:16:26 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.dsmlv2.ParserUtils;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
@@ -41,14 +42,14 @@ import org.dom4j.QName;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultEntryDsml extends AbstractResponseDsml
+public class SearchResultEntryDsml extends AbstractResponseDsml<SearchResultEntry>
 {
     /**
      * Creates a new getDecoratedMessage() of SearchResultEntryDsml.
      */
-    public SearchResultEntryDsml()
+    public SearchResultEntryDsml( ILdapCodecService codec )
     {
-        super( new SearchResultEntryImpl() );
+        super( codec, new SearchResultEntryImpl() );
     }
 
 
@@ -58,9 +59,9 @@ public class SearchResultEntryDsml exten
      * @param ldapMessage
      *      the message to decorate
      */
-    public SearchResultEntryDsml( SearchResultEntry ldapMessage )
+    public SearchResultEntryDsml( ILdapCodecService codec, SearchResultEntry ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -69,7 +70,7 @@ public class SearchResultEntryDsml exten
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -79,7 +80,7 @@ public class SearchResultEntryDsml exten
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "searchResultEntry" );
-        SearchResultEntry searchResultEntry = ( SearchResultEntry ) getDecoratedMessage();
+        SearchResultEntry searchResultEntry = ( SearchResultEntry ) getDecorated();
         element.addAttribute( "dn", searchResultEntry.getObjectName().getName() );
 
         Entry entry = searchResultEntry.getEntry();
@@ -121,7 +122,7 @@ public class SearchResultEntryDsml exten
      */
     public Dn getObjectName()
     {
-        return ( ( SearchResultEntry ) getDecoratedMessage() ).getObjectName();
+        return ( ( SearchResultEntry ) getDecorated() ).getObjectName();
     }
 
 
@@ -132,7 +133,7 @@ public class SearchResultEntryDsml exten
      */
     public void setObjectName( Dn objectName )
     {
-        ( ( SearchResultEntry ) getDecoratedMessage() ).setObjectName( objectName );
+        ( ( SearchResultEntry ) getDecorated() ).setObjectName( objectName );
     }
 
 
@@ -143,7 +144,7 @@ public class SearchResultEntryDsml exten
      */
     public Entry getEntry()
     {
-        return ( ( SearchResultEntry ) getDecoratedMessage() ).getEntry();
+        return ( ( SearchResultEntry ) getDecorated() ).getEntry();
     }
 
 
@@ -154,7 +155,7 @@ public class SearchResultEntryDsml exten
      */
     public void setEntry( Entry entry )
     {
-        ( ( SearchResultEntry ) getDecoratedMessage() ).setEntry( entry );
+        ( ( SearchResultEntry ) getDecorated() ).setEntry( entry );
     }
 
 
@@ -166,7 +167,7 @@ public class SearchResultEntryDsml exten
      */
     public void addAttributeType( String type ) throws LdapException
     {
-        ( ( SearchResultEntryDecorator ) getDecoratedMessage() ).addAttribute( type );
+        ( ( SearchResultEntryDecorator ) getDecorated() ).addAttribute( type );
     }
 
 
@@ -177,6 +178,6 @@ public class SearchResultEntryDsml exten
      */
     public void addAttributeValue( Object value )
     {
-        ( ( SearchResultEntryDecorator ) getDecoratedMessage() ).addAttributeValue( value );
+        ( ( SearchResultEntryDecorator ) getDecorated() ).addAttributeValue( value );
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultReferenceDsml.java Sun Jan 30 14:16:26 2011
@@ -23,8 +23,8 @@ package org.apache.directory.shared.dsml
 
 import java.util.List;
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.filter.LdapURL;
-import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 import org.apache.directory.shared.ldap.model.message.SearchResultReferenceImpl;
@@ -36,14 +36,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SearchResultReferenceDsml extends AbstractResponseDsml
+public class SearchResultReferenceDsml extends AbstractResponseDsml<SearchResultReference>
 {
     /**
      * Creates a new getDecoratedMessage() of SearchResultReferenceDsml.
      */
-    public SearchResultReferenceDsml()
+    public SearchResultReferenceDsml( ILdapCodecService codec )
     {
-        super( new SearchResultReferenceImpl() );
+        super( codec, new SearchResultReferenceImpl() );
     }
 
 
@@ -53,9 +53,9 @@ public class SearchResultReferenceDsml e
      * @param ldapMessage
      *      the message to decorate
      */
-    public SearchResultReferenceDsml( Message ldapMessage )
+    public SearchResultReferenceDsml( ILdapCodecService codec, SearchResultReference ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -64,7 +64,7 @@ public class SearchResultReferenceDsml e
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -74,7 +74,7 @@ public class SearchResultReferenceDsml e
     public Element toDsml( Element root )
     {
         Element element = root.addElement( "searchResultReference" );
-        SearchResultReference searchResultReference = ( SearchResultReference ) getDecoratedMessage();
+        SearchResultReference searchResultReference = ( SearchResultReference ) getDecorated();
 
         // Adding References
         List<String> refsList = ( List<String> ) searchResultReference.getReferral().getLdapUrls();
@@ -95,7 +95,7 @@ public class SearchResultReferenceDsml e
      */
     public void addSearchResultReference( LdapURL searchResultReference )
     {
-        ( ( SearchResultReference ) getDecoratedMessage() ).getReferral().addLdapUrl( searchResultReference.toString() );
+        ( ( SearchResultReference ) getDecorated() ).getReferral().addLdapUrl( searchResultReference.toString() );
     }
 
 
@@ -106,6 +106,6 @@ public class SearchResultReferenceDsml e
      */
     public List<String> getSearchResultReferences()
     {
-        return ( List<String> ) ( ( SearchResultReference ) getDecoratedMessage() ).getReferral().getLdapUrls();
+        return ( List<String> ) ( ( SearchResultReference ) getDecorated() ).getReferral().getLdapUrls();
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbandonRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.dsmlv2.request;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
 import org.apache.directory.shared.ldap.model.message.AbandonRequestImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -31,14 +32,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AbandonRequestDsml extends AbstractRequestDsml
+public class AbandonRequestDsml extends AbstractRequestDsml<AbandonRequest>
 {
     /**
      * Creates a new instance of AbandonRequestDsml.
      */
-    public AbandonRequestDsml()
+    public AbandonRequestDsml( ILdapCodecService codec )
     {
-        super( new AbandonRequestImpl() );
+        super( codec, new AbandonRequestImpl() );
     }
 
 
@@ -47,9 +48,9 @@ public class AbandonRequestDsml extends 
      *
      * @param ldapMessage the message to decorate
      */
-    public AbandonRequestDsml( AbandonRequest ldapMessage )
+    public AbandonRequestDsml( ILdapCodecService codec, AbandonRequest ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -58,7 +59,7 @@ public class AbandonRequestDsml extends 
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -69,7 +70,7 @@ public class AbandonRequestDsml extends 
     {
         Element element = super.toDsml( root );
 
-        AbandonRequest request = (AbandonRequest) getDecoratedMessage();
+        AbandonRequest request = (AbandonRequest) getDecorated();
 
         // AbandonID
         if ( request.getAbandoned() != 0 )
@@ -88,7 +89,7 @@ public class AbandonRequestDsml extends 
      */
     public int getAbandonedMessageId()
     {
-        return ( ( AbandonRequest ) getDecoratedMessage() ).getAbandoned();
+        return ( ( AbandonRequest ) getDecorated() ).getAbandoned();
     }
 
 
@@ -99,6 +100,6 @@ public class AbandonRequestDsml extends 
      */
     public void setAbandonedMessageId( int abandonedMessageId )
     {
-        ( ( AbandonRequest ) getDecoratedMessage() ).setAbandoned( abandonedMessageId );
+        ( ( AbandonRequest ) getDecorated() ).setAbandoned( abandonedMessageId );
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AbstractRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -22,8 +22,9 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.RequestDecorator;
-import org.apache.directory.shared.ldap.model.message.Message;
+import org.apache.directory.shared.ldap.model.message.Request;
 import org.dom4j.Element;
 
 
@@ -32,7 +33,7 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractRequestDsml extends RequestDecorator implements DsmlDecorator
+public abstract class AbstractRequestDsml<E extends Request> extends RequestDecorator<E> implements DsmlDecorator
 {
     /**
      * Creates a new instance of AbstractRequestDsml.
@@ -40,9 +41,9 @@ public abstract class AbstractRequestDsm
      * @param ldapMessage
      *      the message to decorate
      */
-    public AbstractRequestDsml( Message ldapMessage )
+    public AbstractRequestDsml( ILdapCodecService codec, E ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -59,14 +60,14 @@ public abstract class AbstractRequestDsm
         Element element = root.addElement( getRequestName() );
 
         // Request ID
-        int requestID = getDecoratedMessage().getMessageId();
+        int requestID = getDecorated().getMessageId();
         if ( requestID > 0 )
         {
             element.addAttribute( "requestID", "" + requestID );
         }
 
         // Controls
-        ParserUtils.addControls( element, getDecoratedMessage().getControls().values() );
+        ParserUtils.addControls( element, getDecorated().getControls().values() );
 
         return element;
     }
@@ -80,7 +81,7 @@ public abstract class AbstractRequestDsm
      */
     private String getRequestName()
     {
-        switch ( getDecoratedMessage().getType() )
+        switch ( getDecorated().getType() )
         {
             case ABANDON_REQUEST:
                 return "abandonRequest";

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.dsmlv2.ParserUtils;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.decorators.AddRequestDecorator;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
@@ -40,14 +41,14 @@ import org.dom4j.QName;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddRequestDsml extends AbstractRequestDsml
+public class AddRequestDsml extends AbstractRequestDsml<AddRequest>
 {
     /**
      * Creates a new getDecoratedMessage() of AddRequestDsml.
      */
-    public AddRequestDsml()
+    public AddRequestDsml( ILdapCodecService codec )
     {
-        super( new AddRequestImpl() );
+        super( codec, new AddRequestImpl() );
     }
 
 
@@ -57,9 +58,9 @@ public class AddRequestDsml extends Abst
     * @param ldapMessage
     *      the message to decorate
     */
-    public AddRequestDsml( AddRequest ldapMessage )
+    public AddRequestDsml( ILdapCodecService codec, AddRequest ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -68,7 +69,7 @@ public class AddRequestDsml extends Abst
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -79,7 +80,7 @@ public class AddRequestDsml extends Abst
     {
         Element element = super.toDsml( root );
 
-        AddRequest request = ( AddRequest ) getDecoratedMessage();
+        AddRequest request = ( AddRequest ) getDecorated();
 
         // Dn
         if ( request.getEntry() != null )
@@ -138,7 +139,7 @@ public class AddRequestDsml extends Abst
      */
     public Entry getEntry()
     {
-        return ( ( AddRequest ) getDecoratedMessage() ).getEntry();
+        return ( ( AddRequest ) getDecorated() ).getEntry();
     }
 
 
@@ -150,7 +151,7 @@ public class AddRequestDsml extends Abst
      */
     public void addAttributeType( String type ) throws LdapException
     {
-        ( ( AddRequestDecorator ) getDecoratedMessage() ).addAttributeType( type );
+        ( ( AddRequestDecorator ) getDecorated() ).addAttributeType( type );
     }
 
 
@@ -163,15 +164,15 @@ public class AddRequestDsml extends Abst
     {
         if ( value instanceof Value<?> )
         {
-            ( ( AddRequestDecorator ) getDecoratedMessage() ).addAttributeValue( (Value<?>) value );
+            ( ( AddRequestDecorator ) getDecorated() ).addAttributeValue( (Value<?>) value );
         }
         else if ( value instanceof String )
         {
-            ( ( AddRequestDecorator ) getDecoratedMessage() ).addAttributeValue( ( String ) value );
+            ( ( AddRequestDecorator ) getDecorated() ).addAttributeValue( ( String ) value );
         }
         else if ( value instanceof byte[] )
         {
-            ( ( AddRequestDecorator ) getDecoratedMessage() ).addAttributeValue( ( byte[] ) value );
+            ( ( AddRequestDecorator ) getDecorated() ).addAttributeValue( ( byte[] ) value );
         }
     }
 
@@ -183,7 +184,7 @@ public class AddRequestDsml extends Abst
      */
     public Dn getEntryDn()
     {
-        return ( ( AddRequest ) getDecoratedMessage() ).getEntryDn();
+        return ( ( AddRequest ) getDecorated() ).getEntryDn();
     }
 
 
@@ -194,7 +195,7 @@ public class AddRequestDsml extends Abst
      */
     public void setEntryDn( Dn entryDn )
     {
-        ( ( AddRequest ) getDecoratedMessage() ).setEntryDn( entryDn );
+        ( ( AddRequest ) getDecorated() ).setEntryDn( entryDn );
     }
 
 
@@ -206,7 +207,7 @@ public class AddRequestDsml extends Abst
      */
     public void setEntry( Entry entry )
     {
-        ( ( AddRequest ) getDecoratedMessage() ).setEntry( entry );
+        ( ( AddRequest ) getDecorated() ).setEntry( entry );
     }
 
 
@@ -215,6 +216,6 @@ public class AddRequestDsml extends Abst
      */
     public String getCurrentAttributeType()
     {
-        return ( ( AddRequestDecorator ) getDecoratedMessage() ).getCurrentAttributeType();
+        return ( ( AddRequestDecorator ) getDecorated() ).getCurrentAttributeType();
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.dsmlv2.request;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -31,14 +32,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AuthRequestDsml extends AbstractRequestDsml
+public class AuthRequestDsml extends AbstractRequestDsml<BindRequest>
 {
     /**
      * Creates a new getDecoratedMessage() of AuthRequestDsml.
      */
-    public AuthRequestDsml()
+    public AuthRequestDsml( ILdapCodecService codec )
     {
-        super( new BindRequestImpl() );
+        super( codec, new BindRequestImpl() );
     }
 
 
@@ -48,9 +49,9 @@ public class AuthRequestDsml extends Abs
      * @param ldapMessage
      *      the message to decorate
      */
-    public AuthRequestDsml( BindRequest ldapMessage )
+    public AuthRequestDsml( ILdapCodecService codec, BindRequest ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -59,7 +60,7 @@ public class AuthRequestDsml extends Abs
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -70,7 +71,7 @@ public class AuthRequestDsml extends Abs
     {
         Element element = super.toDsml( root );
 
-        BindRequest request = ( BindRequest ) getDecoratedMessage();
+        BindRequest request = ( BindRequest ) getDecorated();
 
         // AbandonID
         String name = request.getName().getName();

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/CompareRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/CompareRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/CompareRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/CompareRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.dsmlv2.request;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.CompareRequestImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CompareRequestDsml extends AbstractRequestDsml
+public class CompareRequestDsml extends AbstractRequestDsml<CompareRequest>
 {
     /**
      * Creates a new getDecoratedMessage() of CompareRequestDsml.
      */
-    public CompareRequestDsml()
+    public CompareRequestDsml( ILdapCodecService codec )
     {
-        super( new CompareRequestImpl() );
+        super( codec, new CompareRequestImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class CompareRequestDsml extends 
      * @param ldapMessage
      *      the message to decorate
      */
-    public CompareRequestDsml( CompareRequest ldapMessage )
+    public CompareRequestDsml( ILdapCodecService codec, CompareRequest ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class CompareRequestDsml extends 
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class CompareRequestDsml extends 
     {
         Element element = super.toDsml( root );
 
-        CompareRequest request = ( CompareRequest ) getDecoratedMessage();
+        CompareRequest request = ( CompareRequest ) getDecorated();
 
         // Dn
         if ( request.getName() != null )
@@ -101,7 +102,7 @@ public class CompareRequestDsml extends 
      */
     public Dn getName()
     {
-        return ( (CompareRequest) getDecoratedMessage() ).getName();
+        return ( (CompareRequest) getDecorated() ).getName();
     }
 
 
@@ -112,7 +113,7 @@ public class CompareRequestDsml extends 
      */
     public void setName( Dn entry )
     {
-        ( ( CompareRequest ) getDecoratedMessage() ).setName( entry );
+        ( ( CompareRequest ) getDecorated() ).setName( entry );
     }
 
 
@@ -123,7 +124,7 @@ public class CompareRequestDsml extends 
      */
     public Object getAssertionValue()
     {
-        return ( ( CompareRequest ) getDecoratedMessage() ).getAssertionValue();
+        return ( ( CompareRequest ) getDecorated() ).getAssertionValue();
     }
 
 
@@ -136,11 +137,11 @@ public class CompareRequestDsml extends 
     {
         if ( assertionValue instanceof String )
         {
-            ( ( CompareRequest ) getDecoratedMessage() ).setAssertionValue( ( String ) assertionValue );
+            ( ( CompareRequest ) getDecorated() ).setAssertionValue( ( String ) assertionValue );
         }
         else
         {
-            ( ( CompareRequest ) getDecoratedMessage() ).setAssertionValue( ( byte[] ) assertionValue );
+            ( ( CompareRequest ) getDecorated() ).setAssertionValue( ( byte[] ) assertionValue );
         }
     }
 
@@ -152,7 +153,7 @@ public class CompareRequestDsml extends 
      */
     public String getAttributeDesc()
     {
-        return ( ( CompareRequest ) getDecoratedMessage() ).getAttributeId();
+        return ( ( CompareRequest ) getDecorated() ).getAttributeId();
     }
 
 
@@ -163,6 +164,6 @@ public class CompareRequestDsml extends 
      */
     public void setAttributeDesc( String attributeDesc )
     {
-        ( ( CompareRequest ) getDecoratedMessage() ).setAttributeId( attributeDesc );
+        ( ( CompareRequest ) getDecorated() ).setAttributeId( attributeDesc );
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/DelRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/DelRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/DelRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/DelRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.dsmlv2.request;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 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.MessageTypeEnum;
@@ -32,14 +33,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DelRequestDsml extends AbstractRequestDsml
+public class DelRequestDsml extends AbstractRequestDsml<DeleteRequest>
 {
     /**
      * Creates a new getDecoratedMessage() of DelRequestDsml.
      */
-    public DelRequestDsml()
+    public DelRequestDsml( ILdapCodecService codec )
     {
-        super( new DeleteRequestImpl() );
+        super( codec, new DeleteRequestImpl() );
     }
 
 
@@ -49,9 +50,9 @@ public class DelRequestDsml extends Abst
      * @param ldapMessage
      *      the message to decorate
      */
-    public DelRequestDsml( DeleteRequest ldapMessage )
+    public DelRequestDsml( ILdapCodecService codec, DeleteRequest ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -60,7 +61,7 @@ public class DelRequestDsml extends Abst
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -71,7 +72,7 @@ public class DelRequestDsml extends Abst
     {
         Element element = super.toDsml( root );
 
-        DeleteRequest request = ( DeleteRequest ) getDecoratedMessage();
+        DeleteRequest request = ( DeleteRequest ) getDecorated();
 
         // Dn
         if ( request.getName() != null )
@@ -90,7 +91,7 @@ public class DelRequestDsml extends Abst
      */
     public Dn getEntry()
     {
-        return ( ( DeleteRequest ) getDecoratedMessage() ).getName();
+        return ( ( DeleteRequest ) getDecorated() ).getName();
     }
 
 
@@ -101,6 +102,6 @@ public class DelRequestDsml extends Abst
      */
     public void setEntry( Dn entry )
     {
-        ( (DeleteRequest) getDecoratedMessage() ).setName( entry );
+        ( (DeleteRequest) getDecorated() ).setName( entry );
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java Sun Jan 30 14:16:26 2011
@@ -40,9 +40,10 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
+import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
-import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
 import org.apache.directory.shared.ldap.codec.decorators.AbandonRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.AddRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.BindRequestDecorator;
@@ -97,6 +98,8 @@ public final class Dsmlv2Grammar extends
     /** The instance of grammar. Dsmlv2Grammar is a singleton */
     private static Dsmlv2Grammar instance = new Dsmlv2Grammar();
 
+    private ILdapCodecService codec = new DefaultLdapCodecService();
+    
 
     /**
      * Creates a new instance of Dsmlv2Grammar.
@@ -1147,7 +1150,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AbandonRequestDecorator abandonRequest = new AbandonRequestDecorator( new AbandonRequestImpl() );
+            AbandonRequestDecorator abandonRequest = new AbandonRequestDecorator( codec, new AbandonRequestImpl() );
             container.getBatchRequest().addRequest( abandonRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1194,7 +1197,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddRequestDecorator addRequest = new AddRequestDecorator( new AddRequestImpl() );
+            AddRequestDecorator addRequest = new AddRequestDecorator( codec, new AddRequestImpl() );
             container.getBatchRequest().addRequest( addRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1312,7 +1315,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BindRequestDecorator authRequest = new BindRequestDecorator( new BindRequestImpl() );
+            BindRequestDecorator authRequest = new BindRequestDecorator( codec, new BindRequestImpl() );
             container.getBatchRequest().addRequest( authRequest );
 
             authRequest.setSimple( true );
@@ -1364,7 +1367,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareRequestDecorator compareRequest = new CompareRequestDecorator( new CompareRequestImpl() );
+            CompareRequestDecorator compareRequest = new CompareRequestDecorator( codec, new CompareRequestImpl() );
             container.getBatchRequest().addRequest( compareRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1480,7 +1483,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DeleteRequestDecorator delRequest = new DeleteRequestDecorator( new DeleteRequestImpl() );
+            DeleteRequestDecorator delRequest = new DeleteRequestDecorator( codec, new DeleteRequestImpl() );
             container.getBatchRequest().addRequest( delRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1530,7 +1533,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestDecorator extendedRequest = new ExtendedRequestDecorator( new ExtendedRequestImpl() );
+            ExtendedRequestDecorator extendedRequest = new ExtendedRequestDecorator( codec, new ExtendedRequestImpl() );
             container.getBatchRequest().addRequest( extendedRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1639,7 +1642,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyDnRequestDecorator modifyDNRequest = new ModifyDnRequestDecorator( new ModifyDnRequestImpl() );
+            ModifyDnRequestDecorator modifyDNRequest = new ModifyDnRequestDecorator( codec, new ModifyDnRequestImpl() );
             container.getBatchRequest().addRequest( modifyDNRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1746,7 +1749,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestDecorator modifyRequest = new ModifyRequestDecorator( new ModifyRequestImpl() );
+            ModifyRequestDecorator modifyRequest = new ModifyRequestDecorator( codec, new ModifyRequestImpl() );
             container.getBatchRequest().addRequest( modifyRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1888,7 +1891,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequest = new SearchRequestDecorator( new SearchRequestImpl() );
+            SearchRequestDecorator searchRequest = new SearchRequestDecorator( codec, new SearchRequestImpl() );
             container.getBatchRequest().addRequest( searchRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -2609,7 +2612,7 @@ public final class Dsmlv2Grammar extends
         {
             // Adding the filter to the Search Filter
             SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
-            SearchRequest searchRequest = searchRequestDecorator.getSearchRequest();
+            SearchRequest searchRequest = searchRequestDecorator.getDecorated();
 
             searchRequest.setFilter( searchRequestDecorator.getFilterNode() );
         }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.asn1.util.OID;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -35,14 +36,14 @@ import org.dom4j.QName;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ExtendedRequestDsml extends AbstractRequestDsml
+public class ExtendedRequestDsml extends AbstractRequestDsml<ExtendedRequest>
 {
     /**
      * Creates a new getDecoratedMessage() of ExtendedRequestDsml.
      */
-    public ExtendedRequestDsml()
+    public ExtendedRequestDsml( ILdapCodecService codec )
     {
-        super( new ExtendedRequestImpl() );
+        super( codec, new ExtendedRequestImpl() );
     }
 
 
@@ -52,9 +53,9 @@ public class ExtendedRequestDsml extends
      * @param ldapMessage
      *      the message to decorate
      */
-    public ExtendedRequestDsml( ExtendedRequest ldapMessage )
+    public ExtendedRequestDsml( ILdapCodecService codec, ExtendedRequest ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -63,7 +64,7 @@ public class ExtendedRequestDsml extends
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -74,7 +75,7 @@ public class ExtendedRequestDsml extends
     {
         Element element = super.toDsml( root );
 
-        ExtendedRequest request = ( ExtendedRequest ) getDecoratedMessage();
+        ExtendedRequest request = ( ExtendedRequest ) getDecorated();
 
         // Request Name
         if ( request.getRequestName() != null )
@@ -103,7 +104,7 @@ public class ExtendedRequestDsml extends
      */
     public String getRequestName()
     {
-        return ( (ExtendedRequest) getDecoratedMessage() ).getRequestName();
+        return ( (ExtendedRequest) getDecorated() ).getRequestName();
     }
 
 
@@ -114,7 +115,7 @@ public class ExtendedRequestDsml extends
      */
     public void setRequestName( OID requestName )
     {
-        ( ( ExtendedRequest ) getDecoratedMessage() ).setRequestName( requestName.toString() );
+        ( ( ExtendedRequest ) getDecorated() ).setRequestName( requestName.toString() );
     }
 
 
@@ -125,7 +126,7 @@ public class ExtendedRequestDsml extends
      */
     public byte[] getRequestValue()
     {
-        return ( ( ExtendedRequest ) getDecoratedMessage() ).getRequestValue();
+        return ( ( ExtendedRequest ) getDecorated() ).getRequestValue();
     }
 
 
@@ -136,6 +137,6 @@ public class ExtendedRequestDsml extends
      */
     public void setRequestValue( byte[] requestValue )
     {
-        ( ( ExtendedRequest ) getDecoratedMessage() ).getRequestValue();
+        ( ( ExtendedRequest ) getDecorated() ).getRequestValue();
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyDNRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyDNRequestDsml.java?rev=1065284&r1=1065283&r2=1065284&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyDNRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyDNRequestDsml.java Sun Jan 30 14:16:26 2011
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.dsmlv2.request;
 
 
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
@@ -33,14 +34,14 @@ import org.dom4j.Element;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ModifyDNRequestDsml extends AbstractRequestDsml
+public class ModifyDNRequestDsml extends AbstractRequestDsml<ModifyDnRequest>
 {
     /**
      * Creates a new getDecoratedMessage() of ModifyDNRequestDsml.
      */
-    public ModifyDNRequestDsml()
+    public ModifyDNRequestDsml( ILdapCodecService codec )
     {
-        super( new ModifyDnRequestImpl() );
+        super( codec, new ModifyDnRequestImpl() );
     }
 
 
@@ -50,9 +51,9 @@ public class ModifyDNRequestDsml extends
      * @param ldapMessage
      *      the message to decorate
      */
-    public ModifyDNRequestDsml( ModifyDnRequest ldapMessage )
+    public ModifyDNRequestDsml( ILdapCodecService codec, ModifyDnRequest ldapMessage )
     {
-        super( ldapMessage );
+        super( codec, ldapMessage );
     }
 
 
@@ -61,7 +62,7 @@ public class ModifyDNRequestDsml extends
      */
     public MessageTypeEnum getType()
     {
-        return getDecoratedMessage().getType();
+        return getDecorated().getType();
     }
 
 
@@ -72,7 +73,7 @@ public class ModifyDNRequestDsml extends
     {
         Element element = super.toDsml( root );
 
-        ModifyDnRequest request = ( ModifyDnRequest ) getDecoratedMessage();
+        ModifyDnRequest request = ( ModifyDnRequest ) getDecorated();
 
         // Dn
         if ( request.getName() != null )
@@ -106,7 +107,7 @@ public class ModifyDNRequestDsml extends
      */
     public Dn getName()
     {
-        return ( ( ModifyDnRequest ) getDecoratedMessage() ).getName();
+        return ( ( ModifyDnRequest ) getDecorated() ).getName();
     }
 
 
@@ -117,7 +118,7 @@ public class ModifyDNRequestDsml extends
      */
     public void setEntry( Dn name )
     {
-        ( ( ModifyDnRequest ) getDecoratedMessage() ).setName( name );
+        ( ( ModifyDnRequest ) getDecorated() ).setName( name );
     }
 
 
@@ -128,7 +129,7 @@ public class ModifyDNRequestDsml extends
      */
     public boolean isDeleteOldRDN()
     {
-        return ( ( ModifyDnRequest ) getDecoratedMessage() ).getDeleteOldRdn();
+        return ( ( ModifyDnRequest ) getDecorated() ).getDeleteOldRdn();
     }
 
 
@@ -139,7 +140,7 @@ public class ModifyDNRequestDsml extends
      */
     public void setDeleteOldRDN( boolean deleteOldRDN )
     {
-        ( ( ModifyDnRequest ) getDecoratedMessage() ).setDeleteOldRdn( deleteOldRDN );
+        ( ( ModifyDnRequest ) getDecorated() ).setDeleteOldRdn( deleteOldRDN );
     }
 
 
@@ -150,7 +151,7 @@ public class ModifyDNRequestDsml extends
      */
     public Rdn getNewRDN()
     {
-        return ( ( ModifyDnRequest ) getDecoratedMessage() ).getNewRdn();
+        return ( ( ModifyDnRequest ) getDecorated() ).getNewRdn();
     }
 
 
@@ -161,7 +162,7 @@ public class ModifyDNRequestDsml extends
      */
     public void setNewRDN( Rdn newRdn)
     {
-        ( ( ModifyDnRequest ) getDecoratedMessage() ).setNewRdn(newRdn);
+        ( ( ModifyDnRequest ) getDecorated() ).setNewRdn(newRdn);
     }
 
 
@@ -172,7 +173,7 @@ public class ModifyDNRequestDsml extends
      */
     public Dn getNewSuperior()
     {
-        return ( (ModifyDnRequest) getDecoratedMessage() ).getNewSuperior();
+        return ( (ModifyDnRequest) getDecorated() ).getNewSuperior();
     }
 
 
@@ -183,6 +184,6 @@ public class ModifyDNRequestDsml extends
      */
     public void setNewSuperior( Dn newSuperior )
     {
-        ( ( ModifyDnRequest ) getDecoratedMessage() ).setNewSuperior( newSuperior );
+        ( ( ModifyDnRequest ) getDecorated() ).setNewSuperior( newSuperior );
     }
 }



Mime
View raw message