directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r987606 [4/25] - in /directory/shared/trunk: ./ all/ asn1-codec/ asn1-codec/src/main/java/org/apache/directory/shared/asn1/codec/ asn1/ asn1/src/main/java/org/apache/directory/shared/asn1/ber/grammar/ asn1/src/main/java/org/apache/directory...
Date Fri, 20 Aug 2010 19:23:37 GMT
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=987606&r1=987605&r2=987606&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 Fri Aug 20 19:23:27 2010
@@ -22,11 +22,12 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Value;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.message.AddRequest;
+import org.apache.directory.shared.ldap.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.name.DN;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
@@ -45,7 +46,7 @@ public class AddRequestDsml extends Abst
      */
     public AddRequestDsml()
     {
-        super( new AddRequestCodec() );
+        super( new AddRequestImpl() );
     }
 
 
@@ -55,7 +56,7 @@ public class AddRequestDsml extends Abst
     * @param ldapMessage
     *      the message to decorate
     */
-    public AddRequestDsml( AddRequestCodec ldapMessage )
+    public AddRequestDsml( AddRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -64,9 +65,9 @@ public class AddRequestDsml extends Abst
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -77,7 +78,7 @@ public class AddRequestDsml extends Abst
     {
         Element element = super.toDsml( root );
 
-        AddRequestCodec request = ( AddRequestCodec ) instance;
+        AddRequest request = ( AddRequest ) instance;
 
         // DN
         if ( request.getEntry() != null )
@@ -125,7 +126,7 @@ public class AddRequestDsml extends Abst
      */
     public void initEntry()
     {
-        ( ( AddRequestCodec ) instance ).initEntry();
+        //( ( AddRequest ) instance ).initEntry();
     }
 
 
@@ -136,7 +137,7 @@ public class AddRequestDsml extends Abst
      */
     public Entry getEntry()
     {
-        return ( ( AddRequestCodec ) instance ).getEntry();
+        return ( ( AddRequest ) instance ).getEntry();
     }
 
 
@@ -148,7 +149,7 @@ public class AddRequestDsml extends Abst
      */
     public void addAttributeType( String type ) throws LdapException
     {
-        ( ( AddRequestCodec ) instance ).addAttributeType( type );
+        ( ( AddRequest ) instance ).addAttributeType( type );
     }
 
 
@@ -161,15 +162,15 @@ public class AddRequestDsml extends Abst
     {
         if ( value instanceof Value<?> )
         {
-            ( ( AddRequestCodec ) instance ).addAttributeValue( ( Value<?> ) value );
+            ( ( AddRequest ) instance ).addAttributeValue( ( Value<?> ) value );
         }
         else if ( value instanceof String )
         {
-            ( ( AddRequestCodec ) instance ).addAttributeValue( ( String ) value );
+            ( ( AddRequest ) instance ).addAttributeValue( ( String ) value );
         }
         else if ( value instanceof byte[] )
         {
-            ( ( AddRequestCodec ) instance ).addAttributeValue( ( byte[] ) value );
+            ( ( AddRequest ) instance ).addAttributeValue( ( byte[] ) value );
         }
     }
 
@@ -181,7 +182,7 @@ public class AddRequestDsml extends Abst
      */
     public DN getEntryDn()
     {
-        return ( ( AddRequestCodec ) instance ).getEntryDn();
+        return ( ( AddRequest ) instance ).getEntryDn();
     }
 
 
@@ -192,7 +193,7 @@ public class AddRequestDsml extends Abst
      */
     public void setEntryDn( DN entryDn )
     {
-        ( ( AddRequestCodec ) instance ).setEntryDn( entryDn );
+        ( ( AddRequest ) instance ).setEntryDn( entryDn );
     }
 
 
@@ -204,7 +205,7 @@ public class AddRequestDsml extends Abst
      */
     public void setEntry( Entry entry )
     {
-        ( ( AddRequestCodec ) instance ).setEntry( entry );
+        ( ( AddRequest ) instance ).setEntry( entry );
     }
 
 
@@ -213,6 +214,6 @@ public class AddRequestDsml extends Abst
      */
     public String getCurrentAttributeType()
     {
-        return ( ( AddRequestCodec ) instance ).getCurrentAttributeType();
+        return ( ( AddRequest ) instance ).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=987606&r1=987605&r2=987606&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 Fri Aug 20 19:23:27 2010
@@ -21,7 +21,8 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
+import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.BindRequestImpl;
 import org.dom4j.Element;
 
 
@@ -37,7 +38,7 @@ public class AuthRequestDsml extends Abs
      */
     public AuthRequestDsml()
     {
-        super( new BindRequestCodec() );
+        super( new BindRequestImpl() );
     }
 
 
@@ -47,7 +48,7 @@ public class AuthRequestDsml extends Abs
      * @param ldapMessage
      *      the message to decorate
      */
-    public AuthRequestDsml( BindRequestCodec ldapMessage )
+    public AuthRequestDsml( BindRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -56,9 +57,9 @@ public class AuthRequestDsml extends Abs
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -69,7 +70,7 @@ public class AuthRequestDsml extends Abs
     {
         Element element = super.toDsml( root );
 
-        BindRequestCodec request = ( BindRequestCodec ) instance;
+        BindRequest request = ( BindRequest ) instance;
 
         // AbandonID
         String name = request.getName().getName();

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequest.java?rev=987606&r1=987605&r2=987606&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequest.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequest.java Fri Aug 20 19:23:27 2010
@@ -24,7 +24,7 @@ package org.apache.directory.shared.dsml
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.message.Message;
 
 
 /**
@@ -37,7 +37,7 @@ public class BatchRequest
     /**
      * The requests contained in the Batch Request
      */
-    private List<LdapMessageCodec> requests;
+    private List<Message> requests;
 
     /**
      * The ID of the request
@@ -95,7 +95,7 @@ public class BatchRequest
      */
     public BatchRequest()
     {
-        requests = new ArrayList<LdapMessageCodec>();
+        requests = new ArrayList<Message>();
         responseOrder = ResponseOrder.SEQUENTIAL;
         processing = Processing.SEQUENTIAL;
         onError = OnError.EXIT;
@@ -110,7 +110,7 @@ public class BatchRequest
      * @return
      *      true (as per the general contract of the Collection.add method)
      */
-    public boolean addRequest( LdapMessageCodec request )
+    public boolean addRequest( Message request )
     {
         return requests.add( request );
     }
@@ -122,7 +122,7 @@ public class BatchRequest
      * @return
      *      the current request
      */
-    public LdapMessageCodec getCurrentRequest()
+    public Message getCurrentRequest()
     {
         return requests.get( requests.size() - 1 );
     }
@@ -227,17 +227,16 @@ public class BatchRequest
     /**
      * Gets the List of all the requests in the Batch Request
      *
-     * @return
-     *      the List of all the requests in the Batch Request
+     * @return the List of all the requests in the Batch Request
      */
-    public List getRequests()
+    public List<Message> getRequests()
     {
         return requests;
     }
 
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
+    /**
+     * {@inheritDoc}
      */
     @Override
     public String toString()

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=987606&r1=987605&r2=987606&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 Fri Aug 20 19:23:27 2010
@@ -21,7 +21,8 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.compare.CompareRequestCodec;
+import org.apache.directory.shared.ldap.message.CompareRequest;
+import org.apache.directory.shared.ldap.message.CompareRequestImpl;
 import org.apache.directory.shared.ldap.name.DN;
 import org.dom4j.Element;
 
@@ -38,7 +39,7 @@ public class CompareRequestDsml extends 
      */
     public CompareRequestDsml()
     {
-        super( new CompareRequestCodec() );
+        super( new CompareRequestImpl() );
     }
 
 
@@ -48,7 +49,7 @@ public class CompareRequestDsml extends 
      * @param ldapMessage
      *      the message to decorate
      */
-    public CompareRequestDsml( CompareRequestCodec ldapMessage )
+    public CompareRequestDsml( CompareRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -57,9 +58,9 @@ public class CompareRequestDsml extends 
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -70,23 +71,23 @@ public class CompareRequestDsml extends 
     {
         Element element = super.toDsml( root );
 
-        CompareRequestCodec request = ( CompareRequestCodec ) instance;
+        CompareRequest request = ( CompareRequest ) instance;
 
         // DN
-        if ( request.getEntry() != null )
+        if ( request.getName() != null )
         {
-            element.addAttribute( "dn", request.getEntry().getName() );
+            element.addAttribute( "dn", request.getName().getName() );
         }
 
         // Assertion
         Element assertionElement = element.addElement( "assertion" );
-        if ( request.getAttributeDesc() != null )
+        if ( request.getAttributeId() != null )
         {
-            assertionElement.addAttribute( "name", request.getAttributeDesc() );
+            assertionElement.addAttribute( "name", request.getAttributeId() );
         }
         if ( request.getAssertionValue() != null )
         {
-            assertionElement.addElement( "value" ).setText( ( String ) request.getAssertionValue() );
+            assertionElement.addElement( "value" ).setText( request.getAssertionValue().getString() );
         }
 
         return element;
@@ -98,9 +99,9 @@ public class CompareRequestDsml extends 
      * 
      * @return Returns the entry.
      */
-    public DN getEntry()
+    public DN getName()
     {
-        return ( ( CompareRequestCodec ) instance ).getEntry();
+        return ( ( CompareRequest ) instance ).getName();
     }
 
 
@@ -109,9 +110,9 @@ public class CompareRequestDsml extends 
      * 
      * @param entry The entry to set.
      */
-    public void setEntry( DN entry )
+    public void setName( DN entry )
     {
-        ( ( CompareRequestCodec ) instance ).setEntry( entry );
+        ( ( CompareRequest ) instance ).setName( entry );
     }
 
 
@@ -122,7 +123,7 @@ public class CompareRequestDsml extends 
      */
     public Object getAssertionValue()
     {
-        return ( ( CompareRequestCodec ) instance ).getAssertionValue();
+        return ( ( CompareRequest ) instance ).getAssertionValue();
     }
 
 
@@ -133,7 +134,14 @@ public class CompareRequestDsml extends 
      */
     public void setAssertionValue( Object assertionValue )
     {
-        ( ( CompareRequestCodec ) instance ).setAssertionValue( assertionValue );
+        if ( assertionValue instanceof String )
+        {
+            ( ( CompareRequest ) instance ).setAssertionValue( ( String ) assertionValue );
+        }
+        else
+        {
+            ( ( CompareRequest ) instance ).setAssertionValue( ( byte[] ) assertionValue );
+        }
     }
 
 
@@ -144,7 +152,7 @@ public class CompareRequestDsml extends 
      */
     public String getAttributeDesc()
     {
-        return ( ( CompareRequestCodec ) instance ).getAttributeDesc();
+        return ( ( CompareRequest ) instance ).getAttributeId();
     }
 
 
@@ -155,6 +163,6 @@ public class CompareRequestDsml extends 
      */
     public void setAttributeDesc( String attributeDesc )
     {
-        ( ( CompareRequestCodec ) instance ).setAttributeDesc( attributeDesc );
+        ( ( CompareRequest ) instance ).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=987606&r1=987605&r2=987606&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 Fri Aug 20 19:23:27 2010
@@ -21,13 +21,14 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.del.DelRequestCodec;
+import org.apache.directory.shared.ldap.message.DeleteRequest;
+import org.apache.directory.shared.ldap.message.DeleteRequestImpl;
 import org.apache.directory.shared.ldap.name.DN;
 import org.dom4j.Element;
 
 
 /**
- * DSML Decorator for DelRequest
+ * DSML Decorator for DeleteRequest
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -38,7 +39,7 @@ public class DelRequestDsml extends Abst
      */
     public DelRequestDsml()
     {
-        super( new DelRequestCodec() );
+        super( new DeleteRequestImpl() );
     }
 
 
@@ -48,7 +49,7 @@ public class DelRequestDsml extends Abst
      * @param ldapMessage
      *      the message to decorate
      */
-    public DelRequestDsml( DelRequestCodec ldapMessage )
+    public DelRequestDsml( DeleteRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -57,9 +58,9 @@ public class DelRequestDsml extends Abst
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -70,12 +71,12 @@ public class DelRequestDsml extends Abst
     {
         Element element = super.toDsml( root );
 
-        DelRequestCodec request = ( DelRequestCodec ) instance;
+        DeleteRequest request = ( DeleteRequest ) instance;
 
         // DN
-        if ( request.getEntry() != null )
+        if ( request.getName() != null )
         {
-            element.addAttribute( "dn", request.getEntry().getName() );
+            element.addAttribute( "dn", request.getName().getName() );
         }
 
         return element;
@@ -89,7 +90,7 @@ public class DelRequestDsml extends Abst
      */
     public DN getEntry()
     {
-        return ( ( DelRequestCodec ) instance ).getEntry();
+        return ( ( DeleteRequest ) instance ).getName();
     }
 
 
@@ -100,6 +101,6 @@ public class DelRequestDsml extends Abst
      */
     public void setEntry( DN entry )
     {
-        ( ( DelRequestCodec ) instance ).setEntry( entry );
+        ( ( DeleteRequest ) instance ).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=987606&r1=987605&r2=987606&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 Fri Aug 20 19:23:27 2010
@@ -25,7 +25,6 @@ import java.io.IOException;
 import java.lang.reflect.Array;
 import java.util.HashMap;
 
-import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.dsmlv2.AbstractGrammar;
@@ -42,16 +41,7 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
-import org.apache.directory.shared.ldap.codec.abandon.AbandonRequestCodec;
-import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
-import org.apache.directory.shared.ldap.codec.bind.BindRequestCodec;
-import org.apache.directory.shared.ldap.codec.bind.SimpleAuthentication;
-import org.apache.directory.shared.ldap.codec.compare.CompareRequestCodec;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
-import org.apache.directory.shared.ldap.codec.del.DelRequestCodec;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedRequestCodec;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.AndFilter;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
@@ -59,7 +49,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.search.NotFilter;
 import org.apache.directory.shared.ldap.codec.search.OrFilter;
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
-import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.entry.BinaryValue;
 import org.apache.directory.shared.ldap.entry.StringValue;
@@ -67,11 +56,29 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.filter.SearchScope;
+import org.apache.directory.shared.ldap.message.AbandonRequest;
+import org.apache.directory.shared.ldap.message.AbandonRequestImpl;
+import org.apache.directory.shared.ldap.message.AddRequest;
+import org.apache.directory.shared.ldap.message.AddRequestImpl;
+import org.apache.directory.shared.ldap.message.AliasDerefMode;
+import org.apache.directory.shared.ldap.message.BindRequest;
+import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.message.CompareRequest;
+import org.apache.directory.shared.ldap.message.CompareRequestImpl;
+import org.apache.directory.shared.ldap.message.DeleteRequest;
+import org.apache.directory.shared.ldap.message.DeleteRequestImpl;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.ExtendedRequestImpl;
+import org.apache.directory.shared.ldap.message.ModifyDnRequest;
+import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
+import org.apache.directory.shared.ldap.message.ModifyRequest;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
+import org.apache.directory.shared.ldap.message.SearchRequest;
+import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.message.control.Control;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.apache.directory.shared.ldap.util.Base64;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 
@@ -1131,7 +1138,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AbandonRequestCodec abandonRequest = new AbandonRequestCodec();
+            AbandonRequest abandonRequest = new AbandonRequestImpl();
             container.getBatchRequest().addRequest( abandonRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1148,7 +1155,7 @@ public class Dsmlv2Grammar extends Abstr
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( I18n.err(I18n.ERR_03016 ), xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // abandonID
@@ -1157,16 +1164,16 @@ public class Dsmlv2Grammar extends Abstr
             {
                 try
                 {
-                    abandonRequest.setAbandonedMessageId( Integer.parseInt( attributeValue ) );
+                    abandonRequest.setAbandoned( Integer.parseInt( attributeValue ) );
                 }
                 catch ( NumberFormatException e )
                 {
-                    throw new XmlPullParserException( I18n.err(I18n.ERR_03017 ), xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03017 ), xpp, null );
                 }
             }
             else
             {
-                throw new XmlPullParserException( I18n.err(I18n.ERR_03018 ), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03018 ), xpp, null );
             }
         }
     };
@@ -1178,9 +1185,8 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddRequestCodec addRequest = new AddRequestCodec();
+            AddRequest addRequest = new AddRequestImpl();
             container.getBatchRequest().addRequest( addRequest );
-            addRequest.initEntry(); // TODO maybe delay that to the first attribute discovery
 
             XmlPullParser xpp = container.getParser();
 
@@ -1196,7 +1202,7 @@ public class Dsmlv2Grammar extends Abstr
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( I18n.err(I18n.ERR_03016 ), xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // dn
@@ -1214,7 +1220,7 @@ public class Dsmlv2Grammar extends Abstr
             }
             else
             {
-                throw new XmlPullParserException( I18n.err(I18n.ERR_03019 ), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null );
             }
         }
     };
@@ -1226,7 +1232,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddRequestCodec addRequest = ( AddRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            AddRequest addRequest = ( AddRequest ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1242,12 +1248,12 @@ public class Dsmlv2Grammar extends Abstr
                 }
                 catch ( LdapException e )
                 {
-                    throw new XmlPullParserException( I18n.err(I18n.ERR_03020 ), xpp, e );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03020 ), xpp, e );
                 }
             }
             else
             {
-                throw new XmlPullParserException( I18n.err(I18n.ERR_03012 ), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
         }
     };
@@ -1259,7 +1265,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddRequestCodec addRequest = ( AddRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            AddRequest addRequest = ( AddRequest ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
             try
@@ -1283,7 +1289,7 @@ public class Dsmlv2Grammar extends Abstr
             }
             catch ( IOException e )
             {
-                throw new XmlPullParserException( I18n.err(I18n.ERR_03008, e.getMessage() ), xpp, null );
+                throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
         }
     };
@@ -1295,13 +1301,11 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BindRequestCodec authRequest = new BindRequestCodec();
+            BindRequest authRequest = new BindRequestImpl();
             container.getBatchRequest().addRequest( authRequest );
 
-            SimpleAuthentication simpleAuthentication = new SimpleAuthentication();
-            simpleAuthentication.setSimple( StringTools.EMPTY_BYTES );
-            authRequest.setAuthentication( simpleAuthentication );
-            authRequest.setVersion( 3 );
+            authRequest.setSimple( true );
+            authRequest.setVersion3( true );
 
             XmlPullParser xpp = container.getParser();
 
@@ -1309,6 +1313,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 authRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1317,11 +1322,12 @@ public class Dsmlv2Grammar extends Abstr
             {
                 if ( ParserUtils.isRequestIdNeeded( container ) )
                 {
-                    throw new XmlPullParserException( I18n.err(I18n.ERR_03016 ), xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
             // principal
             attributeValue = xpp.getAttributeValue( "", "principal" );
+
             if ( attributeValue != null )
             {
                 try
@@ -1347,7 +1353,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareRequestCodec compareRequest = new CompareRequestCodec();
+            CompareRequest compareRequest = new CompareRequestImpl();
             container.getBatchRequest().addRequest( compareRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1356,6 +1362,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 compareRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1367,13 +1374,15 @@ public class Dsmlv2Grammar extends Abstr
                     throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
+
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    compareRequest.setEntry( new DN( attributeValue ) );
+                    compareRequest.setName( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1394,18 +1403,19 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareRequestCodec compareRequest = ( CompareRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
             // Checking and adding the request's attributes
-            String attributeValue;
+            String attributeId;
+
             // name
-            attributeValue = xpp.getAttributeValue( "", "name" );
-            if ( attributeValue != null )
-            {
-                compareRequest.setAttributeDesc( attributeValue );
+            attributeId = xpp.getAttributeValue( "", "name" );
 
+            if ( attributeId != null )
+            {
+                compareRequest.setAttributeId( attributeId );
             }
             else
             {
@@ -1421,9 +1431,10 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareRequestCodec compareRequest = ( CompareRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            CompareRequest compareRequest = ( CompareRequest ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -1431,6 +1442,7 @@ public class Dsmlv2Grammar extends Abstr
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
@@ -1439,7 +1451,6 @@ public class Dsmlv2Grammar extends Abstr
                     }
                     else
                     {
-
                         compareRequest.setAssertionValue( nextText.trim() );
                     }
                 }
@@ -1458,7 +1469,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DelRequestCodec delRequest = new DelRequestCodec();
+            DeleteRequest delRequest = new DeleteRequestImpl();
             container.getBatchRequest().addRequest( delRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1467,6 +1478,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 delRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1478,13 +1490,15 @@ public class Dsmlv2Grammar extends Abstr
                     throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
+
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    delRequest.setEntry( new DN( attributeValue ) );
+                    delRequest.setName( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1505,7 +1519,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestCodec extendedRequest = new ExtendedRequestCodec();
+            ExtendedRequest extendedRequest = new ExtendedRequestImpl();
             container.getBatchRequest().addRequest( extendedRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1514,6 +1528,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 extendedRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1535,29 +1550,36 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            ExtendedRequest extendedRequest = ( ExtendedRequest ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 String nextText = xpp.nextText();
+
                 if ( nextText.equals( "" ) )
                 {
                     throw new XmlPullParserException( I18n.err( I18n.ERR_03022 ), xpp, null );
                 }
                 else
                 {
-                    extendedRequest.setRequestName( new OID( nextText.trim() ) );
+                    String oid = nextText.trim();
+
+                    if ( OID.isOID( oid ) )
+                    {
+                        extendedRequest.setRequestName( nextText.trim() );
+                    }
+                    else
+                    {
+                        throw new XmlPullParserException( "Bad oid : " + oid, xpp, null );
+                    }
                 }
             }
             catch ( IOException e )
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03008, e.getMessage() ), xpp, null );
             }
-            catch ( DecoderException e )
-            {
-                throw new XmlPullParserException( e.getMessage(), xpp, null );
-            }
         }
     };
 
@@ -1568,9 +1590,10 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestCodec extendedRequest = ( ExtendedRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            ExtendedRequest extendedRequest = ( ExtendedRequest ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -1578,6 +1601,7 @@ public class Dsmlv2Grammar extends Abstr
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
@@ -1604,7 +1628,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyDNRequestCodec modifyDNRequest = new ModifyDNRequestCodec();
+            ModifyDnRequest modifyDNRequest = new ModifyDnRequestImpl();
             container.getBatchRequest().addRequest( modifyDNRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1613,6 +1637,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 modifyDNRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1624,13 +1649,15 @@ public class Dsmlv2Grammar extends Abstr
                     throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
+
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    modifyDNRequest.setEntry( new DN( attributeValue ) );
+                    modifyDNRequest.setName( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1641,13 +1668,15 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null );
             }
+
             // newrdn
             attributeValue = xpp.getAttributeValue( "", "newrdn" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    modifyDNRequest.setNewRDN( new RDN( attributeValue ) );
+                    modifyDNRequest.setNewRdn( new RDN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1658,29 +1687,33 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03023 ), xpp, null );
             }
+
             // deleteoldrdn
             attributeValue = xpp.getAttributeValue( "", "deleteoldrdn" );
+
             if ( attributeValue != null )
             {
-                if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) )
+                if ( ( attributeValue.equalsIgnoreCase( "true" ) ) || ( attributeValue.equals( "1" ) ) )
                 {
-                    modifyDNRequest.setDeleteOldRDN( true );
+                    modifyDNRequest.setDeleteOldRdn( true );
                 }
-                else if ( ( attributeValue.equals( "false" ) ) || ( attributeValue.equals( "0" ) ) )
+                else if ( ( attributeValue.equalsIgnoreCase( "false" ) ) || ( attributeValue.equals( "0" ) ) )
                 {
-                    modifyDNRequest.setDeleteOldRDN( false );
+                    modifyDNRequest.setDeleteOldRdn( false );
                 }
                 else
                 {
-                    throw new XmlPullParserException(I18n.err( I18n.ERR_03024 ), xpp, null );
+                    throw new XmlPullParserException( I18n.err( I18n.ERR_03024 ), xpp, null );
                 }
             }
             else
             {
-                modifyDNRequest.setDeleteOldRDN( true );
+                modifyDNRequest.setDeleteOldRdn( true );
             }
+
             // newsuperior
             attributeValue = xpp.getAttributeValue( "", "newSuperior" );
+
             if ( attributeValue != null )
             {
                 try
@@ -1702,17 +1735,16 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestCodec modifyRequest = new ModifyRequestCodec();
+            ModifyRequest modifyRequest = new ModifyRequestImpl();
             container.getBatchRequest().addRequest( modifyRequest );
 
-            modifyRequest.initModifications();
-
             XmlPullParser xpp = container.getParser();
 
             // Checking and adding the request's attributes
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 modifyRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1724,13 +1756,15 @@ public class Dsmlv2Grammar extends Abstr
                     throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
+
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    modifyRequest.setObject( new DN( attributeValue ) );
+                    modifyRequest.setName( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1751,7 +1785,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            ModifyRequestImpl modifyRequest = ( ModifyRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1759,6 +1793,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // operation
             attributeValue = xpp.getAttributeValue( "", "operation" );
+
             if ( attributeValue != null )
             {
                 if ( "add".equals( attributeValue ) )
@@ -1783,8 +1818,10 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03025 ), xpp, null );
             }
+
             // name
             attributeValue = xpp.getAttributeValue( "", "name" );
+
             if ( attributeValue != null )
             {
                 modifyRequest.addAttributeTypeAndValues( attributeValue );
@@ -1804,9 +1841,10 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestCodec modifyRequest = ( ModifyRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            ModifyRequestImpl modifyRequest = ( ModifyRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -1839,7 +1877,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = new SearchRequestCodec();
+            SearchRequest searchRequest = new SearchRequestImpl();
             container.getBatchRequest().addRequest( searchRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1848,6 +1886,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // requestID
             attributeValue = xpp.getAttributeValue( "", "requestID" );
+
             if ( attributeValue != null )
             {
                 searchRequest.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
@@ -1859,13 +1898,15 @@ public class Dsmlv2Grammar extends Abstr
                     throw new XmlPullParserException( I18n.err( I18n.ERR_03016 ), xpp, null );
                 }
             }
+
             // dn
             attributeValue = xpp.getAttributeValue( "", "dn" );
+
             if ( attributeValue != null )
             {
                 try
                 {
-                    searchRequest.setBaseObject( new DN( attributeValue ) );
+                    searchRequest.setBase( new DN( attributeValue ) );
                 }
                 catch ( LdapInvalidDnException e )
                 {
@@ -1876,8 +1917,10 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03019 ), xpp, null );
             }
+
             // scope
             attributeValue = xpp.getAttributeValue( "", "scope" );
+
             if ( attributeValue != null )
             {
                 if ( "baseObject".equals( attributeValue ) )
@@ -1901,25 +1944,27 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03027 ), xpp, null );
             }
+
             // derefAliases
             attributeValue = xpp.getAttributeValue( "", "derefAliases" );
+
             if ( attributeValue != null )
             {
                 if ( "neverDerefAliases".equals( attributeValue ) )
                 {
-                    searchRequest.setDerefAliases( LdapConstants.NEVER_DEREF_ALIASES );
+                    searchRequest.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );
                 }
                 else if ( "derefInSearching".equals( attributeValue ) )
                 {
-                    searchRequest.setDerefAliases( LdapConstants.DEREF_IN_SEARCHING );
+                    searchRequest.setDerefAliases( AliasDerefMode.DEREF_IN_SEARCHING );
                 }
                 else if ( "derefFindingBaseObj".equals( attributeValue ) )
                 {
-                    searchRequest.setDerefAliases( LdapConstants.DEREF_FINDING_BASE_OBJ );
+                    searchRequest.setDerefAliases( AliasDerefMode.DEREF_FINDING_BASE_OBJ );
                 }
                 else if ( "derefAlways".equals( attributeValue ) )
                 {
-                    searchRequest.setDerefAliases( LdapConstants.DEREF_ALWAYS );
+                    searchRequest.setDerefAliases( AliasDerefMode.DEREF_ALWAYS );
                 }
                 else
                 {
@@ -1930,8 +1975,10 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03029 ), xpp, null );
             }
+
             // sizeLimit
             attributeValue = xpp.getAttributeValue( "", "sizeLimit" );
+
             if ( attributeValue != null )
             {
                 try
@@ -1947,8 +1994,10 @@ public class Dsmlv2Grammar extends Abstr
             {
                 searchRequest.setSizeLimit( 0L );
             }
+
             // timeLimit
             attributeValue = xpp.getAttributeValue( "", "timeLimit" );
+
             if ( attributeValue != null )
             {
                 try
@@ -1964,8 +2013,10 @@ public class Dsmlv2Grammar extends Abstr
             {
                 searchRequest.setTimeLimit( 0 );
             }
+
             // typesOnly
             attributeValue = xpp.getAttributeValue( "", "typesOnly" );
+
             if ( attributeValue != null )
             {
                 if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) )
@@ -1996,17 +2047,16 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
-            // Checking and adding the request's attributes
-            String attributeValue;
-            // name
-            attributeValue = xpp.getAttributeValue( "", "name" );
-            if ( attributeValue != null )
+            // Checking and adding the request's attribute name
+            String attributeName = xpp.getAttributeValue( "", "name" );
+
+            if ( attributeName != null )
             {
-                searchRequest.addAttribute( attributeValue );
+                searchRequest.addAttributes( attributeName );
             }
             else
             {
@@ -2022,7 +2072,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2043,6 +2093,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // name
             attributeValue = xpp.getAttributeValue( "", "name" );
+
             if ( attributeValue != null )
             {
                 filter.setType( attributeValue );
@@ -2061,10 +2112,11 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
             SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -2072,6 +2124,7 @@ public class Dsmlv2Grammar extends Abstr
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
@@ -2099,10 +2152,11 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
             SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -2110,6 +2164,7 @@ public class Dsmlv2Grammar extends Abstr
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
@@ -2136,10 +2191,11 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
             SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -2147,6 +2203,7 @@ public class Dsmlv2Grammar extends Abstr
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
@@ -2174,7 +2231,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             searchRequest.setTerminalFilter( null );
         }
@@ -2187,7 +2244,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2212,9 +2269,9 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
-            Asn1Object parent = searchRequest.getCurrentFilter().getParent();
+            Filter parent = searchRequest.getCurrentFilter().getParent();
 
             if ( parent instanceof Filter )
             {
@@ -2224,9 +2281,9 @@ public class Dsmlv2Grammar extends Abstr
             }
             else
             {
+                searchRequest.setFilter( searchRequest.getFilter() );
                 searchRequest.setCurrentFilter( null );
             }
-
         }
     };
 
@@ -2237,7 +2294,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2262,7 +2319,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2287,19 +2344,18 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
             AttributeValueAssertion assertion = new AttributeValueAssertion();
 
             // Checking and adding the filter's attributes
-            String attributeValue;
-            // name
-            attributeValue = xpp.getAttributeValue( "", "name" );
-            if ( attributeValue != null )
+            String attributeName = xpp.getAttributeValue( "", "name" );
+
+            if ( attributeName != null )
             {
-                assertion.setAttributeDesc( new String( attributeValue.getBytes() ) );
+                assertion.setAttributeDesc( attributeName );
             }
             else
             {
@@ -2320,6 +2376,7 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
+
             searchRequest.setTerminalFilter( filter );
         }
     };
@@ -2331,19 +2388,18 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
             AttributeValueAssertion assertion = new AttributeValueAssertion();
 
             // Checking and adding the filter's attributes
-            String attributeValue;
-            // name
-            attributeValue = xpp.getAttributeValue( "", "name" );
-            if ( attributeValue != null )
+            String attributeName = xpp.getAttributeValue( "", "name" );
+
+            if ( attributeName != null )
             {
-                assertion.setAttributeDesc( new String( attributeValue.getBytes() ) );
+                assertion.setAttributeDesc( attributeName );
             }
             else
             {
@@ -2364,6 +2420,7 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
+
             searchRequest.setTerminalFilter( filter );
         }
     };
@@ -2375,7 +2432,7 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2385,6 +2442,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // name
             attributeValue = xpp.getAttributeValue( "", "name" );
+
             if ( attributeValue != null )
             {
                 assertion.setAttributeDesc( new String( attributeValue.getBytes() ) );
@@ -2408,6 +2466,7 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
+
             searchRequest.setTerminalFilter( filter );
         }
     };
@@ -2419,19 +2478,18 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
             AttributeValueAssertion assertion = new AttributeValueAssertion();
 
             // Checking and adding the filter's attributes
-            String attributeValue;
-            // name
-            attributeValue = xpp.getAttributeValue( "", "name" );
-            if ( attributeValue != null )
+            String attributeName = xpp.getAttributeValue( "", "name" );
+
+            if ( attributeName != null )
             {
-                assertion.setAttributeDesc( new String( attributeValue.getBytes() ) );
+                assertion.setAttributeDesc( attributeName );
             }
             else
             {
@@ -2463,11 +2521,12 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
             AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) searchRequest.getTerminalFilter();
             AttributeValueAssertion assertion = filter.getAssertion();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -2475,6 +2534,7 @@ public class Dsmlv2Grammar extends Abstr
 
                 // Getting the value
                 String nextText = xpp.nextText();
+
                 if ( !nextText.equals( "" ) )
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
@@ -2508,7 +2568,8 @@ public class Dsmlv2Grammar extends Abstr
             XmlPullParser xpp = container.getParser();
 
             // Adding the filter to the Search Filter
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+
             try
             {
                 searchRequest.addCurrentFilter( presentFilter );
@@ -2522,6 +2583,7 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // name
             attributeValue = xpp.getAttributeValue( "", "name" );
+
             if ( attributeValue != null )
             {
                 presentFilter.setAttributeDescription( new String( attributeValue.getBytes() ) );
@@ -2545,7 +2607,8 @@ public class Dsmlv2Grammar extends Abstr
             XmlPullParser xpp = container.getParser();
 
             // Adding the filter to the Search Filter
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+
             try
             {
                 searchRequest.addCurrentFilter( extensibleMatchFilter );
@@ -2554,12 +2617,14 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
+
             searchRequest.setTerminalFilter( extensibleMatchFilter );
 
             // Checking and adding the filter's attributes
             String attributeValue;
             // dnAttributes
             attributeValue = xpp.getAttributeValue( "", "dnAttributes" );
+
             if ( attributeValue != null )
             {
                 if ( ( attributeValue.equals( "true" ) ) || ( attributeValue.equals( "1" ) ) )
@@ -2579,14 +2644,18 @@ public class Dsmlv2Grammar extends Abstr
             {
                 extensibleMatchFilter.setDnAttributes( false );
             }
+
             // matchingRule
             attributeValue = xpp.getAttributeValue( "", "matchingRule" );
+
             if ( attributeValue != null )
             {
                 extensibleMatchFilter.setMatchingRule( attributeValue );
             }
+
             // name
             attributeValue = xpp.getAttributeValue( "", "name" );
+
             if ( attributeValue != null )
             {
                 extensibleMatchFilter.setType( attributeValue );
@@ -2601,10 +2670,11 @@ public class Dsmlv2Grammar extends Abstr
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestCodec searchRequest = ( SearchRequestCodec ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
             ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -2616,14 +2686,11 @@ public class Dsmlv2Grammar extends Abstr
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )
                     {
-                        filter.setMatchValue( 
-                            new BinaryValue( 
-                                Base64.decode( nextText.trim().toCharArray() ) ) );
+                        filter.setMatchValue( new BinaryValue( Base64.decode( nextText.trim().toCharArray() ) ) );
                     }
                     else
                     {
-                        filter.setMatchValue( 
-                            new StringValue( nextText.trim() ) );
+                        filter.setMatchValue( new StringValue( nextText.trim() ) );
                     }
                 }
             }
@@ -2649,14 +2716,14 @@ public class Dsmlv2Grammar extends Abstr
             String attributeValue;
             // TYPE
             attributeValue = xpp.getAttributeValue( "", "type" );
-            
+
             if ( attributeValue != null )
             {
                 if ( !OID.isOID( attributeValue ) )
                 {
                     throw new XmlPullParserException( I18n.err( I18n.ERR_03034 ), xpp, null );
                 }
-                
+
                 control = new ControlImpl( attributeValue );
                 container.getBatchRequest().getCurrentRequest().addControl( control );
             }
@@ -2664,10 +2731,10 @@ public class Dsmlv2Grammar extends Abstr
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03035 ), xpp, null );
             }
-            
+
             // CRITICALITY
             attributeValue = xpp.getAttributeValue( "", "criticality" );
-            
+
             if ( attributeValue != null )
             {
                 if ( attributeValue.equals( "true" ) )
@@ -2696,6 +2763,7 @@ public class Dsmlv2Grammar extends Abstr
             Control control = container.getBatchRequest().getCurrentRequest().getCurrentControl();
 
             XmlPullParser xpp = container.getParser();
+
             try
             {
                 // We have to catch the type Attribute Value before going to the next Text node
@@ -2703,7 +2771,7 @@ public class Dsmlv2Grammar extends Abstr
 
                 // Getting the value
                 String nextText = xpp.nextText();
-                
+
                 if ( !nextText.equals( "" ) )
                 {
                     if ( ParserUtils.isBase64BinaryValue( xpp, typeValue ) )

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=987606&r1=987605&r2=987606&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 Fri Aug 20 19:23:27 2010
@@ -23,7 +23,8 @@ package org.apache.directory.shared.dsml
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.extended.ExtendedRequestCodec;
+import org.apache.directory.shared.ldap.message.ExtendedRequest;
+import org.apache.directory.shared.ldap.message.ExtendedRequestImpl;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
 import org.dom4j.QName;
@@ -41,7 +42,7 @@ public class ExtendedRequestDsml extends
      */
     public ExtendedRequestDsml()
     {
-        super( new ExtendedRequestCodec() );
+        super( new ExtendedRequestImpl() );
     }
 
 
@@ -51,7 +52,7 @@ public class ExtendedRequestDsml extends
      * @param ldapMessage
      *      the message to decorate
      */
-    public ExtendedRequestDsml( ExtendedRequestCodec ldapMessage )
+    public ExtendedRequestDsml( ExtendedRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -60,9 +61,9 @@ public class ExtendedRequestDsml extends
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -73,7 +74,7 @@ public class ExtendedRequestDsml extends
     {
         Element element = super.toDsml( root );
 
-        ExtendedRequestCodec request = ( ExtendedRequestCodec ) instance;
+        ExtendedRequest request = ( ExtendedRequest ) instance;
 
         // Request Name
         if ( request.getRequestName() != null )
@@ -102,7 +103,7 @@ public class ExtendedRequestDsml extends
      */
     public String getRequestName()
     {
-        return ( ( ExtendedRequestCodec ) instance ).getRequestName();
+        return ( ( ExtendedRequest ) instance ).getRequestName();
     }
 
 
@@ -113,7 +114,7 @@ public class ExtendedRequestDsml extends
      */
     public void setRequestName( OID requestName )
     {
-        ( ( ExtendedRequestCodec ) instance ).setRequestName( requestName );
+        ( ( ExtendedRequest ) instance ).setRequestName( requestName.toString() );
     }
 
 
@@ -124,7 +125,7 @@ public class ExtendedRequestDsml extends
      */
     public byte[] getRequestValue()
     {
-        return ( ( ExtendedRequestCodec ) instance ).getRequestValue();
+        return ( ( ExtendedRequest ) instance ).getRequestValue();
     }
 
 
@@ -135,6 +136,6 @@ public class ExtendedRequestDsml extends
      */
     public void setRequestValue( byte[] requestValue )
     {
-        ( ( ExtendedRequestCodec ) instance ).getRequestValue();
+        ( ( ExtendedRequest ) instance ).getRequestValue();
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/LdapRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/LdapRequestDecorator.java?rev=987606&r1=987605&r2=987606&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/LdapRequestDecorator.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/LdapRequestDecorator.java Fri Aug 20 19:23:27 2010
@@ -19,8 +19,12 @@
  */
 package org.apache.directory.shared.dsmlv2.request;
 
+
 import org.apache.directory.shared.dsmlv2.LdapMessageDecorator;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.message.Message;
+import org.apache.directory.shared.ldap.message.MessageException;
+import org.apache.directory.shared.ldap.message.control.Control;
+
 
 /**
  * Decorator abstract class for LdapRequest
@@ -32,11 +36,78 @@ public class LdapRequestDecorator extend
     /**
      * Creates a new instance of LdapRequestDecorator.
      *
-     * @param ldapMessage
-     *      the message to decorate
+     * @param ldapMessage the message to decorate
      */
-    public LdapRequestDecorator( LdapMessageCodec ldapMessage )
+    public LdapRequestDecorator( Message ldapMessage )
     {
         super( ldapMessage );
     }
+
+
+    public void addAllControls( Control[] controls ) throws MessageException
+    {
+        instance.addAllControls( controls );
+    }
+
+
+    public Object get( Object key )
+    {
+        return instance.get( key );
+    }
+
+
+    /*
+    public int getControlsLength()
+    {
+        return 0;
+    }
+    */
+
+    public Control getCurrentControl()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public int getMessageLength()
+    {
+        // TODO Auto-generated method stub
+        return 0;
+    }
+
+
+    public boolean hasControl( String oid )
+    {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+
+    public Object put( Object key, Object value )
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public void removeControl( Control control ) throws MessageException
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+
+    public void setControlsLength( int controlsLength )
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+
+    public void setMessageLength( int messageLength )
+    {
+        // TODO Auto-generated method stub
+
+    }
 }

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=987606&r1=987605&r2=987606&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 Fri Aug 20 19:23:27 2010
@@ -21,7 +21,8 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.modifyDn.ModifyDNRequestCodec;
+import org.apache.directory.shared.ldap.message.ModifyDnRequest;
+import org.apache.directory.shared.ldap.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
 import org.dom4j.Element;
@@ -39,7 +40,7 @@ public class ModifyDNRequestDsml extends
      */
     public ModifyDNRequestDsml()
     {
-        super( new ModifyDNRequestCodec() );
+        super( new ModifyDnRequestImpl() );
     }
 
 
@@ -49,7 +50,7 @@ public class ModifyDNRequestDsml extends
      * @param ldapMessage
      *      the message to decorate
      */
-    public ModifyDNRequestDsml( ModifyDNRequestCodec ldapMessage )
+    public ModifyDNRequestDsml( ModifyDnRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -58,9 +59,9 @@ public class ModifyDNRequestDsml extends
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -71,25 +72,25 @@ public class ModifyDNRequestDsml extends
     {
         Element element = super.toDsml( root );
 
-        ModifyDNRequestCodec request = ( ModifyDNRequestCodec ) instance;
+        ModifyDnRequest request = ( ModifyDnRequest ) instance;
 
         // DN
-        if ( request.getEntry() != null )
+        if ( request.getName() != null )
         {
-            element.addAttribute( "dn", request.getEntry().getName() );
+            element.addAttribute( "dn", request.getName().getName() );
         }
 
         // NewRDN
-        if ( request.getNewRDN() != null )
+        if ( request.getNewRdn() != null )
         {
-            element.addAttribute( "newrdn", request.getNewRDN().getName() );
+            element.addAttribute( "newrdn", request.getNewRdn().getName() );
         }
 
         // DeleteOldRDN
-        element.addAttribute( "deleteoldrdn", ( request.isDeleteOldRDN() ? "true" : "false" ) );
+        element.addAttribute( "deleteoldrdn", ( request.getDeleteOldRdn() ? "true" : "false" ) );
 
         // NewSuperior
-        if ( request.getNewRDN() != null )
+        if ( request.getNewRdn() != null )
         {
             element.addAttribute( "newSuperior", request.getNewSuperior().getName() );
         }
@@ -101,22 +102,22 @@ public class ModifyDNRequestDsml extends
     /**
      * Get the modification's DN
      * 
-     * @return Returns the entry.
+     * @return Returns the name.
      */
-    public DN getEntry()
+    public DN getName()
     {
-        return ( ( ModifyDNRequestCodec ) instance ).getEntry();
+        return ( ( ModifyDnRequest ) instance ).getName();
     }
 
 
     /**
      * Set the modification DN.
      * 
-     * @param entry The entry to set.
+     * @param name The name to set.
      */
-    public void setEntry( DN entry )
+    public void setEntry( DN name )
     {
-        ( ( ModifyDNRequestCodec ) instance ).setEntry( entry );
+        ( ( ModifyDnRequest ) instance ).setName( name );
     }
 
 
@@ -127,7 +128,7 @@ public class ModifyDNRequestDsml extends
      */
     public boolean isDeleteOldRDN()
     {
-        return ( ( ModifyDNRequestCodec ) instance ).isDeleteOldRDN();
+        return ( ( ModifyDnRequest ) instance ).getDeleteOldRdn();
     }
 
 
@@ -138,7 +139,7 @@ public class ModifyDNRequestDsml extends
      */
     public void setDeleteOldRDN( boolean deleteOldRDN )
     {
-        ( ( ModifyDNRequestCodec ) instance ).setDeleteOldRDN( deleteOldRDN );
+        ( ( ModifyDnRequest ) instance ).setDeleteOldRdn( deleteOldRDN );
     }
 
 
@@ -149,7 +150,7 @@ public class ModifyDNRequestDsml extends
      */
     public RDN getNewRDN()
     {
-        return ( ( ModifyDNRequestCodec ) instance ).getNewRDN();
+        return ( ( ModifyDnRequest ) instance ).getNewRdn();
     }
 
 
@@ -160,7 +161,7 @@ public class ModifyDNRequestDsml extends
      */
     public void setNewRDN( RDN newRDN )
     {
-        ( ( ModifyDNRequestCodec ) instance ).setNewRDN( newRDN );
+        ( ( ModifyDnRequest ) instance ).setNewRdn( newRDN );
     }
 
 
@@ -171,7 +172,7 @@ public class ModifyDNRequestDsml extends
      */
     public DN getNewSuperior()
     {
-        return ( ( ModifyDNRequestCodec ) instance ).getNewSuperior();
+        return ( ( ModifyDnRequest ) instance ).getNewSuperior();
     }
 
 
@@ -182,6 +183,6 @@ public class ModifyDNRequestDsml extends
      */
     public void setNewSuperior( DN newSuperior )
     {
-        ( ( ModifyDNRequestCodec ) instance ).setNewSuperior( newSuperior );
+        ( ( ModifyDnRequest ) instance ).setNewSuperior( newSuperior );
     }
 }

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java?rev=987606&r1=987605&r2=987606&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java (original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java Fri Aug 20 19:23:27 2010
@@ -20,15 +20,16 @@
 package org.apache.directory.shared.dsmlv2.request;
 
 
+import java.util.Collection;
 import java.util.Iterator;
-import java.util.List;
 
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
 import org.apache.directory.shared.ldap.entry.Value;
+import org.apache.directory.shared.ldap.message.ModifyRequest;
+import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
 import org.dom4j.Element;
 import org.dom4j.Namespace;
 import org.dom4j.QName;
@@ -46,7 +47,7 @@ public class ModifyRequestDsml extends A
      */
     public ModifyRequestDsml()
     {
-        super( new ModifyRequestCodec() );
+        super( new ModifyRequestImpl() );
     }
 
 
@@ -56,7 +57,7 @@ public class ModifyRequestDsml extends A
      * @param ldapMessage
      *      the message to decorate
      */
-    public ModifyRequestDsml( ModifyRequestCodec ldapMessage )
+    public ModifyRequestDsml( ModifyRequest ldapMessage )
     {
         super( ldapMessage );
     }
@@ -65,9 +66,9 @@ public class ModifyRequestDsml extends A
     /**
      * {@inheritDoc}
      */
-    public MessageTypeEnum getMessageType()
+    public MessageTypeEnum getType()
     {
-        return instance.getMessageType();
+        return instance.getType();
     }
 
 
@@ -78,27 +79,27 @@ public class ModifyRequestDsml extends A
     {
         Element element = super.toDsml( root );
 
-        ModifyRequestCodec request = ( ModifyRequestCodec ) instance;
+        ModifyRequest request = ( ModifyRequest ) instance;
 
         // DN
-        if ( request.getObject() != null )
+        if ( request.getName() != null )
         {
-            element.addAttribute( "dn", request.getObject().getName() );
+            element.addAttribute( "dn", request.getName().getName() );
         }
 
         // Modifications
-        List<Modification> modifications = request.getModifications();
+        Collection<Modification> modifications = request.getModifications();
 
-        for ( int i = 0; i < modifications.size(); i++ )
+        for ( Modification modification : modifications )
         {
-            Modification modificationItem = modifications.get( i );
-
             Element modElement = element.addElement( "modification" );
-            if ( modificationItem.getAttribute() != null )
+
+            if ( modification.getAttribute() != null )
             {
-                modElement.addAttribute( "name", modificationItem.getAttribute().getId() );
+                modElement.addAttribute( "name", modification.getAttribute().getId() );
+
+                Iterator<Value<?>> iterator = modification.getAttribute().getAll();
 
-                Iterator<Value<?>> iterator = modificationItem.getAttribute().getAll();
                 while ( iterator.hasNext() )
                 {
                     Value<?> value = iterator.next();
@@ -125,7 +126,8 @@ public class ModifyRequestDsml extends A
                 }
             }
 
-            ModificationOperation operation = modificationItem.getOperation();
+            ModificationOperation operation = modification.getOperation();
+
             if ( operation == ModificationOperation.ADD_ATTRIBUTE )
             {
                 modElement.addAttribute( "operation", "add" );



Mime
View raw message