directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1063480 - in /directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2: Dsmlv2Container.java request/Dsmlv2Grammar.java
Date Tue, 25 Jan 2011 22:05:10 GMT
Author: elecharny
Date: Tue Jan 25 22:05:10 2011
New Revision: 1063480

URL: http://svn.apache.org/viewvc?rev=1063480&view=rev
Log:
Fix the DSML codec to have it working with decorator for the ModifyRequest

Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java?rev=1063480&r1=1063479&r2=1063480&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
Tue Jan 25 22:05:10 2011
@@ -49,6 +49,9 @@ public class Dsmlv2Container implements 
     /** The BatchRequest of the parsing */
     private BatchRequest batchRequest;
 
+    /** The BatchRequestDecorator of the parsing */
+    private BatchRequest batchRequestDecorator;
+
     /** The BatchResponse of the parsing */
     private BatchResponse batchResponse;
 
@@ -69,6 +72,18 @@ public class Dsmlv2Container implements 
 
 
     /**
+     * Gets the DSML Batch Request decorator
+     * 
+     * @return
+     *      Returns the Batch Request decorator
+     */
+    public BatchRequest getBatchRequestDecorator()
+    {
+        return batchRequestDecorator;
+    }
+
+
+    /**
      * Sets the DSML Batch Request
      * 
      * @param batchRequest
@@ -81,6 +96,18 @@ public class Dsmlv2Container implements 
 
 
     /**
+     * Sets the DSML Batch Request decorator
+     * 
+     * @param batchRequest decorator
+     *      the Batch Request decorator to set
+     */
+    public void setBatchRequestDecorator( BatchRequest batchRequest )
+    {
+        this.batchRequestDecorator = batchRequest;
+    }
+
+
+    /**
      * Gets the DSML Batch Response
      * 
      * @return

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=1063480&r1=1063479&r2=1063480&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
Tue Jan 25 22:05:10 2011
@@ -42,6 +42,7 @@ import org.apache.directory.shared.i18n.
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
+import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
 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;
@@ -50,6 +51,7 @@ import org.apache.directory.shared.ldap.
 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.SubstringFilter;
+import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.model.entry.BinaryValue;
 import org.apache.directory.shared.ldap.model.entry.StringValue;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -60,10 +62,13 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.AbandonRequestImpl;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.AddRequestImpl;
-import org.apache.directory.shared.ldap.model.message.*;
+import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
 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.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.CompareRequestImpl;
+import org.apache.directory.shared.ldap.model.message.Control;
+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.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
@@ -72,8 +77,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyRequestImpl;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
-import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.util.Base64;
@@ -1734,6 +1737,9 @@ public final class Dsmlv2Grammar extends
         {
             ModifyRequest modifyRequest = new ModifyRequestImpl();
             container.getBatchRequest().addRequest( modifyRequest );
+            ModifyRequestDecorator modifyRequestDecorator = new ModifyRequestDecorator( modifyRequest
);
+            container.setBatchRequestDecorator(  new BatchRequest() );
+            container.getBatchRequestDecorator().addRequest( modifyRequestDecorator );
 
             XmlPullParser xpp = container.getParser();
 
@@ -1782,7 +1788,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestImpl modifyRequest = ( ModifyRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            ModifyRequestDecorator modifyRequest = ( ModifyRequestDecorator ) container.getBatchRequestDecorator().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1838,7 +1844,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestImpl modifyRequest = ( ModifyRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            ModifyRequestDecorator modifyRequest = ( ModifyRequestDecorator ) container.getBatchRequestDecorator().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 



Mime
View raw message