directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1067686 [1/3] - in /directory: shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/ shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ shared/branches/m1/dsml-parser/src/main...
Date Sun, 06 Feb 2011 15:45:57 GMT
Author: akarasulu
Date: Sun Feb  6 15:45:55 2011
New Revision: 1067686

URL: http://svn.apache.org/viewvc?rev=1067686&view=rev
Log:
DIRSHARED-80:

  o slowly decoupling dsml-parser from codec
  o consolidated BatchRequest with BatchRequestDsml which seemed to have
    almost the same functionality
  o removed use of various codec classes in the dsml-parser

Added:
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/DsmlControl.java
Removed:
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequest.java
Modified:
    directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractDsmlMessageDecorator.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequestDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ModifyRequestDsml.java
    directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/SearchRequestDsml.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/abandonRequest/AbandonRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addRequest/AddRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/addResponse/AddResponseTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authRequest/AuthRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/authResponse/AuthResponseTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/batchRequest/BatchRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareRequest/CompareRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/compareResponse/CompareResponseTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delRequest/DelRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/delResponse/DelResponseTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedRequest/ExtendedRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/extendedResponse/ExtendedResponseTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNRequest/ModifyDNRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modDNResponse/ModifyDNResponseTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyRequest/ModifyRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/modifyResponse/ModifyResponseTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchRequest/SearchRequestTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultDone/SearchResultDoneTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/SearchResultEntryTest.java
    directory/shared/branches/m1/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/ModifyRequestDecorator.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchRequestDecorator.java
    directory/studio/branches/m1/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportDsmlRunnable.java

Modified: directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java (original)
+++ directory/shared/branches/m1/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java Sun Feb  6 15:45:55 2011
@@ -29,6 +29,7 @@ import org.apache.directory.ldap.client.
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
+import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Parser;
 import org.apache.directory.shared.dsmlv2.reponse.AddResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.BindResponseDsml;
@@ -43,10 +44,10 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.reponse.SearchResponseDsml;
 import org.apache.directory.shared.dsmlv2.reponse.SearchResultEntryDsml;
 import org.apache.directory.shared.dsmlv2.reponse.SearchResultReferenceDsml;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.OnError;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.Processing;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.OnError;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.Processing;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.ResponseOrder;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
@@ -65,12 +66,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.DeleteResponse;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedResponse;
-import org.apache.directory.shared.ldap.model.message.Message;
 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.ModifyDnResponse;
 import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.model.message.ModifyResponse;
+import org.apache.directory.shared.ldap.model.message.Request;
 import org.apache.directory.shared.ldap.model.message.Response;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
@@ -108,7 +109,7 @@ public class Dsmlv2Engine
     private boolean exit = false;
 
     /** The batch request. */
-    private BatchRequest batchRequest;
+    private BatchRequestDsml batchRequest;
 
     /** The batch response. */
     private BatchResponseDsml batchResponse;
@@ -239,7 +240,7 @@ public class Dsmlv2Engine
         //    - Sending the request to the server
         //    - Getting and converting reponse(s) as XML
         //    - Looping until last request
-        Message request = null;
+        DsmlDecorator<? extends Request> request = null;
 
         try
         {
@@ -259,7 +260,7 @@ public class Dsmlv2Engine
             // Checking the request has a requestID attribute if Processing = Parallel and ResponseOrder = Unordered
             if ( ( batchRequest.getProcessing().equals( Processing.PARALLEL ) )
                 && ( batchRequest.getResponseOrder().equals( ResponseOrder.UNORDERED ) )
-                && ( request.getMessageId() <= 0 ) )
+                && ( request.getDecorated().getMessageId() <= 0 ) )
             {
                 // Then we have to send an errorResponse
                 ErrorResponse errorResponse = new ErrorResponse( 0, ErrorResponseType.MALFORMED_REQUEST, I18n
@@ -311,11 +312,11 @@ public class Dsmlv2Engine
      * 
      * @param request the request to process
      */
-    private void processRequest( Message request ) throws Exception
+    private void processRequest( DsmlDecorator<? extends Request> request ) throws Exception
     {
         ResultCodeEnum resultCode = null;
 
-        switch ( request.getType() )
+        switch ( request.getDecorated().getType() )
         {
             case ABANDON_REQUEST:
                 connection.abandon( ( AbandonRequest ) request );
@@ -421,7 +422,7 @@ public class Dsmlv2Engine
                 break;
 
             default:
-                throw new IllegalStateException( "Unexpected request tpye " + request.getType() );
+                throw new IllegalStateException( "Unexpected request tpye " + request.getDecorated().getType() );
         }
 
         if ( ( !continueOnError ) && ( resultCode != ResultCodeEnum.SUCCESS )

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractDsmlMessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractDsmlMessageDecorator.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractDsmlMessageDecorator.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/AbstractDsmlMessageDecorator.java Sun Feb  6 15:45:55 2011
@@ -20,6 +20,7 @@
 package org.apache.directory.shared.dsmlv2;
 
 
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
@@ -39,20 +40,36 @@ public abstract class AbstractDsmlMessag
 {
     /** The LDAP message codec */
     private final LdapCodecService codec;
+
     /** The LDAP message */
     private final E message;
     
+    /** Map of message controls using OID Strings for keys and Control values */
+    private final Map<String, Control> controls;
+
+    /** The current control */
+    private DsmlControl<? extends Control> currentControl;
+
     
     public AbstractDsmlMessageDecorator( LdapCodecService codec, E message )
     {
         this.codec = codec;
         this.message = message;
+        controls = new HashMap<String, Control>();
     }
     
     
     /**
-     * {@inheritDoc}
+     * Get the current Control Object
+     * 
+     * @return The current Control Object
      */
+    public DsmlControl<? extends Control> getCurrentControl()
+    {
+        return currentControl;
+    }
+
+    
     public LdapCodecService getCodecService()
     {
         return codec;
@@ -73,7 +90,7 @@ public abstract class AbstractDsmlMessag
      */
     public Map<String, Control> getControls()
     {
-        return message.getControls();
+        return controls;
     }
 
     
@@ -82,7 +99,7 @@ public abstract class AbstractDsmlMessag
      */
     public Control getControl( String oid )
     {
-        return message.getControl( oid );
+        return controls.get( oid );
     }
 
     
@@ -91,7 +108,7 @@ public abstract class AbstractDsmlMessag
      */
     public boolean hasControl( String oid )
     {
-        return message.hasControl( oid );
+        return controls.containsKey( oid );
     }
 
     
@@ -100,7 +117,23 @@ public abstract class AbstractDsmlMessag
      */
     public void addControl( Control control ) throws MessageException
     {
-        message.addControl( control );
+        Control decorated;
+        DsmlControl<? extends Control> decorator;
+        
+        if ( control instanceof DsmlControl )
+        {
+            decorator = ( DsmlControl<?> ) control;
+            decorated = decorator.getDecorated();
+        }
+        else
+        {
+            decorator = new DsmlControl<Control>( codec, codec.newControl( control ) );
+            decorated = control;
+        }
+        
+        message.addControl( decorated );
+        controls.put( control.getOid(), decorator );
+        currentControl = decorator;
     }
 
     
@@ -109,7 +142,10 @@ public abstract class AbstractDsmlMessag
      */
     public void addAllControls( Control[] controls ) throws MessageException
     {
-        message.addAllControls( controls );
+        for ( Control control : controls )
+        {
+            addControl( control );
+        }
     }
 
     
@@ -118,6 +154,7 @@ public abstract class AbstractDsmlMessag
      */
     public void removeControl( Control control ) throws MessageException
     {
+        controls.remove( control.getOid() );
         message.removeControl( control );
     }
 

Added: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/DsmlControl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/DsmlControl.java?rev=1067686&view=auto
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/DsmlControl.java (added)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/DsmlControl.java Sun Feb  6 15:45:55 2011
@@ -0,0 +1,147 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.shared.dsmlv2;
+
+
+import org.apache.directory.shared.ldap.codec.LdapCodecService;
+import org.apache.directory.shared.ldap.model.message.Control;
+import org.dom4j.Element;
+
+
+/**
+ * A DSML decorator for a {@link Control}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class DsmlControl<E extends Control> 
+    implements Control, DsmlDecorator<E>
+{
+    /** The decorated Control */
+    private E decorated;
+
+    /** The encoded value of the control. */
+    protected byte[] value;
+    
+    /** The codec service responsible for encoding decoding this object */
+    private LdapCodecService codec;
+    
+    
+    public DsmlControl( LdapCodecService codec, E decorated )
+    {
+        this.codec = codec;
+        this.decorated = decorated;
+    }
+    
+    
+    /**
+     * Gets the LDAP codec service.
+     */
+    public LdapCodecService getCodecService()
+    {
+        return codec;
+    }
+
+
+    /**
+     * Checks to see if this DSML control decorator has a value.
+     *
+     * @return true if the DSML control has a value, false otherwise.
+     */
+    public boolean hasValue()
+    {
+        return value != null;
+    }
+
+
+    /**
+     * Get the control value
+     * 
+     * @return The control value
+     */
+    public byte[] getValue()
+    {
+        return value;
+    }
+
+
+    /**
+     * Set the encoded control value
+     * 
+     * @param value The encoded control value to store
+     */
+    public void setValue( byte[] value )
+    {
+        if ( value != null )
+        {
+            byte[] copy = new byte[ value.length ];
+            System.arraycopy( value, 0, copy, 0, value.length );
+            this.value = copy;
+        } 
+        else 
+        {
+            this.value = null;
+        }
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getOid()
+    {
+        return decorated.getOid();
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isCritical()
+    {
+        return decorated.isCritical();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setCritical( boolean isCritical )
+    {
+        decorated.setCritical( isCritical );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Element toDsml( Element root )
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public E getDecorated()
+    {
+        return decorated;
+    }
+}

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Container.java Sun Feb  6 15:45:55 2011
@@ -23,7 +23,7 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.dsmlv2.reponse.BatchResponseDsml;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
 import org.xmlpull.v1.XmlPullParser;
 
@@ -49,7 +49,7 @@ public class Dsmlv2Container implements 
     private XmlPullParser parser;
 
     /** The BatchRequest of the parsing */
-    private BatchRequest batchRequest;
+    private BatchRequestDsml batchRequest;
 
     /** The BatchResponse of the parsing */
     private BatchResponseDsml batchResponse;
@@ -87,7 +87,7 @@ public class Dsmlv2Container implements 
      * @return
      *      Returns the Batch Request
      */
-    public BatchRequest getBatchRequest()
+    public BatchRequestDsml getBatchRequest()
     {
         return batchRequest;
     }
@@ -99,7 +99,7 @@ public class Dsmlv2Container implements 
      * @param batchRequest
      *      the Batch Request to set
      */
-    public void setBatchRequest( BatchRequest batchRequest )
+    public void setBatchRequest( BatchRequestDsml batchRequest )
     {
         this.batchRequest = batchRequest;
     }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/Dsmlv2Parser.java Sun Feb  6 15:45:55 2011
@@ -28,11 +28,11 @@ import java.io.InputStream;
 import java.io.Reader;
 import java.io.StringReader;
 
-import org.apache.directory.shared.dsmlv2.request.BatchRequest;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml;
 import org.apache.directory.shared.dsmlv2.request.Dsmlv2Grammar;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
-import org.apache.directory.shared.ldap.model.message.Message;
+import org.apache.directory.shared.ldap.model.message.Request;
 import org.xmlpull.v1.XmlPullParser;
 import org.xmlpull.v1.XmlPullParserException;
 import org.xmlpull.v1.XmlPullParserFactory;
@@ -215,7 +215,7 @@ public class Dsmlv2Parser
      * @return 
      *      the Batch Request or null if the it has not been parsed yet
      */
-    public BatchRequest getBatchRequest()
+    public BatchRequestDsml getBatchRequest()
     {
         return container.getBatchRequest();
     }
@@ -228,7 +228,7 @@ public class Dsmlv2Parser
      * @throws XmlPullParserException      
      *      when an error occurs during the parsing
      */
-    public Message getNextRequest() throws XmlPullParserException
+    public DsmlDecorator<? extends Request> getNextRequest() throws XmlPullParserException
     {
         if ( container.getBatchRequest() == null )
         {

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ParserUtils.java Sun Feb  6 15:45:55 2011
@@ -30,9 +30,9 @@ import javax.xml.transform.TransformerEx
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.stream.StreamSource;
 
-import org.apache.directory.shared.dsmlv2.request.BatchRequest;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.Processing;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.Processing;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.ResponseOrder;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.CodecControl;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
@@ -278,7 +278,7 @@ public final class ParserUtils
      */
     public static boolean isRequestIdNeeded( Dsmlv2Container container ) throws XmlPullParserException
     {
-        BatchRequest batchRequest = container.getBatchRequest();
+        BatchRequestDsml batchRequest = container.getBatchRequest();
 
         if ( batchRequest == null )
         {

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/Dsmlv2ResponseGrammar.java Sun Feb  6 15:45:55 2011
@@ -29,7 +29,9 @@ import java.util.Set;
 
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.util.OID;
+import org.apache.directory.shared.dsmlv2.AbstractDsmlMessageDecorator;
 import org.apache.directory.shared.dsmlv2.AbstractGrammar;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Container;
 import org.apache.directory.shared.dsmlv2.Dsmlv2StatesEnum;
@@ -41,17 +43,6 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.reponse.ErrorResponse.ErrorResponseType;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.CodecControl;
-import org.apache.directory.shared.ldap.codec.decorators.AddResponseDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.BindResponseDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.CompareResponseDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.DeleteResponseDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.ExtendedResponseDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.ModifyDnResponseDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.ModifyResponseDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.SearchResultDoneDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.SearchResultReferenceDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.exception.LdapURLEncodingException;
@@ -796,9 +787,9 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddResponseDecorator addResponse = new AddResponseDecorator( container.getLdapCodecService(), new AddResponseImpl() );
-            AddResponseDsml addResponseDsml = new AddResponseDsml( container.getLdapCodecService(), addResponse );
-            container.getBatchResponse().addResponse( addResponseDsml );
+            AddResponseDsml addResponse = new AddResponseDsml( 
+                container.getLdapCodecService(), new AddResponseImpl() );
+            container.getBatchResponse().addResponse( addResponse );
 
             LdapResult ldapResult = addResponse.getLdapResult();
 
@@ -838,9 +829,9 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BindResponseDecorator bindResponse = new BindResponseDecorator( container.getLdapCodecService(), new BindResponseImpl() );
-            BindResponseDsml bindResponseDsml = new BindResponseDsml( container.getLdapCodecService(), bindResponse );
-            container.getBatchResponse().addResponse( bindResponseDsml );
+            BindResponseDsml bindResponse = new BindResponseDsml( 
+                container.getLdapCodecService(), new BindResponseImpl() );
+            container.getBatchResponse().addResponse( bindResponse );
 
             LdapResult ldapResult = bindResponse.getLdapResult();
 
@@ -881,9 +872,9 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareResponseDecorator compareResponse = new CompareResponseDecorator( container.getLdapCodecService(), new CompareResponseImpl() );
-            CompareResponseDsml compareResponseDsml = new CompareResponseDsml( container.getLdapCodecService(), compareResponse );
-            container.getBatchResponse().addResponse( compareResponseDsml );
+            CompareResponseDsml compareResponse = new CompareResponseDsml( 
+                container.getLdapCodecService(), new CompareResponseImpl() );
+            container.getBatchResponse().addResponse( compareResponse );
 
             LdapResult ldapResult = compareResponse.getLdapResult();
 
@@ -923,9 +914,9 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DeleteResponseDecorator delResponse = new DeleteResponseDecorator( container.getLdapCodecService(), new DeleteResponseImpl() );
-            DelResponseDsml delResponseDsml = new DelResponseDsml( container.getLdapCodecService(), delResponse );
-            container.getBatchResponse().addResponse( delResponseDsml );
+            DelResponseDsml delResponse = new DelResponseDsml( 
+                container.getLdapCodecService(), new DeleteResponseImpl() );
+            container.getBatchResponse().addResponse( delResponse );
 
             LdapResult ldapResult = delResponse.getLdapResult();
 
@@ -965,9 +956,9 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyResponseDecorator modifyResponse = new ModifyResponseDecorator( container.getLdapCodecService(), new ModifyResponseImpl() );
-            ModifyResponseDsml modifyResponseDsml = new ModifyResponseDsml( container.getLdapCodecService(), modifyResponse );
-            container.getBatchResponse().addResponse( modifyResponseDsml );
+            ModifyResponseDsml modifyResponse = new ModifyResponseDsml( 
+                container.getLdapCodecService(), new ModifyResponseImpl() );
+            container.getBatchResponse().addResponse( modifyResponse );
 
             LdapResult ldapResult = modifyResponse.getLdapResult();
 
@@ -1007,11 +998,11 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyDnResponseDecorator modifyDNResponse = new ModifyDnResponseDecorator( container.getLdapCodecService(), new ModifyDnResponseImpl() );
-            ModDNResponseDsml modDNResponseDsml = new ModDNResponseDsml( container.getLdapCodecService(), modifyDNResponse );
-            container.getBatchResponse().addResponse( modDNResponseDsml );
+            ModDNResponseDsml modDNResponse = new ModDNResponseDsml( 
+                container.getLdapCodecService(), new ModifyDnResponseImpl() );
+            container.getBatchResponse().addResponse( modDNResponse );
 
-            LdapResult ldapResult = modifyDNResponse.getLdapResult();
+            LdapResult ldapResult = modDNResponse.getLdapResult();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1022,7 +1013,7 @@ public final class Dsmlv2ResponseGrammar
 
             if ( attributeValue != null )
             {
-                modifyDNResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
+                modDNResponse.setMessageId( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) );
             }
 
             // MatchedDN
@@ -1049,7 +1040,7 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedResponseDecorator extendedResponse = null;
+            ExtendedResponseDsml extendedResponse = null;
 
             // Checking and adding the batchRequest's attributes
             String attributeValue;
@@ -1061,15 +1052,17 @@ public final class Dsmlv2ResponseGrammar
 
             if ( attributeValue != null )
             {
-                extendedResponse = new ExtendedResponseDecorator( container.getLdapCodecService(), new ExtendedResponseImpl( ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ) );
+                extendedResponse = new ExtendedResponseDsml( 
+                    container.getLdapCodecService(), new ExtendedResponseImpl( 
+                        ParserUtils.parseAndVerifyRequestID( attributeValue, xpp ) ) );
             }
             else
             {
-                extendedResponse = new ExtendedResponseDecorator( container.getLdapCodecService(), new ExtendedResponseImpl( -1 ) );
+                extendedResponse = new ExtendedResponseDsml( 
+                    container.getLdapCodecService(), new ExtendedResponseImpl( -1 ) );
             }
 
-            ExtendedResponseDsml extendedResponseDsml = new ExtendedResponseDsml( container.getLdapCodecService(), extendedResponse );
-            container.getBatchResponse().addResponse( extendedResponseDsml );
+            container.getBatchResponse().addResponse( extendedResponse );
 
             LdapResult ldapResult = extendedResponse.getLdapResult();
 
@@ -1197,7 +1190,8 @@ public final class Dsmlv2ResponseGrammar
      * @param parent the parent 
      * @throws XmlPullParserException
      */
-    private void createAndAddControl( Dsmlv2Container container, Message parent ) throws XmlPullParserException
+    private void createAndAddControl( Dsmlv2Container container, 
+        AbstractDsmlMessageDecorator<? extends Message> parent ) throws XmlPullParserException
     {
         CodecControl<? extends Control> control = null;
 
@@ -1249,18 +1243,18 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DsmlDecorator<? extends Response> ldapResponse = 
+            AbstractDsmlMessageDecorator<? extends Message> message =
+                ( AbstractDsmlMessageDecorator<? extends Message> ) 
                 container.getBatchResponse().getCurrentResponse();
             
-            // Search Response is a special case
-            if ( ldapResponse.getDecorated() instanceof SearchResponse )
+            if ( message instanceof SearchResponseDsml )
             {
-                createAndAddControl( container, ( ( SearchResponse ) 
-                    ldapResponse.getDecorated() ).getSearchResultDone() );
+                createAndAddControl( container, 
+                    ( ( SearchResponse ) ( ( SearchResponseDsml ) message ).getDecorated() ).getSearchResultDone() );
             }
             else
             {
-                createAndAddControl( container, ldapResponse.getDecorated() );
+                createAndAddControl( container, message );
             }
         }
     };
@@ -1273,9 +1267,11 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated() )
-                .getCurrentSearchResultEntry();
-            createAndAddControl( container, ldapMessage );
+            SearchResponse response = ( SearchResponse )
+            ( ( SearchResponseDsml ) container.getBatchResponse()
+                .getCurrentResponse() ).getDecorated();
+        
+            createAndAddControl( container, response.getCurrentSearchResultEntry() );
         }
     };
 
@@ -1287,9 +1283,11 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated() )
-                .getCurrentSearchResultReference();
-            createAndAddControl( container, ldapMessage );
+            SearchResponse response = ( SearchResponse )
+                ( ( SearchResponseDsml ) container.getBatchResponse()
+                    .getCurrentResponse() ).getDecorated();
+            
+            createAndAddControl( container, response.getCurrentSearchResultReference() );
         }
     };
 
@@ -1300,9 +1298,12 @@ public final class Dsmlv2ResponseGrammar
      * @param parent the parent 
      * @throws XmlPullParserException
      */
-    private void createAndAddControlValue( Dsmlv2Container container, Message parent ) throws XmlPullParserException
+    private void createAndAddControlValue( Dsmlv2Container container, 
+        AbstractDsmlMessageDecorator<? extends Message> parent ) 
+        throws XmlPullParserException
     {
-        CodecControl<? extends Control> control = ( ( MessageDecorator<?> ) parent ).getCurrentControl();
+        DsmlControl<? extends Control> control = 
+            ( ( AbstractDsmlMessageDecorator<?> ) parent ).getCurrentControl();
 
         XmlPullParser xpp = container.getParser();
         try
@@ -1339,19 +1340,20 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            
-            DsmlDecorator<? extends Response> ldapResponse = 
+            AbstractDsmlMessageDecorator<? extends Response> response
+                = ( AbstractDsmlMessageDecorator<? extends Response> )
                 container.getBatchResponse().getCurrentResponse();
             
-            // Search Response is a special case
-            if ( ldapResponse.getDecorated() instanceof SearchResponse )
+            if ( response instanceof SearchResponseDsml )
             {
-                createAndAddControlValue( container, ( ( SearchResponse ) 
-                    ldapResponse.getDecorated() ).getSearchResultDone() );
+                SearchResponse searchResponse = ( SearchResponse ) 
+                    response.getDecorated();
+                createAndAddControlValue( container, 
+                    searchResponse.getSearchResultDone() );
             }
             else
             {
-                createAndAddControlValue( container, ldapResponse.getDecorated() );
+                createAndAddControlValue( container, response );
             }
         }
     };
@@ -1364,9 +1366,10 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated() )
-                .getCurrentSearchResultEntry();
-            createAndAddControlValue( container, ldapMessage );
+            SearchResponse response = ( SearchResponse ) 
+                container.getBatchResponse().getCurrentResponse().getDecorated();
+            createAndAddControlValue( container, 
+                response.getCurrentSearchResultEntry() );
         }
     };
 
@@ -1378,9 +1381,10 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            Message ldapMessage = ( ( SearchResponse ) container.getBatchResponse().getCurrentResponse().getDecorated() )
-                .getCurrentSearchResultReference();
-            createAndAddControlValue( container, ldapMessage );
+            SearchResponseDsml response = ( SearchResponseDsml ) 
+                container.getBatchResponse().getCurrentResponse();
+            createAndAddControlValue( container, 
+                ( ( SearchResponse ) response.getDecorated() ).getCurrentSearchResultReference() );
         }
     };
 
@@ -1576,16 +1580,13 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultEntryDecorator searchResultEntry = 
-                new SearchResultEntryDecorator( 
-                    container.getLdapCodecService(), 
+            SearchResultEntryDsml searchResultEntry = 
+                new SearchResultEntryDsml( container.getLdapCodecService(), 
                     new SearchResultEntryImpl() );
-
-            SearchResponse searchResponse = ( SearchResponse ) 
-                container.getBatchResponse().getCurrentResponse().getDecorated();
-
-            searchResponse.addSearchResultEntry( searchResultEntry );
-
+            SearchResponseDsml searchResponse = ( SearchResponseDsml ) 
+                container.getBatchResponse().getCurrentResponse();
+            searchResponse.addResponse( searchResultEntry );
+            
             XmlPullParser xpp = container.getParser();
 
             // Checking and adding the request's attributes
@@ -1627,15 +1628,15 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultReferenceDecorator searchResultReference = 
-                new SearchResultReferenceDecorator( 
+            SearchResultReferenceDsml searchResultReference = 
+                new SearchResultReferenceDsml( 
                     container.getLdapCodecService(), 
                     new SearchResultReferenceImpl() );
 
-            SearchResponse searchResponse = ( SearchResponse ) 
-                container.getBatchResponse().getCurrentResponse().getDecorated();
-
-            searchResponse.addSearchResultReference( searchResultReference );
+            SearchResponseDsml searchResponseDsml = ( SearchResponseDsml ) 
+                container.getBatchResponse().getCurrentResponse();
+            
+            searchResponseDsml.addResponse( searchResultReference );
 
             XmlPullParser xpp = container.getParser();
 
@@ -1659,17 +1660,14 @@ public final class Dsmlv2ResponseGrammar
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchResultDoneDecorator searchResultDone = 
-                new SearchResultDoneDecorator( container.getLdapCodecService(), 
+            SearchResultDoneDsml searchResultDone = 
+                new SearchResultDoneDsml( container.getLdapCodecService(), 
                     new SearchResultDoneImpl() );
 
-            searchResultDone.getLdapResult();
-
-            SearchResponse searchResponse = ( SearchResponse ) container
-                .getBatchResponse().getCurrentResponse().getDecorated();
-
-            searchResponse.setSearchResultDone( searchResultDone );
-
+            SearchResponseDsml searchResponseDsml = ( SearchResponseDsml )
+                container.getBatchResponse().getCurrentResponse();
+            searchResponseDsml.addResponse( searchResultDone );
+            
             XmlPullParser xpp = container.getParser();
 
             // Checking and adding the batchRequest's attributes
@@ -1709,8 +1707,7 @@ public final class Dsmlv2ResponseGrammar
             SearchResponse searchResponse = ( SearchResponse ) 
                 container.getBatchResponse().getCurrentResponse().getDecorated();
 
-            SearchResultEntryDecorator searchResultEntry = 
-                ( SearchResultEntryDecorator ) 
+            SearchResultEntryDsml searchResultEntry = ( SearchResultEntryDsml ) 
                 searchResponse.getCurrentSearchResultEntry();
 
             XmlPullParser xpp = container.getParser();
@@ -1748,7 +1745,7 @@ public final class Dsmlv2ResponseGrammar
         {
             SearchResponse searchResponse = ( SearchResponse ) 
                 container.getBatchResponse().getCurrentResponse().getDecorated();
-            SearchResultEntryDecorator searchResultEntry = ( SearchResultEntryDecorator ) 
+            SearchResultEntryDsml searchResultEntry = ( SearchResultEntryDsml ) 
                 searchResponse.getCurrentSearchResultEntry();
 
             XmlPullParser xpp = container.getParser();

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponse.java Sun Feb  6 15:45:55 2011
@@ -26,9 +26,6 @@ import java.util.List;
 
 import org.apache.directory.shared.ldap.model.message.AbstractResponse;
 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.SearchResultEntry;
-import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 
 
 /**
@@ -39,13 +36,13 @@ import org.apache.directory.shared.ldap.
 public class SearchResponse extends AbstractResponse
 {
     /** The List of contained Search Result Entries */
-    private List<SearchResultEntry> searchResultEntryList = new ArrayList<SearchResultEntry>();
+    private List<SearchResultEntryDsml> searchResultEntryList = new ArrayList<SearchResultEntryDsml>();
 
     /** The List of contained Search Result References */
-    private List<SearchResultReference> searchResultReferenceList = new ArrayList<SearchResultReference>();
+    private List<SearchResultReferenceDsml> searchResultReferenceList = new ArrayList<SearchResultReferenceDsml>();
 
     /** The Search Result Done object */
-    private SearchResultDone searchResultDone;
+    private SearchResultDoneDsml searchResultDone;
 
 
     /**
@@ -68,7 +65,7 @@ public class SearchResponse extends Abst
      * @return
      *      true (as per the general contract of the Collection.add method)
      */
-    public boolean addSearchResultEntry( SearchResultEntry searchResultEntry )
+    public boolean addSearchResultEntry( SearchResultEntryDsml searchResultEntry )
     {
         return searchResultEntryList.add( searchResultEntry );
     }
@@ -80,7 +77,7 @@ public class SearchResponse extends Abst
      * @return
      *      the current Searche Result Entry
      */
-    public SearchResultEntry getCurrentSearchResultEntry()
+    public SearchResultEntryDsml getCurrentSearchResultEntry()
     {
         if ( searchResultEntryList.size() > 0 )
         {
@@ -99,7 +96,7 @@ public class SearchResponse extends Abst
      * @return
      *      the Search Result Entry List
      */
-    public List<SearchResultEntry> getSearchResultEntryList()
+    public List<SearchResultEntryDsml> getSearchResultEntryList()
     {
         return searchResultEntryList;
     }
@@ -113,7 +110,7 @@ public class SearchResponse extends Abst
      * @return
      *      true (as per the general contract of the Collection.add method)
      */
-    public boolean addSearchResultReference( SearchResultReference searchResultReference )
+    public boolean addSearchResultReference( SearchResultReferenceDsml searchResultReference )
     {
         return searchResultReferenceList.add( searchResultReference );
     }
@@ -125,7 +122,7 @@ public class SearchResponse extends Abst
      * @return
      *      the current Search Result Reference
      */
-    public SearchResultReference getCurrentSearchResultReference()
+    public SearchResultReferenceDsml getCurrentSearchResultReference()
     {
         if ( searchResultReferenceList.size() > 0 )
         {
@@ -144,7 +141,7 @@ public class SearchResponse extends Abst
      * @return
      *      the Search Result Reference List
      */
-    public List<SearchResultReference> getSearchResultReferenceList()
+    public List<SearchResultReferenceDsml> getSearchResultReferenceList()
     {
         return searchResultReferenceList;
     }
@@ -156,7 +153,7 @@ public class SearchResponse extends Abst
      * @return
      *      the Search Result Entry
      */
-    public SearchResultDone getSearchResultDone()
+    public SearchResultDoneDsml getSearchResultDone()
     {
         return searchResultDone;
     }
@@ -168,7 +165,7 @@ public class SearchResponse extends Abst
      * @param searchResultDone
      *      the Search Result Entry to set
      */
-    public void setSearchResultDone( SearchResultDone searchResultDone )
+    public void setSearchResultDone( SearchResultDoneDsml searchResultDone )
     {
         this.searchResultDone = searchResultDone;
     }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResponseDsml.java Sun Feb  6 15:45:55 2011
@@ -27,6 +27,9 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
 import org.apache.directory.shared.ldap.model.message.Message;
 import org.apache.directory.shared.ldap.model.message.Response;
+import org.apache.directory.shared.ldap.model.message.SearchResultDone;
+import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
+import org.apache.directory.shared.ldap.model.message.SearchResultReference;
 import org.dom4j.Element;
 
 
@@ -74,6 +77,26 @@ public class SearchResponseDsml extends 
      */
     public boolean addResponse( DsmlDecorator<? extends Response> response )
     {
+        if ( response instanceof SearchResultEntry )
+        {
+            ( ( SearchResponse ) getDecorated() ).addSearchResultEntry( 
+                ( SearchResultEntryDsml ) response );            
+        }
+        else if ( response instanceof SearchResultReference )
+        {
+            ( ( SearchResponse ) getDecorated() ).addSearchResultReference( 
+                ( SearchResultReferenceDsml ) response );            
+        }
+        else if ( response instanceof SearchResultDone )
+        {
+            ( ( SearchResponse ) getDecorated() ).setSearchResultDone( 
+                ( SearchResultDoneDsml ) response );            
+        }
+        else
+        {
+            throw new IllegalArgumentException( "Unidentified search resp type" );
+        }
+        
         return responses.add( response );
     }
 

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/SearchResultEntryDsml.java Sun Feb  6 15:45:55 2011
@@ -17,13 +17,12 @@
  *  under the License. 
  *  
  */
-
 package org.apache.directory.shared.dsmlv2.reponse;
 
 
-import org.apache.directory.shared.dsmlv2.ParserUtils;
+import org.apache.directory.shared.dsmlv2.ParserUtils; 
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
-import org.apache.directory.shared.ldap.codec.decorators.SearchResultEntryDecorator;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -46,6 +45,11 @@ public class SearchResultEntryDsml 
     extends AbstractResponseDsml<SearchResultEntry>
     implements SearchResultEntry
 {
+    
+    /** The current attribute being processed */
+    private EntryAttribute currentAttribute;
+    
+    
     /**
      * Creates a new getDecoratedMessage() of SearchResultEntryDsml.
      */
@@ -66,6 +70,45 @@ public class SearchResultEntryDsml 
         super( codec, ldapMessage );
     }
 
+    
+    
+    
+    public EntryAttribute getCurrentAttribute()
+    {
+        return currentAttribute;
+    }
+
+
+    /**
+     * Create a new attribute
+     * 
+     * @param type The attribute's type
+     */
+    public void addAttribute( String type ) throws LdapException
+    {
+        currentAttribute = new DefaultEntryAttribute( type );
+
+        getDecorated().getEntry().put( currentAttribute );
+    }
+
+
+    /**
+     * Add a new value to the current attribute
+     * 
+     * @param value The added value
+     */
+    public void addAttributeValue( Object value )
+    {
+        if ( value instanceof String )
+        {
+            currentAttribute.add( ( String ) value );
+        }
+        else
+        {
+            currentAttribute.add( ( byte[] ) value );
+        }
+    }
+    
 
     /**
      * {@inheritDoc}
@@ -159,27 +202,4 @@ public class SearchResultEntryDsml 
     {
         getDecorated().setEntry( entry );
     }
-
-
-    /**
-     * Create a new attribute.
-     * 
-     * @param type The attribute's name
-     * @throws LdapException if the type doesn't exist
-     */
-    public void addAttributeType( String type ) throws LdapException
-    {
-        ( ( SearchResultEntryDecorator ) getDecorated() ).addAttribute( type );
-    }
-
-
-    /**
-     * Add a new value to the current attribute.
-     * 
-     * @param value the added value
-     */
-    public void addAttributeValue( Object value )
-    {
-        ( ( SearchResultEntryDecorator ) getDecorated() ).addAttributeValue( value );
-    }
 }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AddRequestDsml.java Sun Feb  6 15:45:55 2011
@@ -22,7 +22,7 @@ package org.apache.directory.shared.dsml
 
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
-import org.apache.directory.shared.ldap.codec.decorators.AddRequestDecorator;
+import org.apache.directory.shared.ldap.model.entry.DefaultEntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.model.entry.Value;
@@ -45,6 +45,11 @@ public class AddRequestDsml 
     extends AbstractResultResponseRequestDsml<AddRequest> 
     implements AddRequest
 {
+
+    /** The current attribute being decoded */
+    private EntryAttribute currentAttribute;
+    
+    
     /**
      * Creates a new getDecoratedMessage() of AddRequestDsml.
      */
@@ -65,8 +70,72 @@ public class AddRequestDsml 
         super( codec, ldapMessage );
     }
 
+    
+
+    
+    /**
+     * Create a new attributeValue
+     * 
+     * @param type The attribute's name (called 'type' in the grammar)
+     */
+    public void addAttributeType( String type ) throws LdapException
+    {
+        // do not create a new attribute if we have seen this attributeType before
+        if ( getDecorated().getEntry().get( type ) != null )
+        {
+            currentAttribute = getDecorated().getEntry().get( type );
+            return;
+        }
+
+        // fix this to use AttributeImpl(type.getString().toLowerCase())
+        currentAttribute = new DefaultEntryAttribute( type );
+        getDecorated().getEntry().put( currentAttribute );
+    }
+
+
+    /**
+     * @return Returns the currentAttribute type.
+     */
+    public String getCurrentAttributeType()
+    {
+        return currentAttribute.getId();
+    }
+
+
+    /**
+     * Add a new value to the current attribute
+     * 
+     * @param value The value to add
+     */
+    public void addAttributeValue( String value )
+    {
+        currentAttribute.add( value );
+    }
+
+
+    /**
+     * Add a new value to the current attribute
+     * 
+     * @param value The value to add
+     */
+    public void addAttributeValue( Value<?> value )
+    {
+        currentAttribute.add( value );
+    }
+
 
     /**
+     * Add a new value to the current attribute
+     * 
+     * @param value The value to add
+     */
+    public void addAttributeValue( byte[] value )
+    {
+        currentAttribute.add( value );
+    }
+    
+    
+    /**
      * {@inheritDoc}
      */
     public MessageTypeEnum getType()
@@ -144,18 +213,6 @@ public class AddRequestDsml 
 
 
     /**
-     * Create a new attributeValue
-     * 
-     * @param type The attribute's name (called 'type' in the grammar)
-     * @throws org.apache.directory.shared.ldap.model.exception.LdapException
-     */
-    public void addAttributeType( String type ) throws LdapException
-    {
-        ( ( AddRequestDecorator ) getDecorated() ).addAttributeType( type );
-    }
-
-
-    /**
      * Add a new value to the current attribute
      * 
      * @param value The value to be added
@@ -164,15 +221,15 @@ public class AddRequestDsml 
     {
         if ( value instanceof Value<?> )
         {
-            ( ( AddRequestDecorator ) getDecorated() ).addAttributeValue( (Value<?>) value );
+            ( ( AddRequestDsml ) getDecorated() ).addAttributeValue( (Value<?>) value );
         }
         else if ( value instanceof String )
         {
-            ( ( AddRequestDecorator ) getDecorated() ).addAttributeValue( ( String ) value );
+            ( ( AddRequestDsml ) getDecorated() ).addAttributeValue( ( String ) value );
         }
         else if ( value instanceof byte[] )
         {
-            ( ( AddRequestDecorator ) getDecorated() ).addAttributeValue( ( byte[] ) value );
+            ( ( AddRequestDsml ) getDecorated() ).addAttributeValue( ( byte[] ) value );
         }
     }
 
@@ -212,15 +269,6 @@ public class AddRequestDsml 
 
 
     /**
-     * @return Returns the currentAttribute type.
-     */
-    public String getCurrentAttributeType()
-    {
-        return ( ( AddRequestDecorator ) getDecorated() ).getCurrentAttributeType();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public MessageTypeEnum getResponseType()

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequestDsml.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequestDsml.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/BatchRequestDsml.java Sun Feb  6 15:45:55 2011
@@ -25,9 +25,6 @@ import java.util.List;
 
 import org.apache.directory.shared.dsmlv2.DsmlDecorator;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.OnError;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.Processing;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
 import org.apache.directory.shared.ldap.model.message.Request;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
@@ -58,6 +55,48 @@ public class BatchRequestDsml
 
 
     /**
+     * This enum represents the different types of processing for a Batch Request 
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     */
+    public enum Processing
+    {
+        /** Sequential processing. */
+        SEQUENTIAL, 
+        /** Parallel processing. */
+        PARALLEL
+    }
+
+    
+    /**
+     * This enum represents the different types of on error handling for a BatchRequest
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+         */
+    public enum OnError
+    {
+        /** Resume on error. */
+        RESUME, 
+        /** Exit on error. */
+        EXIT
+    }
+
+
+    /**
+     * This enum represents the different types of response order for a Batch Request
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+         */
+    public enum ResponseOrder
+    {
+        /** Sequential response order. */
+        SEQUENTIAL,
+        /** Unordered response order. */
+        UNORDERED
+    }
+    
+    
+    /**
      * Creates a new instance of BatchResponseDsml.
      */
     public BatchRequestDsml()
@@ -70,6 +109,18 @@ public class BatchRequestDsml
 
 
     /**
+     * Gets the current request
+     *
+     * @return
+     *      the current request
+     */
+    public DsmlDecorator<? extends Request> getCurrentRequest()
+    {
+        return requests.get( requests.size() - 1 );
+    }
+
+    
+    /**
      * Adds a request to the Batch Request DSML.
      *
      * @param request
@@ -170,10 +221,10 @@ public class BatchRequestDsml
 
 
     /**
-     * Gets the reponse order type of the request
+     * Gets the response order type of the request
      *
      * @return
-     *      the reponse order type of the request
+     *      the response order type of the request
      */
     public ResponseOrder getResponseOrder()
     {
@@ -182,10 +233,10 @@ public class BatchRequestDsml
 
 
     /**
-     * Sets the reponse order type of the request
+     * Sets the response order type of the request
      *
      * @param responseOrder
-     *      the reponse order type to set
+     *      the response order type to set
      */
     public void setResponseOrder( ResponseOrder responseOrder )
     {
@@ -194,6 +245,17 @@ public class BatchRequestDsml
 
 
     /**
+     * Gets the List of all the requests in the Batch Request
+     *
+     * @return the List of all the requests in the Batch Request
+     */
+    public List<DsmlDecorator<? extends Request>> getRequests()
+    {
+        return requests;
+    }
+
+    
+    /**
      * Converts this Batch Request to its XML representation in the DSMLv2 format.
      * 
      * @return the XML representation in DSMLv2 format
@@ -235,4 +297,24 @@ public class BatchRequestDsml
 
         return ParserUtils.styleDocument( document ).asXML();
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "[" );
+        sb.append( "processing: " + processing );
+        sb.append( " - " );
+        sb.append( "onError: " + onError );
+        sb.append( " - " );
+        sb.append( "responseOrder: " + responseOrder );
+        sb.append( "]" );
+
+        return sb.toString();
+    }
 }

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java Sun Feb  6 15:45:55 2011
@@ -28,6 +28,7 @@ import java.util.HashMap;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.util.OID;
 import org.apache.directory.shared.dsmlv2.AbstractGrammar;
+import org.apache.directory.shared.dsmlv2.DsmlControl;
 import org.apache.directory.shared.dsmlv2.Dsmlv2Container;
 import org.apache.directory.shared.dsmlv2.Dsmlv2StatesEnum;
 import org.apache.directory.shared.dsmlv2.GrammarAction;
@@ -35,25 +36,15 @@ import org.apache.directory.shared.dsmlv
 import org.apache.directory.shared.dsmlv2.IGrammar;
 import org.apache.directory.shared.dsmlv2.ParserUtils;
 import org.apache.directory.shared.dsmlv2.Tag;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.OnError;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.Processing;
-import org.apache.directory.shared.dsmlv2.request.BatchRequest.ResponseOrder;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.OnError;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.Processing;
+import org.apache.directory.shared.dsmlv2.request.BatchRequestDsml.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.CodecControl;
 import org.apache.directory.shared.ldap.codec.LdapCodecService;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
-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;
-import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.DeleteRequestDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.ExtendedRequestDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.ModifyDnRequestDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 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;
@@ -80,6 +71,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ModifyRequestImpl;
+import org.apache.directory.shared.ldap.model.message.Request;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 import org.apache.directory.shared.ldap.model.message.SearchRequestImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -1058,7 +1050,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BatchRequest batchRequest = new BatchRequest();
+            BatchRequestDsml batchRequest = new BatchRequestDsml();
 
             container.setBatchRequest( batchRequest );
 
@@ -1151,7 +1143,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AbandonRequestDecorator abandonRequest = new AbandonRequestDecorator( codec, new AbandonRequestImpl() );
+            AbandonRequestDsml abandonRequest = new AbandonRequestDsml( codec, new AbandonRequestImpl() );
             container.getBatchRequest().addRequest( abandonRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1198,7 +1190,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddRequestDecorator addRequest = new AddRequestDecorator( codec, new AddRequestImpl() );
+            AddRequestDsml addRequest = new AddRequestDsml( codec, new AddRequestImpl() );
             container.getBatchRequest().addRequest( addRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1245,7 +1237,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddRequestDecorator addRequest = ( AddRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            AddRequestDsml addRequest = ( AddRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1279,7 +1272,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            AddRequestDecorator addRequest = ( AddRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            AddRequestDsml addRequest = ( AddRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
             
@@ -1316,7 +1310,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            BindRequestDecorator authRequest = new BindRequestDecorator( codec, new BindRequestImpl() );
+            BindRequestDsml authRequest = new BindRequestDsml( codec, new BindRequestImpl() );
             container.getBatchRequest().addRequest( authRequest );
 
             authRequest.setSimple( true );
@@ -1368,7 +1362,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            CompareRequestDecorator compareRequest = new CompareRequestDecorator( codec, new CompareRequestImpl() );
+            CompareRequestDsml compareRequest = new CompareRequestDsml( codec, new CompareRequestImpl() );
             container.getBatchRequest().addRequest( compareRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1484,7 +1478,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            DeleteRequestDecorator delRequest = new DeleteRequestDecorator( codec, new DeleteRequestImpl() );
+            DelRequestDsml delRequest = new DelRequestDsml( codec, new DeleteRequestImpl() );
             container.getBatchRequest().addRequest( delRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1534,7 +1528,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ExtendedRequestDecorator extendedRequest = new ExtendedRequestDecorator( codec, new ExtendedRequestImpl() );
+            ExtendedRequestDsml extendedRequest = new ExtendedRequestDsml( codec, new ExtendedRequestImpl() );
             container.getBatchRequest().addRequest( extendedRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1643,7 +1637,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyDnRequestDecorator modifyDNRequest = new ModifyDnRequestDecorator( codec, new ModifyDnRequestImpl() );
+            ModifyDNRequestDsml modifyDNRequest = new ModifyDNRequestDsml( codec, new ModifyDnRequestImpl() );
             container.getBatchRequest().addRequest( modifyDNRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1750,7 +1744,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestDecorator modifyRequest = new ModifyRequestDecorator( codec, new ModifyRequestImpl() );
+            ModifyRequestDsml modifyRequest = new ModifyRequestDsml( codec, new ModifyRequestImpl() );
             container.getBatchRequest().addRequest( modifyRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -1800,7 +1794,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestDecorator modifyRequest = ( ModifyRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            ModifyRequestDsml modifyRequest = ( ModifyRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1856,7 +1851,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestDecorator modifyRequest = ( ModifyRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            ModifyRequestDsml modifyRequest = ( ModifyRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1892,7 +1888,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequest = new SearchRequestDecorator( codec, new SearchRequestImpl() );
+            SearchRequestDsml searchRequest = new SearchRequestDsml( codec, new SearchRequestImpl() );
             container.getBatchRequest().addRequest( searchRequest );
 
             XmlPullParser xpp = container.getParser();
@@ -2087,7 +2083,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2128,9 +2125,11 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
-            SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter();
+            SubstringFilter substringFilter = ( SubstringFilter ) 
+                searchRequestDecorator.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2169,7 +2168,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter();
 
@@ -2209,7 +2209,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             SubstringFilter substringFilter = ( SubstringFilter ) searchRequestDecorator.getTerminalFilter();
 
@@ -2250,7 +2251,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             searchRequestDecorator.setTerminalFilter( null );
         }
@@ -2263,7 +2265,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2288,7 +2291,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             Filter filter = searchRequestDecorator.getCurrentFilter();
 
@@ -2303,7 +2307,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2328,7 +2333,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2353,7 +2359,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2397,7 +2404,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2441,7 +2449,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2487,7 +2496,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2530,7 +2540,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = (SearchRequestDecorator)container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml )
+                container.getBatchRequest().getCurrentRequest();
             AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) searchRequestDecorator.getTerminalFilter();
             AttributeValueAssertion assertion = filter.getAssertion();
 
@@ -2577,7 +2588,8 @@ public final class Dsmlv2Grammar extends
             XmlPullParser xpp = container.getParser();
 
             // Adding the filter to the Search Filter
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             try
             {
@@ -2612,7 +2624,8 @@ public final class Dsmlv2Grammar extends
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
             // Adding the filter to the Search Filter
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
             SearchRequest searchRequest = searchRequestDecorator.getDecorated();
 
             searchRequest.setFilter( searchRequestDecorator.getFilterNode() );
@@ -2631,7 +2644,8 @@ public final class Dsmlv2Grammar extends
             XmlPullParser xpp = container.getParser();
 
             // Adding the filter to the Search Filter
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
 
             try
             {
@@ -2694,7 +2708,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestDecorator searchRequestDecorator = ( SearchRequestDecorator ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDsml searchRequestDecorator = ( SearchRequestDsml ) 
+                container.getBatchRequest().getCurrentRequest();
             ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) searchRequestDecorator.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
@@ -2748,7 +2763,7 @@ public final class Dsmlv2Grammar extends
                 }
 
                 control = codec.newControl( codec.newControl( attributeValue ) );
-                container.getBatchRequest().getCurrentRequest().addControl( control );
+                ( ( Request ) container.getBatchRequest().getCurrentRequest() ).addControl( control );
             }
             else
             {
@@ -2783,8 +2798,9 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            MessageDecorator<?> messageDecorator = ( MessageDecorator<?> ) container.getBatchRequest().getCurrentRequest();
-            CodecControl<? extends Control> control = messageDecorator.getCurrentControl();
+            AbstractRequestDsml<? extends Request> request = 
+                ( AbstractRequestDsml<? extends Request> ) container.getBatchRequest().getCurrentRequest();
+            DsmlControl<? extends Control> control = request.getCurrentControl();
 
             XmlPullParser xpp = container.getParser();
 

Modified: directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java?rev=1067686&r1=1067685&r2=1067686&view=diff
==============================================================================
--- directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java (original)
+++ directory/shared/branches/m1/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ExtendedRequestDsml.java Sun Feb  6 15:45:55 2011
@@ -139,7 +139,7 @@ public class ExtendedRequestDsml 
      */
     public void setRequestValue( byte[] requestValue )
     {
-        getDecorated().getRequestValue();
+        getDecorated().setRequestValue( requestValue );
     }
 
 



Mime
View raw message