directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063497 [1/3] - in /directory/shared/trunk: dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/ ldap/src/main/java/org/apache/directory/shared/ldap/codec/ ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/...
Date Tue, 25 Jan 2011 22:42:11 GMT
Author: akarasulu
Date: Tue Jan 25 22:42:10 2011
New Revision: 1063497

URL: http://svn.apache.org/viewvc?rev=1063497&view=rev
Log:
Shared refactoring ...

  o decoupled the codec filter logic from SearchRequestImpl


Modified:
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/SearchRequestDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/SearchRequestImpl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/Request.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestMatchingRuleAssertionTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestSubstringTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/SearchRequestTest.java

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=1063497&r1=1063496&r2=1063497&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:42:10 2011
@@ -42,7 +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.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;
@@ -51,7 +51,6 @@ 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;
@@ -62,13 +61,10 @@ 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.AliasDerefMode;
+import org.apache.directory.shared.ldap.model.message.*;
 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;
@@ -77,6 +73,8 @@ 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;
@@ -1737,9 +1735,6 @@ 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();
 
@@ -1788,7 +1783,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestDecorator modifyRequest = ( ModifyRequestDecorator ) container.getBatchRequestDecorator().getCurrentRequest();
+            ModifyRequestImpl modifyRequest = ( ModifyRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -1844,7 +1839,7 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            ModifyRequestDecorator modifyRequest = ( ModifyRequestDecorator ) container.getBatchRequestDecorator().getCurrentRequest();
+            ModifyRequestImpl modifyRequest = ( ModifyRequestImpl ) container.getBatchRequest().getCurrentRequest();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2075,7 +2070,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2084,13 +2080,13 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
-            searchRequest.setTerminalFilter( filter );
+            decorator.setTerminalFilter( filter );
 
             // Checking and adding the filter's attributes
             String attributeValue;
@@ -2115,8 +2111,9 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
-            SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
+            SubstringFilter substringFilter = ( SubstringFilter ) decorator.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2155,8 +2152,9 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
-            SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
+            SubstringFilter substringFilter = ( SubstringFilter ) decorator.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2194,8 +2192,9 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
-            SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
+            SubstringFilter substringFilter = ( SubstringFilter ) decorator.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
 
@@ -2234,9 +2233,10 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
-            searchRequest.setTerminalFilter( null );
+            decorator.setTerminalFilter( null );
         }
     };
 
@@ -2247,7 +2247,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2256,7 +2257,7 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
@@ -2272,11 +2273,12 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
-            Filter filter = searchRequest.getCurrentFilter().getParent();
+            Filter filter = decorator.getCurrentFilter().getParent();
 
-            searchRequest.setCurrentFilter( filter );
+            decorator.setCurrentFilter( filter );
         }
     };
 
@@ -2287,7 +2289,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2296,7 +2299,7 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
@@ -2312,7 +2315,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2321,7 +2325,7 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
@@ -2337,7 +2341,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2363,14 +2368,14 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
 
-            searchRequest.setTerminalFilter( filter );
+            decorator.setTerminalFilter( filter );
         }
     };
 
@@ -2381,7 +2386,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2407,14 +2413,14 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
 
-            searchRequest.setTerminalFilter( filter );
+            decorator.setTerminalFilter( filter );
         }
     };
 
@@ -2425,7 +2431,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2453,14 +2460,14 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
 
-            searchRequest.setTerminalFilter( filter );
+            decorator.setTerminalFilter( filter );
         }
     };
 
@@ -2471,7 +2478,8 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             XmlPullParser xpp = container.getParser();
 
@@ -2496,14 +2504,14 @@ public final class Dsmlv2Grammar extends
             // Adding the filter to the Search Filter
             try
             {
-                searchRequest.addCurrentFilter( filter );
+                decorator.addCurrentFilter( filter );
             }
             catch ( DecoderException e )
             {
                 throw new XmlPullParserException( e.getMessage(), xpp, null );
             }
 
-            searchRequest.setTerminalFilter( filter );
+            decorator.setTerminalFilter( filter );
         }
     };
 
@@ -2514,8 +2522,9 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
-            AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) searchRequest.getTerminalFilter();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
+            AttributeValueAssertionFilter filter = ( AttributeValueAssertionFilter ) decorator.getTerminalFilter();
             AttributeValueAssertion assertion = filter.getAssertion();
 
             XmlPullParser xpp = container.getParser();
@@ -2561,11 +2570,12 @@ public final class Dsmlv2Grammar extends
             XmlPullParser xpp = container.getParser();
 
             // Adding the filter to the Search Filter
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             try
             {
-                searchRequest.addCurrentFilter( presentFilter );
+                decorator.addCurrentFilter( presentFilter );
             }
             catch ( DecoderException e )
             {
@@ -2600,18 +2610,19 @@ public final class Dsmlv2Grammar extends
             XmlPullParser xpp = container.getParser();
 
             // Adding the filter to the Search Filter
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
 
             try
             {
-                searchRequest.addCurrentFilter( extensibleMatchFilter );
+                decorator.addCurrentFilter( extensibleMatchFilter );
             }
             catch ( DecoderException e )
             {
                 throw new XmlPullParserException( I18n.err( I18n.ERR_03012 ), xpp, null );
             }
 
-            searchRequest.setTerminalFilter( extensibleMatchFilter );
+            decorator.setTerminalFilter( extensibleMatchFilter );
 
             // Checking and adding the filter's attributes
             String attributeValue;
@@ -2663,8 +2674,9 @@ public final class Dsmlv2Grammar extends
     {
         public void action( Dsmlv2Container container ) throws XmlPullParserException
         {
-            SearchRequestImpl searchRequest = ( SearchRequestImpl ) container.getBatchRequest().getCurrentRequest();
-            ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter();
+            SearchRequest searchRequest = ( SearchRequest ) container.getBatchRequest().getCurrentRequest();
+            SearchRequestDecorator decorator = new SearchRequestDecorator( searchRequest );
+            ExtensibleMatchFilter filter = ( ExtensibleMatchFilter ) decorator.getTerminalFilter();
 
             XmlPullParser xpp = container.getParser();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapDecoder.java Tue Jan 25 22:42:10 2011
@@ -64,10 +64,6 @@ public class LdapDecoder implements Prot
 
     /**
      * Creates an instance of a Ldap Decoder implementation.
-     * 
-     * @param provider the owning provider.
-     * @param binaryAttributeDetector checks for binary attributes 
-     * @param maxPDUSize the maximum size a PDU can be
      */
     public LdapDecoder()
     {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java Tue Jan 25 22:42:10 2011
@@ -22,6 +22,8 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
 import org.apache.directory.shared.ldap.codec.controls.AbstractControl;
+import org.apache.directory.shared.ldap.codec.decorators.MessageDecorator;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
 import org.apache.directory.shared.ldap.message.spi.BinaryAttributeDetector;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
@@ -60,6 +62,9 @@ public class LdapMessageContainer extend
     /** The internal ldap message */
     private Message message;
 
+    /** The Message decorator to store various temporary values */
+    private MessageDecorator decorator;
+
     /** checks if attribute is binary */
     private final BinaryAttributeDetector binaryAttributeDetector;
 
@@ -143,7 +148,7 @@ public class LdapMessageContainer extend
      */
     public BindRequest getBindRequest()
     {
-        return (BindRequest) message;
+        return ( BindRequest ) message;
     }
 
 
@@ -267,9 +272,9 @@ public class LdapMessageContainer extend
     /**
      * @return Returns the SearchRequest stored in the container
      */
-    public SearchRequest getSearchRequest()
+    public SearchRequestDecorator getSearchRequestDecorator()
     {
-        return ( SearchRequest ) message;
+        return ( SearchRequestDecorator ) decorator;
     }
 
 
@@ -296,7 +301,7 @@ public class LdapMessageContainer extend
      */
     public SearchResultDone getSearchResultDone()
     {
-        return (SearchResultDone) message;
+        return ( SearchResultDone ) message;
     }
 
 
@@ -321,6 +326,17 @@ public class LdapMessageContainer extend
     }
 
 
+    public MessageDecorator getMessageDecorator()
+    {
+        if ( decorator == null )
+        {
+            decorator = MessageDecorator.getDecorator( message );
+        }
+
+        return decorator;
+    }
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Tue Jan 25 22:42:10 2011
@@ -71,6 +71,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.actions.StoreTypeMatchingRuleAction;
 import org.apache.directory.shared.ldap.codec.actions.ValueAction;
 import org.apache.directory.shared.ldap.codec.controls.ControlFactory;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ModifyRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
@@ -3601,8 +3602,8 @@ public final class LdapMessageGrammar ex
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                     SearchRequest searchRequest = new SearchRequestImpl( ldapMessageContainer.getMessageId() );
-                    ( ( SearchRequestImpl ) searchRequest ).setTlvId( tlv.getId() );
                     ldapMessageContainer.setMessage( searchRequest );
+                    ldapMessageContainer.getSearchRequestDecorator().setTlvId(tlv.getId());
 
                     LOG.debug( "Search Request" );
                 }
@@ -3623,7 +3624,7 @@ public final class LdapMessageGrammar ex
                 public void action( Asn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequestDecorator().getSearchRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -3659,7 +3660,7 @@ public final class LdapMessageGrammar ex
                         baseObject = Dn.EMPTY_DN;
                     }
 
-                    searchRequest.setBase( baseObject );
+                    searchRequest.setBase(baseObject);
 
                     LOG.debug( "Searching with root Dn : {}", baseObject );
                 }
@@ -3685,7 +3686,7 @@ public final class LdapMessageGrammar ex
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequestDecorator().getSearchRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -3748,7 +3749,7 @@ public final class LdapMessageGrammar ex
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequestDecorator().getSearchRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -3811,7 +3812,7 @@ public final class LdapMessageGrammar ex
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequestDecorator().getSearchRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -3857,7 +3858,7 @@ public final class LdapMessageGrammar ex
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequestDecorator().getSearchRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -3904,7 +3905,7 @@ public final class LdapMessageGrammar ex
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequestDecorator().getSearchRequest();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -5045,13 +5046,12 @@ public final class LdapMessageGrammar ex
                 public void action( Asn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                     // Store the value.
-                    SubstringFilter substringFilter = ( SubstringFilter ) ( ( SearchRequestImpl ) searchRequest )
-                        .getTerminalFilter();
+                    SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
 
                     if ( tlv.getLength() == 0 )
                     {
@@ -5066,7 +5066,7 @@ public final class LdapMessageGrammar ex
 
                         // We now have to get back to the nearest filter which
                         // is not terminal.
-                        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( substringFilter );
+                        searchRequest.setTerminalFilter( substringFilter );
                     }
                 }
             } );
@@ -5120,13 +5120,12 @@ public final class LdapMessageGrammar ex
                 public void action( Asn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                     // Store the value.
-                    SubstringFilter substringFilter = ( SubstringFilter ) ( ( SearchRequestImpl ) searchRequest )
-                        .getTerminalFilter();
+                    SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
 
                     if ( tlv.getLength() == 0 )
                     {
@@ -5139,7 +5138,7 @@ public final class LdapMessageGrammar ex
 
                     // We now have to get back to the nearest filter which is
                     // not terminal.
-                    ( ( SearchRequestImpl ) searchRequest ).unstackFilters( container );
+                    searchRequest.unstackFilters( container );
                 }
             } );
 
@@ -6042,13 +6041,13 @@ public final class LdapMessageGrammar ex
                 public void action( Asn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                     // Store the value.
-                    ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) ( ( SearchRequestImpl ) searchRequest )
-                        .getTerminalFilter();
+                    ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter )
+                            searchRequest.getTerminalFilter();
 
                     if ( tlv.getLength() == 0 )
                     {
@@ -6169,13 +6168,12 @@ public final class LdapMessageGrammar ex
                 public void action( Asn1Container container ) throws DecoderException
                 {
                     LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-                    SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+                    SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
                     TLV tlv = ldapMessageContainer.getCurrentTLV();
 
                     // Store the value.
-                    ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) ( ( SearchRequestImpl ) searchRequest )
-                        .getTerminalFilter();
+                    ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter();
 
                     // We get the value. If it's a 0, it's a FALSE. If it's
                     // a FF, it's a TRUE. Any other value should be an error,
@@ -6203,7 +6201,7 @@ public final class LdapMessageGrammar ex
                     }
 
                     // unstack the filters if needed
-                    ( ( SearchRequestImpl ) searchRequest ).unstackFilters( ldapMessageContainer );
+                    searchRequest.unstackFilters( ldapMessageContainer );
                 }
             } );
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java Tue Jan 25 22:42:10 2011
@@ -25,6 +25,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -61,8 +62,7 @@ public class AttributeDescAction extends
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
-
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
         TLV tlv = ldapMessageContainer.getCurrentTLV();
         String attributeDescription = null;
 
@@ -73,7 +73,7 @@ public class AttributeDescAction extends
             // If the attributeDescription is empty, we won't add it
             if ( !Strings.isEmpty(attributeDescription.trim()) )
             {
-                searchRequest.addAttributes( attributeDescription );
+                searchRequest.getSearchRequest().addAttributes( attributeDescription );
             }
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java Tue Jan 25 22:42:10 2011
@@ -26,6 +26,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+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.Filter;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
@@ -73,13 +74,13 @@ public class InitAndFilterAction extends
             throw new DecoderException( msg );
         }
 
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the SearchRequest
         Filter andFilter = new AndFilter( ldapMessageContainer.getTlvId() );
 
         // Set the filter
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( andFilter );
+        searchRequest.addCurrentFilter( andFilter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java Tue Jan 25 22:42:10 2011
@@ -25,6 +25,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
@@ -62,17 +63,17 @@ public class InitApproxMatchFilterAction
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( ldapMessageContainer.getTlvId(),
             LdapConstants.APPROX_MATCH_FILTER );
 
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( filter );
+        searchRequest.addCurrentFilter( filter );
 
         // Store the filter structure that still has to be
         // fulfilled
-        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( filter );
+        searchRequest.setTerminalFilter( filter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java Tue Jan 25 22:42:10 2011
@@ -26,12 +26,11 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 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;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.util.StringConstants;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
@@ -67,7 +66,7 @@ public class InitAssertionValueFilterAct
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -83,8 +82,8 @@ public class InitAssertionValueFilterAct
             assertionValue = new BinaryValue( StringConstants.EMPTY_BYTES );
         }
 
-        AttributeValueAssertionFilter terminalFilter = ( AttributeValueAssertionFilter ) ( ( SearchRequestImpl ) searchRequest )
-            .getTerminalFilter();
+        AttributeValueAssertionFilter terminalFilter = ( AttributeValueAssertionFilter )
+                searchRequest.getTerminalFilter();
         AttributeValueAssertion assertion = terminalFilter.getAssertion();
 
         if ( ldapMessageContainer.isBinary( assertion.getAttributeDesc() ) )
@@ -116,7 +115,7 @@ public class InitAssertionValueFilterAct
 
         // We now have to get back to the nearest filter which is
         // not terminal.
-        ( ( SearchRequestImpl ) searchRequest ).unstackFilters( container );
+        searchRequest.unstackFilters( container );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java Tue Jan 25 22:42:10 2011
@@ -27,9 +27,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -64,7 +63,7 @@ public class InitAttributeDescFilterActi
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -81,8 +80,8 @@ public class InitAttributeDescFilterActi
             String type = Strings.utf8ToString(tlv.getValue().getData());
             assertion.setAttributeDesc( type );
 
-            AttributeValueAssertionFilter terminalFilter = ( AttributeValueAssertionFilter ) ( ( SearchRequestImpl ) searchRequest )
-                .getTerminalFilter();
+            AttributeValueAssertionFilter terminalFilter = ( AttributeValueAssertionFilter )
+                    searchRequest.getTerminalFilter();
             terminalFilter.setAssertion( assertion );
         }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java Tue Jan 25 22:42:10 2011
@@ -25,10 +25,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,17 +61,17 @@ public class InitEqualityMatchFilterActi
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( ldapMessageContainer.getTlvId(),
             LdapConstants.EQUALITY_MATCH_FILTER );
 
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( filter );
+        searchRequest.addCurrentFilter( filter );
 
         // Store the filter structure that still has to be
         // fulfilled
-        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( filter );
+        searchRequest.setTerminalFilter( filter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java Tue Jan 25 22:42:10 2011
@@ -24,10 +24,10 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,13 +61,13 @@ public class InitExtensibleMatchFilterAc
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the ExtensibleMatch Filter
         Filter extensibleMatchFilter = new ExtensibleMatchFilter( ldapMessageContainer.getTlvId() );
 
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( extensibleMatchFilter );
-        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( extensibleMatchFilter );
+        searchRequest.addCurrentFilter( extensibleMatchFilter );
+        searchRequest.setTerminalFilter( extensibleMatchFilter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java Tue Jan 25 22:42:10 2011
@@ -25,10 +25,10 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,17 +62,17 @@ public class InitGreaterOrEqualFilterAct
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( ldapMessageContainer.getTlvId(),
             LdapConstants.GREATER_OR_EQUAL_FILTER );
 
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( filter );
+        searchRequest.addCurrentFilter( filter );
 
         // Store the filter structure that still has to be
         // fullfiled
-        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( filter );
+        searchRequest.setTerminalFilter( filter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java Tue Jan 25 22:42:10 2011
@@ -25,10 +25,10 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,17 +62,17 @@ public class InitLessOrEqualFilterAction
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( ldapMessageContainer.getTlvId(),
             LdapConstants.LESS_OR_EQUAL_FILTER );
 
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( filter );
+        searchRequest.addCurrentFilter( filter );
 
         // Store the filter structure that still has to be
         // fullfiled
-        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( filter );
+        searchRequest.setTerminalFilter( filter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java Tue Jan 25 22:42:10 2011
@@ -26,6 +26,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.NotFilter;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
@@ -73,13 +74,13 @@ public class InitNotFilterAction extends
             throw new DecoderException( msg );
         }
 
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the SearchRequest
         Filter notFilter = new NotFilter( ldapMessageContainer.getTlvId() );
 
         // Set the filter
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( notFilter );
+        searchRequest.addCurrentFilter( notFilter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java Tue Jan 25 22:42:10 2011
@@ -26,10 +26,10 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.OrFilter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -73,13 +73,13 @@ public class InitOrFilterAction extends 
             throw new DecoderException( msg );
         }
 
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         // We can allocate the SearchRequest
         Filter orFilter = new OrFilter( ldapMessageContainer.getTlvId() );
 
         // Set the filter
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( orFilter );
+        searchRequest.addCurrentFilter( orFilter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java Tue Jan 25 22:42:10 2011
@@ -25,9 +25,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -62,7 +62,7 @@ public class InitPresentFilterAction ext
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -70,8 +70,8 @@ public class InitPresentFilterAction ext
         PresentFilter presentFilter = new PresentFilter( ldapMessageContainer.getTlvId() );
 
         // add the filter to the request filter
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( presentFilter );
-        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( presentFilter );
+        searchRequest.addCurrentFilter( presentFilter );
+        searchRequest.setTerminalFilter( presentFilter );
 
         String value = Strings.utf8ToString(tlv.getValue().getData());
 
@@ -88,7 +88,7 @@ public class InitPresentFilterAction ext
 
         // We now have to get back to the nearest filter which is
         // not terminal.
-        ( ( SearchRequestImpl ) searchRequest ).unstackFilters( container );
+        searchRequest.unstackFilters( container );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java Tue Jan 25 22:42:10 2011
@@ -26,10 +26,10 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,7 +63,7 @@ public class InitSubstringsFilterAction 
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -79,8 +79,8 @@ public class InitSubstringsFilterAction 
         // We can allocate the SearchRequest
         Filter substringFilter = new SubstringFilter( ldapMessageContainer.getTlvId() );
 
-        ( ( SearchRequestImpl ) searchRequest ).addCurrentFilter( substringFilter );
-        ( ( SearchRequestImpl ) searchRequest ).setTerminalFilter( substringFilter );
+        searchRequest.addCurrentFilter( substringFilter );
+        searchRequest.setTerminalFilter( substringFilter );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java Tue Jan 25 22:42:10 2011
@@ -26,9 +26,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,13 +62,12 @@ public class StoreAnyAction extends Gram
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator decorator = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
         // Store the value.
-        SubstringFilter substringFilter = ( SubstringFilter ) ( ( SearchRequestImpl ) searchRequest )
-            .getTerminalFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) decorator.getTerminalFilter();
 
         if ( tlv.getLength() == 0 )
         {
@@ -83,7 +81,7 @@ public class StoreAnyAction extends Gram
 
         // We now have to get back to the nearest filter which is
         // not terminal.
-        ( ( SearchRequestImpl ) searchRequest ).unstackFilters( container );
+        decorator.unstackFilters( container );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java Tue Jan 25 22:42:10 2011
@@ -26,9 +26,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
+
 import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,13 +63,12 @@ public class StoreFinalAction extends Gr
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
         // Store the value.
-        SubstringFilter substringFilter = ( SubstringFilter ) ( ( SearchRequestImpl ) searchRequest )
-            .getTerminalFilter();
+        SubstringFilter substringFilter = ( SubstringFilter ) searchRequest.getTerminalFilter();
 
         if ( tlv.getLength() == 0 )
         {
@@ -83,7 +82,7 @@ public class StoreFinalAction extends Gr
 
         // We now have to get back to the nearest filter which is
         // not terminal.
-        ( ( SearchRequestImpl ) searchRequest ).unstackFilters( container );
+        searchRequest.unstackFilters( container );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java Tue Jan 25 22:42:10 2011
@@ -25,10 +25,9 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.model.entry.BinaryValue;
-import org.apache.directory.shared.ldap.model.message.SearchRequest;
-import org.apache.directory.shared.ldap.message.SearchRequestImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,19 +61,18 @@ public class StoreMatchValueAction exten
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator decorator = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
         // Store the value.
-        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) ( ( SearchRequestImpl ) searchRequest )
-            .getTerminalFilter();
+        ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) decorator.getTerminalFilter();
 
         byte[] value = tlv.getValue().getData();
         extensibleMatchFilter.setMatchValue( new BinaryValue( value ) );
 
         // unstack the filters if needed
-        ( ( SearchRequestImpl ) searchRequest ).unstackFilters( container );
+        decorator.unstackFilters( container );
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java Tue Jan 25 22:42:10 2011
@@ -26,6 +26,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.SearchRequestDecorator;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.model.message.SearchRequest;
 import org.apache.directory.shared.ldap.message.SearchRequestImpl;
@@ -64,7 +65,7 @@ public class StoreTypeMatchingRuleAction
     public void action( Asn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        SearchRequest searchRequest = ldapMessageContainer.getSearchRequest();
+        SearchRequestDecorator searchRequest = ldapMessageContainer.getSearchRequestDecorator();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -77,8 +78,7 @@ public class StoreTypeMatchingRuleAction
         else
         {
             // Store the value.
-            ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) ( ( SearchRequestImpl ) searchRequest )
-                .getTerminalFilter();
+            ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter ) searchRequest.getTerminalFilter();
 
             String type = Strings.utf8ToString(tlv.getValue().getData());
             extensibleMatchFilter.setType( type );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java?rev=1063497&r1=1063496&r2=1063497&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java Tue Jan 25 22:42:10 2011
@@ -22,7 +22,6 @@ package org.apache.directory.shared.ldap
 
 import java.util.Map;
 
-import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.ldap.model.exception.MessageException;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
@@ -65,7 +64,7 @@ public class MessageDecorator implements
     private int controlsLength;
 
 
-    public static MessageDecorator getDecorator( Message decoratedMessage ) throws EncoderException
+    public static MessageDecorator getDecorator( Message decoratedMessage )
     {
         switch ( decoratedMessage.getType() )
         {



Mime
View raw message