directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063609 [1/2] - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/codec/controls/ main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/ main/java/org/apache/directory/shared/ldap/codec/...
Date Wed, 26 Jan 2011 06:24:05 GMT
Author: akarasulu
Date: Wed Jan 26 06:24:04 2011
New Revision: 1063609

URL: http://svn.apache.org/viewvc?rev=1063609&view=rev
Log:
processed PersistentSearch and PagedResultsControl for decorator pattern

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java   (contents, props changed)
      - copied, changed from r1063594, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeGrammar.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeStates.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlStatesEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecoder.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsGrammar.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsStates.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlStatesEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearch.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecoder.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchGrammar.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchStates.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlStatesEnum.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlStatesEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlStatesEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlStatesEnum.java
Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecoder.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PSearchControlTest.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/PagedSearchControlTest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java Wed Jan 26 06:24:04 2011
@@ -108,6 +108,12 @@ public class ControlDecorator extends Ab
     }
 
 
+    public Control getDecorated()
+    {
+        return decorated;
+    }
+
+
     // ------------------------------------------------------------------------
     // Control Methods
     // ------------------------------------------------------------------------

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java Wed Jan 26 06:24:04 2011
@@ -26,8 +26,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControl;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChange;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResults;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearch;
 import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesControl;
 
 /**
@@ -41,9 +41,9 @@ public enum ControlEnum
     CASCADE_CONTROL( Cascade.OID ),
     ENTRY_CHANGE_CONTROL( EntryChange.OID ),
     MANAGE_DSA_IT_CONTROL( ManageDsaIT.OID ),
-    PAGED_RESULTS_CONTROL( PagedResultsControl.CONTROL_OID ),
+    PAGED_RESULTS_CONTROL( PagedResults.OID ),
     PASSWORD_POLICY_REQUEST_CONTROL( PasswordPolicyRequestControl.CONTROL_OID ),
-    PERSISTENT_SEARCH_CONTROL(PersistentSearchControl.CONTROL_OID),
+    PERSISTENT_SEARCH_CONTROL( PersistentSearch.CONTROL_OID),
     SUBENTRIES_CONTROL( SubentriesControl.CONTROL_OID ),
     SYNC_DONE_VALUE_CONTROL( SyncDoneValueControl.CONTROL_OID ),
     SYNC_INFO_VALUE_CONTROL( SyncInfoValueControl.CONTROL_OID ),

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java Wed Jan 26 06:24:04 2011
@@ -24,8 +24,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControl;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResults;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsDecorator;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearch;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchDecorator;
 import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesControl;
 import org.apache.directory.shared.ldap.model.message.Control;
 
@@ -44,8 +46,8 @@ public class ControlFactory
      * ControlImpl is returned. The following Controls are known:
      * <ul>
      * <li>ManageDsaITControlDecorator</li>
-     * <li>PagedResultsControl</li>
-     * <li>PersistentSearchControl</li>
+     * <li>PagedResultsDecorator</li>
+     * <li>PersistentSearchDecorator</li>
      * <li>SubentriesControl</li>
      * <li>SyncDoneValueControl</li>
      * <li>SyncInfoValueControl</li>
@@ -66,14 +68,14 @@ public class ControlFactory
             return new ManageDsaITDecorator();
         }
 
-        if ( PagedResultsControl.CONTROL_OID.equals( oid ) )
+        if ( PagedResults.OID.equals( oid ) )
         {
-            return new PagedResultsControl();
+            return new PagedResultsDecorator();
         }
 
-        if ( PersistentSearchControl.CONTROL_OID.equals( oid ) )
+        if ( PersistentSearch.CONTROL_OID.equals( oid ) )
         {
-            return new PersistentSearchControl();
+            return new PersistentSearchDecorator();
         }
 
         if ( SubentriesControl.CONTROL_OID.equals( oid ) )

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java (from r1063594, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlContainer.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlContainer.java&r1=1063594&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java Wed Jan 26 06:24:04 2011
@@ -26,22 +26,22 @@ import org.apache.directory.shared.asn1.
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EntryChangeControlContainer extends AbstractContainer
+public class EntryChangeContainer extends AbstractContainer
 {
     /** EntryChangeControl */
     private EntryChangeDecorator control;
 
 
     /**
-     * Creates a new EntryChangeControlContainer object. We will store one
+     * Creates a new EntryChangeContainer object. We will store one
      * grammar, it's enough ...
      */
-    public EntryChangeControlContainer()
+    public EntryChangeContainer()
     {
         super();
         stateStack = new int[1];
-        grammar = EntryChangeControlGrammar.getInstance();
-        setTransition( EntryChangeControlStatesEnum.START_STATE );
+        grammar = EntryChangeGrammar.getInstance();
+        setTransition( EntryChangeStates.START_STATE );
     }
 
 

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecoder.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecoder.java Wed Jan 26 06:24:04 2011
@@ -53,7 +53,7 @@ public class EntryChangeDecoder extends 
     public Asn1Object decode( byte[] controlBytes, Control control ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( (EntryChangeDecorator )control );
         decoder.decode( bb, container );
         return container.getEntryChangeControl();

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeGrammar.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlGrammar.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeGrammar.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeGrammar.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlGrammar.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeGrammar.java Wed Jan 26 06:24:04 2011
@@ -43,27 +43,27 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class EntryChangeControlGrammar extends AbstractGrammar
+public final class EntryChangeGrammar extends AbstractGrammar
 {
     /** The logger */
-    static final Logger LOG = LoggerFactory.getLogger( EntryChangeControlGrammar.class );
+    static final Logger LOG = LoggerFactory.getLogger( EntryChangeGrammar.class );
 
     /** Speedup for logs */
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
-    /** The instance of grammar. EntryChangeControlGrammar is a singleton */
-    private static Grammar instance = new EntryChangeControlGrammar();
+    /** The instance of grammar. EntryChangeGrammar is a singleton */
+    private static Grammar instance = new EntryChangeGrammar();
 
 
     /**
-     * Creates a new EntryChangeControlGrammar object.
+     * Creates a new EntryChangeGrammar object.
      */
-    private EntryChangeControlGrammar()
+    private EntryChangeGrammar()
     {
-        setName( EntryChangeControlGrammar.class.getName() );
+        setName( EntryChangeGrammar.class.getName() );
 
         // Create the transitions table
-        super.transitions = new GrammarTransition[EntryChangeControlStatesEnum.LAST_EC_STATE.ordinal()][256];
+        super.transitions = new GrammarTransition[ EntryChangeStates.LAST_EC_STATE.ordinal()][256];
 
         // ============================================================================================
         // Transition from start state to Entry Change sequence
@@ -72,9 +72,9 @@ public final class EntryChangeControlGra
         //     ...
         //
         // Initialization of the structure
-        super.transitions[EntryChangeControlStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = 
-            new GrammarTransition( EntryChangeControlStatesEnum.START_STATE, 
-                                    EntryChangeControlStatesEnum.EC_SEQUENCE_STATE, 
+        super.transitions[ EntryChangeStates.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition( EntryChangeStates.START_STATE,
+                                    EntryChangeStates.EC_SEQUENCE_STATE,
                                     UniversalTag.SEQUENCE.getValue(), null );
 
         // ============================================================================================
@@ -85,15 +85,15 @@ public final class EntryChangeControlGra
         //     ...
         //
         // Evaluates the changeType
-        super.transitions[EntryChangeControlStatesEnum.EC_SEQUENCE_STATE.ordinal()][UniversalTag.ENUMERATED.getValue()] = 
-            new GrammarTransition( EntryChangeControlStatesEnum.EC_SEQUENCE_STATE,
-                                    EntryChangeControlStatesEnum.CHANGE_TYPE_STATE, 
+        super.transitions[ EntryChangeStates.EC_SEQUENCE_STATE.ordinal()][UniversalTag.ENUMERATED.getValue()] =
+            new GrammarTransition( EntryChangeStates.EC_SEQUENCE_STATE,
+                                    EntryChangeStates.CHANGE_TYPE_STATE,
                                     UniversalTag.ENUMERATED.getValue(),
             new GrammarAction( "Set EntryChangeControl changeType" )
         {
             public void action( Asn1Container container ) throws DecoderException
             {
-                EntryChangeControlContainer entryChangeContainer = ( EntryChangeControlContainer ) container;
+                EntryChangeContainer entryChangeContainer = ( EntryChangeContainer ) container;
                 Value value = entryChangeContainer.getCurrentTLV().getValue();
 
                 try
@@ -148,15 +148,15 @@ public final class EntryChangeControlGra
         //
         // Set the previousDN into the structure. We first check that it's a
         // valid Dn
-        super.transitions[EntryChangeControlStatesEnum.CHANGE_TYPE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = 
-            new GrammarTransition( EntryChangeControlStatesEnum.CHANGE_TYPE_STATE, 
-                                    EntryChangeControlStatesEnum.PREVIOUS_DN_STATE,
+        super.transitions[ EntryChangeStates.CHANGE_TYPE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
+            new GrammarTransition( EntryChangeStates.CHANGE_TYPE_STATE,
+                                    EntryChangeStates.PREVIOUS_DN_STATE,
                                     UniversalTag.OCTET_STRING.getValue(),
             new GrammarAction( "Set EntryChangeControl previousDN" )
         {
             public void action( Asn1Container container ) throws DecoderException
             {
-                EntryChangeControlContainer entryChangeContainer = ( EntryChangeControlContainer ) container;
+                EntryChangeContainer entryChangeContainer = ( EntryChangeContainer ) container;
 
                 ChangeType changeType = entryChangeContainer.getEntryChangeControl().getChangeType();
 
@@ -198,7 +198,7 @@ public final class EntryChangeControlGra
         {
             public void action( Asn1Container container ) throws DecoderException
             {
-                EntryChangeControlContainer entryChangeContainer = ( EntryChangeControlContainer ) container;
+                EntryChangeContainer entryChangeContainer = ( EntryChangeContainer ) container;
                 Value value = entryChangeContainer.getCurrentTLV().getValue();
 
                 try
@@ -233,9 +233,9 @@ public final class EntryChangeControlGra
         // }
         //
         // Set the changeNumber into the structure
-        super.transitions[EntryChangeControlStatesEnum.PREVIOUS_DN_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = 
-            new GrammarTransition( EntryChangeControlStatesEnum.PREVIOUS_DN_STATE, 
-                                    EntryChangeControlStatesEnum.CHANGE_NUMBER_STATE, 
+        super.transitions[ EntryChangeStates.PREVIOUS_DN_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition( EntryChangeStates.PREVIOUS_DN_STATE,
+                                    EntryChangeStates.CHANGE_NUMBER_STATE,
                                     UniversalTag.INTEGER.getValue(),
                 setChangeNumberAction );
 
@@ -248,9 +248,9 @@ public final class EntryChangeControlGra
         // }
         //
         // Set the changeNumber into the structure
-        super.transitions[EntryChangeControlStatesEnum.CHANGE_TYPE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = 
-            new GrammarTransition( EntryChangeControlStatesEnum.CHANGE_TYPE_STATE, 
-                                    EntryChangeControlStatesEnum.CHANGE_NUMBER_STATE, 
+        super.transitions[ EntryChangeStates.CHANGE_TYPE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition( EntryChangeStates.CHANGE_TYPE_STATE,
+                                    EntryChangeStates.CHANGE_NUMBER_STATE,
                                     UniversalTag.INTEGER.getValue(),
                 setChangeNumberAction );
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeGrammar.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeStates.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlStatesEnum.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeStates.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeStates.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlStatesEnum.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeControlStatesEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeStates.java Wed Jan 26 06:24:04 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.asn1.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum EntryChangeControlStatesEnum implements States
+public enum EntryChangeStates implements States
 {
     // ~ Static fields/initializers
     // -----------------------------------------------------------------
@@ -80,7 +80,7 @@ public enum EntryChangeControlStatesEnum
      */
     public String getGrammarName( Grammar grammar )
     {
-        if ( grammar instanceof EntryChangeControlGrammar )
+        if ( grammar instanceof EntryChangeGrammar )
         {
             return "EC_GRAMMAR";
         }
@@ -113,7 +113,7 @@ public enum EntryChangeControlStatesEnum
     /**
      * {@inheritDoc}
      */
-    public EntryChangeControlStatesEnum getStartState()
+    public EntryChangeStates getStartState()
     {
         return START_STATE;
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeStates.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java Wed Jan 26 06:24:04 2011
@@ -20,18 +20,12 @@
 package org.apache.directory.shared.ldap.codec.search.controls.pagedSearch;
 
 
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
-import org.apache.directory.shared.asn1.ber.tlv.Value;
-import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.codec.controls.AbstractControl;
+import org.apache.directory.shared.ldap.codec.controls.BasicControlImpl;
 import org.apache.directory.shared.util.StringConstants;
 import org.apache.directory.shared.util.Strings;
 
+import java.util.Arrays;
+
 
 /**
  * A request/response control used to implement a simple paging of search
@@ -64,10 +58,10 @@ import org.apache.directory.shared.util.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PagedResultsControl extends AbstractControl
+public class PagedResults extends BasicControlImpl
 {
     /** The Paged Search Control OID */
-    public static final String CONTROL_OID = "1.2.840.113556.1.4.319";
+    public static final String OID = "1.2.840.113556.1.4.319";
 
     /** The number of entries to return, or returned */
     private int size;
@@ -75,120 +69,17 @@ public class PagedResultsControl extends
     /** The exchanged cookie */
     private byte[] cookie;
 
-    /** The entry change global length */
-    private int pscSeqLength;
-
 
     /**
-     * 
-     * Creates a new instance of PagedResultsControl.
+     *
+     * Creates a new instance of PagedResultsDecorator.
      *
      */
-    public PagedResultsControl()
+    public PagedResults()
     {
-        super( CONTROL_OID );
+        super( OID );
 
         cookie = StringConstants.EMPTY_BYTES;
-        decoder = new PagedResultsControlDecoder();
-    }
-
-
-    /**
-     * Compute the PagedSearchControl length, which is the sum
-     * of the control length and the value length.
-     * 
-     * <pre>
-     * PagedSearchControl value length :
-     * 
-     * 0x30 L1 
-     *   | 
-     *   +--> 0x02 0x0(1-4) [0..2^63-1] (size) 
-     *   +--> 0x04 L2 (cookie)
-     * </pre> 
-     */
-    public int computeLength()
-    {
-        int sizeLength = 1 + 1 + Value.getNbBytes( size );
-
-        int cookieLength = 0;
-
-        if ( cookie != null )
-        {
-            cookieLength = 1 + TLV.getNbBytes( cookie.length ) + cookie.length;
-        }
-        else
-        {
-            cookieLength = 1 + 1;
-        }
-
-        pscSeqLength = sizeLength + cookieLength;
-        valueLength = 1 + TLV.getNbBytes( pscSeqLength ) + pscSeqLength;
-
-        // Call the super class to compute the global control length
-        return super.computeLength( valueLength );
-    }
-
-
-    /**
-     * Encodes the paged search control.
-     * 
-     * @param buffer The encoded sink
-     * @return A ByteBuffer that contains the encoded PDU
-     * @throws EncoderException If anything goes wrong.
-     */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
-    {
-        if ( buffer == null )
-        {
-            throw new EncoderException( I18n.err( I18n.ERR_04023 ) );
-        }
-
-        // Encode the Control envelop
-        super.encode( buffer );
-
-        // Encode the OCTET_STRING tag
-        buffer.put( UniversalTag.OCTET_STRING.getValue() );
-        buffer.put( TLV.getBytes( valueLength ) );
-
-        // Now encode the PagedSearch specific part
-        buffer.put( UniversalTag.SEQUENCE.getValue() );
-        buffer.put( TLV.getBytes( pscSeqLength ) );
-
-        Value.encode( buffer, size );
-        Value.encode( buffer, cookie );
-
-        return buffer;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public byte[] getValue()
-    {
-        if ( value == null )
-        {
-            try
-            {
-                computeLength();
-                ByteBuffer buffer = ByteBuffer.allocate( valueLength );
-
-                // Now encode the PagedSearch specific part
-                buffer.put( UniversalTag.SEQUENCE.getValue() );
-                buffer.put( TLV.getBytes( pscSeqLength ) );
-
-                Value.encode( buffer, size );
-                Value.encode( buffer, cookie );
-
-                value = buffer.array();
-            }
-            catch ( Exception e )
-            {
-                return null;
-            }
-        }
-
-        return value;
     }
 
 
@@ -274,7 +165,7 @@ public class PagedResultsControl extends
             return false;
         }
 
-        PagedResultsControl otherControl = ( PagedResultsControl ) o;
+        PagedResults otherControl = ( PagedResults ) o;
 
         return ( size == otherControl.size ) && Arrays.equals( cookie, otherControl.cookie );
     }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlContainer.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlContainer.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java Wed Jan 26 06:24:04 2011
@@ -28,29 +28,29 @@ import org.apache.directory.shared.asn1.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PagedResultsControlContainer extends AbstractContainer
+public class PagedResultsContainer extends AbstractContainer
 {
     /** PagedSearchControl */
-    private PagedResultsControl control;
+    private PagedResultsDecorator control;
 
 
     /**
      * Creates a new PagedSearchControl container object. We will store one grammar,
      * it's enough ...
      */
-    public PagedResultsControlContainer()
+    public PagedResultsContainer()
     {
         super();
         stateStack = new int[1];
-        grammar = PagedResultsControlGrammar.getInstance();
-        setTransition( PagedResultsControlStatesEnum.START_STATE );
+        grammar = PagedResultsGrammar.getInstance();
+        setTransition( PagedResultsStates.START_STATE );
     }
 
 
     /**
      * @return Returns the paged search control.
      */
-    public PagedResultsControl getPagedSearchControl()
+    public PagedResultsDecorator getPagedSearchControl()
     {
 
         return control;
@@ -63,7 +63,7 @@ public class PagedResultsControlContaine
      * 
      * @param control the PagedSearchControl to set.
      */
-    public void setPagedSearchControl( PagedResultsControl control )
+    public void setPagedSearchControl( PagedResultsDecorator control )
     {
         this.control = control;
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecoder.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecoder.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecoder.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlDecoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecoder.java Wed Jan 26 06:24:04 2011
@@ -34,7 +34,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PagedResultsControlDecoder extends Asn1Decoder implements ControlDecoder
+public class PagedResultsDecoder extends Asn1Decoder implements ControlDecoder
 {
     /** An instance of this decoder */
     private static final Asn1Decoder decoder = new Asn1Decoder();
@@ -52,8 +52,8 @@ public class PagedResultsControlDecoder 
     public Asn1Object decode( byte[] controlBytes, Control control ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        PagedResultsControlContainer container = new PagedResultsControlContainer();
-        container.setPagedSearchControl( (PagedResultsControl)control );
+        PagedResultsContainer container = new PagedResultsContainer();
+        container.setPagedSearchControl( (PagedResultsDecorator )control );
         decoder.decode( bb, container );
         return container.getPagedSearchControl();
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecoder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java Wed Jan 26 06:24:04 2011
@@ -28,46 +28,18 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.codec.controls.AbstractControl;
+import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.util.StringConstants;
 import org.apache.directory.shared.util.Strings;
 
 
 /**
- * A request/response control used to implement a simple paging of search
- * results. This is an implementation of RFC 2696 :
- * <a href="http://www.faqs.org/rfcs/rfc2696.html">LDAP Control Extension for Simple Paged Results Manipulation</a>
- * <br/>
- * <pre>
- *    This control is included in the searchRequest and searchResultDone
- *    messages as part of the controls field of the LDAPMessage, as defined
- *    in Section 4.1.12 of [LDAPv3]. The structure of this control is as
- *    follows:
- *
- * pagedResultsControl ::= SEQUENCE {
- *         controlType     1.2.840.113556.1.4.319,
- *         criticality     BOOLEAN DEFAULT FALSE,
- *         controlValue    searchControlValue
- * }
- * 
- * The searchControlValue is an OCTET STRING wrapping the BER-encoded
- * version of the following SEQUENCE:
- * 
- * realSearchControlValue ::= SEQUENCE {
- *         size            INTEGER (0..maxInt),
- *                                 -- requested page size from client
- *                                 -- result set size estimate from server
- *         cookie          OCTET STRING
- * }
- * 
- * </pre>
+ * A codec decorator for the {@link PagedResults}.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PagedResultsControl extends AbstractControl
+public class PagedResultsDecorator extends ControlDecorator
 {
-    /** The Paged Search Control OID */
-    public static final String CONTROL_OID = "1.2.840.113556.1.4.319";
 
     /** The number of entries to return, or returned */
     private int size;
@@ -81,15 +53,13 @@ public class PagedResultsControl extends
 
     /**
      * 
-     * Creates a new instance of PagedResultsControl.
+     * Creates a new instance of PagedResultsDecorator.
      *
      */
-    public PagedResultsControl()
+    public PagedResultsDecorator()
     {
-        super( CONTROL_OID );
-
+        super( new PagedResults(), new PagedResultsDecoder() );
         cookie = StringConstants.EMPTY_BYTES;
-        decoder = new PagedResultsControlDecoder();
     }
 
 
@@ -110,7 +80,7 @@ public class PagedResultsControl extends
     {
         int sizeLength = 1 + 1 + Value.getNbBytes( size );
 
-        int cookieLength = 0;
+        int cookieLength;
 
         if ( cookie != null )
         {
@@ -166,7 +136,7 @@ public class PagedResultsControl extends
      */
     public byte[] getValue()
     {
-        if ( value == null )
+        if ( getDecorated().getValue() == null )
         {
             try
             {
@@ -180,7 +150,7 @@ public class PagedResultsControl extends
                 Value.encode( buffer, size );
                 Value.encode( buffer, cookie );
 
-                value = buffer.array();
+                getDecorated().setValue( buffer.array() );
             }
             catch ( Exception e )
             {
@@ -188,7 +158,7 @@ public class PagedResultsControl extends
             }
         }
 
-        return value;
+        return getDecorated().getValue();
     }
 
 
@@ -267,6 +237,8 @@ public class PagedResultsControl extends
     /**
      * @see Object#equals(Object)
      */
+    @SuppressWarnings( { "EqualsWhichDoesntCheckParameterClass" } )
+    @Override
     public boolean equals( Object o )
     {
         if ( !super.equals( o ) )
@@ -274,7 +246,7 @@ public class PagedResultsControl extends
             return false;
         }
 
-        PagedResultsControl otherControl = ( PagedResultsControl ) o;
+        PagedResultsDecorator otherControl = ( PagedResultsDecorator ) o;
 
         return ( size == otherControl.size ) && Arrays.equals( cookie, otherControl.cookie );
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsGrammar.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlGrammar.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsGrammar.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsGrammar.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlGrammar.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsGrammar.java Wed Jan 26 06:24:04 2011
@@ -49,27 +49,27 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class PagedResultsControlGrammar extends AbstractGrammar
+public final class PagedResultsGrammar extends AbstractGrammar
 {
     /** The logger */
-    static final Logger LOG = LoggerFactory.getLogger( PagedResultsControlGrammar.class );
+    static final Logger LOG = LoggerFactory.getLogger( PagedResultsGrammar.class );
 
     /** Speedup for logs */
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. PagedSearchControlGrammar is a singleton */
-    private static Grammar instance = new PagedResultsControlGrammar();
+    private static Grammar instance = new PagedResultsGrammar();
 
 
     /**
      * Creates a new PagedSearchControlGrammar object.
      */
-    private PagedResultsControlGrammar()
+    private PagedResultsGrammar()
     {
-        setName( PagedResultsControlGrammar.class.getName() );
+        setName( PagedResultsGrammar.class.getName() );
 
         // Create the transitions table
-        super.transitions = new GrammarTransition[PagedResultsControlStatesEnum.LAST_PAGED_SEARCH_STATE.ordinal()][256];
+        super.transitions = new GrammarTransition[ PagedResultsStates.LAST_PAGED_SEARCH_STATE.ordinal()][256];
 
         /** 
          * Transition from initial state to PagedSearch sequence
@@ -78,9 +78,9 @@ public final class PagedResultsControlGr
          *     
          * Nothing to do
          */
-        super.transitions[PagedResultsControlStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = 
-            new GrammarTransition( PagedResultsControlStatesEnum.START_STATE, 
-                                    PagedResultsControlStatesEnum.PAGED_SEARCH_SEQUENCE_STATE, 
+        super.transitions[ PagedResultsStates.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition( PagedResultsStates.START_STATE,
+                                    PagedResultsStates.PAGED_SEARCH_SEQUENCE_STATE,
                                     UniversalTag.SEQUENCE.getValue(), null );
 
 
@@ -93,15 +93,15 @@ public final class PagedResultsControlGr
          *     
          * Stores the size value
          */
-        super.transitions[PagedResultsControlStatesEnum.PAGED_SEARCH_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = 
-            new GrammarTransition( PagedResultsControlStatesEnum.PAGED_SEARCH_SEQUENCE_STATE, 
-                PagedResultsControlStatesEnum.SIZE_STATE, 
+        super.transitions[ PagedResultsStates.PAGED_SEARCH_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition( PagedResultsStates.PAGED_SEARCH_SEQUENCE_STATE,
+                PagedResultsStates.SIZE_STATE,
                 UniversalTag.INTEGER.getValue(),
                 new GrammarAction( "Set PagedSearchControl size" )
             {
                 public void action( Asn1Container container ) throws DecoderException
                 {
-                    PagedResultsControlContainer pagedSearchContainer = ( PagedResultsControlContainer ) container;
+                    PagedResultsContainer pagedSearchContainer = ( PagedResultsContainer ) container;
                     Value value = pagedSearchContainer.getCurrentTLV().getValue();
 
                     try
@@ -141,14 +141,14 @@ public final class PagedResultsControlGr
          *     
          * Stores the cookie flag
          */
-        super.transitions[PagedResultsControlStatesEnum.SIZE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = 
-            new GrammarTransition( PagedResultsControlStatesEnum.SIZE_STATE,
-                                    PagedResultsControlStatesEnum.COOKIE_STATE, UniversalTag.OCTET_STRING.getValue(),
+        super.transitions[ PagedResultsStates.SIZE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
+            new GrammarTransition( PagedResultsStates.SIZE_STATE,
+                                    PagedResultsStates.COOKIE_STATE, UniversalTag.OCTET_STRING.getValue(),
                 new GrammarAction( "Set PagedSearchControl cookie" )
             {
                 public void action( Asn1Container container ) throws DecoderException
                 {
-                    PagedResultsControlContainer pagedSearchContainer = ( PagedResultsControlContainer ) container;
+                    PagedResultsContainer pagedSearchContainer = ( PagedResultsContainer ) container;
                     Value value = pagedSearchContainer.getCurrentTLV().getValue();
 
                     if ( pagedSearchContainer.getCurrentTLV().getLength() == 0 )

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsGrammar.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsStates.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlStatesEnum.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsStates.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsStates.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlStatesEnum.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsControlStatesEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsStates.java Wed Jan 26 06:24:04 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.asn1.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum PagedResultsControlStatesEnum implements States
+public enum PagedResultsStates implements States
 {
     // ~ Static fields/initializers
     // -----------------------------------------------------------------
@@ -77,7 +77,7 @@ public enum PagedResultsControlStatesEnu
      */
     public String getGrammarName( Grammar grammar )
     {
-        if ( grammar instanceof PagedResultsControlGrammar )
+        if ( grammar instanceof PagedResultsGrammar )
         {
             return "PAGEDSEARCH_GRAMMAR";
         }
@@ -110,7 +110,7 @@ public enum PagedResultsControlStatesEnu
     /**
      * {@inheritDoc}
      */
-    public PagedResultsControlStatesEnum getStartState()
+    public PagedResultsStates getStartState()
     {
         return START_STATE;
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsStates.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearch.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearch.java?rev=1063609&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearch.java (added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearch.java Wed Jan 26 06:24:04 2011
@@ -0,0 +1,151 @@
+/*
+ *  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.ldap.codec.search.controls.persistentSearch;
+
+
+import org.apache.directory.shared.ldap.codec.controls.BasicControlImpl;
+import org.apache.directory.shared.ldap.codec.search.controls.ChangeType;
+
+
+/**
+ * A persistence search object
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class PersistentSearch extends BasicControlImpl
+{
+    /** This control OID */
+    public static final String CONTROL_OID = "2.16.840.1.113730.3.4.3";
+
+    /** Definition of the change types */
+    public static final int CHANGE_TYPE_ADD     = 1;
+
+    public static final int CHANGE_TYPE_DELETE  = 2;
+
+    public static final int CHANGE_TYPE_MODIFY  = 4;
+
+    public static final int CHANGE_TYPE_MODDN   = 8;
+
+    /** Min and Max values for the possible combined change types */
+    public static final int CHANGE_TYPES_MIN = CHANGE_TYPE_ADD;
+
+    public static final int CHANGE_TYPES_MAX = CHANGE_TYPE_ADD | CHANGE_TYPE_DELETE | CHANGE_TYPE_MODIFY | CHANGE_TYPE_MODDN;
+
+    /**
+     * If changesOnly is TRUE, the server MUST NOT return any existing entries
+     * that match the search criteria. Entries are only returned when they are
+     * changed (added, modified, deleted, or subject to a modifyDN operation).
+     */
+    private boolean changesOnly = true;
+
+    /**
+     * If returnECs is TRUE, the server MUST return an Entry Change Notification
+     * control with each entry returned as the result of changes.
+     */
+    private boolean returnECs = false;
+
+    /**
+     * As changes are made to the server, the effected entries MUST be returned
+     * to the client if they match the standard search criteria and if the
+     * operation that caused the change is included in the changeTypes field.
+     * The changeTypes field is the logical OR of one or more of these values:
+     * add    (1),
+     * delete (2),
+     * modify (4),
+     * modDN  (8).
+     */
+    private int changeTypes = CHANGE_TYPES_MAX;
+
+
+    /**
+     * Default constructor
+     *
+     */
+    public PersistentSearch()
+    {
+        super( "" );
+    }
+
+
+    public void setChangesOnly( boolean changesOnly )
+    {
+        this.changesOnly = changesOnly;
+    }
+
+
+    public boolean isChangesOnly()
+    {
+        return changesOnly;
+    }
+
+
+    public void setReturnECs( boolean returnECs )
+    {
+        this.returnECs = returnECs;
+    }
+
+
+    public boolean isReturnECs()
+    {
+        return returnECs;
+    }
+
+
+    public void setChangeTypes( int changeTypes )
+    {
+        this.changeTypes = changeTypes;
+    }
+
+
+    public int getChangeTypes()
+    {
+        return changeTypes;
+    }
+
+
+    public boolean isNotificationEnabled( ChangeType changeType )
+    {
+        return ( changeType.getValue() & changeTypes ) > 0;
+    }
+
+
+    public void enableNotification( ChangeType changeType )
+    {
+        changeTypes |= changeType.getValue();
+    }
+
+
+    /**
+     * Return a String representing this PSearchControl.
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "    Persistant Search Control\n" );
+        sb.append( "        oid : " ).append( getOid() ).append( '\n' );
+        sb.append( "        critical : " ).append( isCritical() ).append( '\n' );
+        sb.append( "        changeTypes : '" ).append( changeTypes ).append( "'\n" );
+        sb.append( "        changesOnly : '" ).append( changesOnly ).append( "'\n" );
+        sb.append( "        returnECs   : '" ).append( returnECs ).append( "'\n" );
+
+        return sb.toString();
+    }
+}

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlContainer.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlContainer.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java Wed Jan 26 06:24:04 2011
@@ -26,32 +26,32 @@ import org.apache.directory.shared.asn1.
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PersistentSearchControlContainer extends AbstractContainer
+public class PersistentSearchContainer extends AbstractContainer
 {
     /** PSearchControl */
-    private PersistentSearchControl control;
+    private PersistentSearchDecorator decorator;
 
 
     /**
      * Creates a new PSearchControlContainer object. We will store one grammar,
      * it's enough ...
      */
-    public PersistentSearchControlContainer()
+    public PersistentSearchContainer()
     {
         super();
         stateStack = new int[1];
-        grammar = PersistentSearchControlGrammar.getInstance();
-        setTransition( PersistentSearchControlStatesEnum.START_STATE );
+        grammar = PersistentSearchGrammar.getInstance();
+        setTransition( PersistentSearchStates.START_STATE );
     }
 
 
     /**
-     * @return Returns the persistent search control.
+     * @return Returns the persistent search decorator.
      */
-    public PersistentSearchControl getPSearchControl()
+    public PersistentSearchDecorator getPSearchControl()
     {
 
-        return control;
+        return decorator;
     }
 
 
@@ -59,11 +59,11 @@ public class PersistentSearchControlCont
      * Set a PSearchControl Object into the container. It will be completed by
      * the ldapDecoder.
      * 
-     * @param control the PSearchControl to set.
+     * @param decorator the PSearchControl to set.
      */
-    public void setPSearchControl( PersistentSearchControl control )
+    public void setPSearchControl( PersistentSearchDecorator decorator )
     {
-        this.control = control;
+        this.decorator = decorator;
     }
 
     /**
@@ -72,6 +72,6 @@ public class PersistentSearchControlCont
     public void clean()
     {
         super.clean();
-        control = null;
+        decorator = null;
     }
 }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecoder.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecoder.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecoder.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlDecoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecoder.java Wed Jan 26 06:24:04 2011
@@ -34,7 +34,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PersistentSearchControlDecoder extends Asn1Decoder implements ControlDecoder
+public class PersistentSearchDecoder extends Asn1Decoder implements ControlDecoder
 {
     /** An instance of this decoder */
     private static final Asn1Decoder decoder = new Asn1Decoder();
@@ -52,8 +52,8 @@ public class PersistentSearchControlDeco
     public Asn1Object decode( byte[] controlBytes, Control control ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        PersistentSearchControlContainer container = new PersistentSearchControlContainer();
-        container.setPSearchControl( (PersistentSearchControl)control );
+        PersistentSearchContainer container = new PersistentSearchContainer();
+        container.setPSearchControl( (PersistentSearchDecorator )control );
 
         decoder.decode( bb, container );
         return container.getPSearchControl();

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecoder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControl.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java Wed Jan 26 06:24:04 2011
@@ -27,7 +27,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.codec.controls.AbstractControl;
+import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.codec.search.controls.ChangeType;
 
 
@@ -36,10 +36,8 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PersistentSearchControl extends AbstractControl
+public class PersistentSearchDecorator extends ControlDecorator
 {
-    /** This control OID */
-    public static final String CONTROL_OID = "2.16.840.1.113730.3.4.3";
 
     /**
      * If changesOnly is TRUE, the server MUST NOT return any existing entries
@@ -64,17 +62,7 @@ public class PersistentSearchControl ext
      * modify (4), 
      * modDN  (8).
      */
-    private int changeTypes = CHANGE_TYPES_MAX;
-    
-    /** Definition of the change types */
-    public static final int CHANGE_TYPE_ADD     = 1;
-    public static final int CHANGE_TYPE_DELETE  = 2;
-    public static final int CHANGE_TYPE_MODIFY  = 4;
-    public static final int CHANGE_TYPE_MODDN   = 8;
-    
-    /** Min and Max values for the possible combined change types */
-    public static final int CHANGE_TYPES_MIN = CHANGE_TYPE_ADD;
-    public static final int CHANGE_TYPES_MAX = CHANGE_TYPE_ADD | CHANGE_TYPE_DELETE | CHANGE_TYPE_MODIFY | CHANGE_TYPE_MODDN;
+    private int changeTypes = PersistentSearch.CHANGE_TYPES_MAX;
 
     /** A temporary storage for a psearch length */
     private int psearchSeqLength;
@@ -83,13 +71,12 @@ public class PersistentSearchControl ext
      * Default constructor
      *
      */
-    public PersistentSearchControl()
+    public PersistentSearchDecorator()
     {
-        super( CONTROL_OID );
-        
-        decoder = new PersistentSearchControlDecoder();
+        super( new PersistentSearch(), new PersistentSearchDecoder() );
     }
 
+
     public void setChangesOnly( boolean changesOnly )
     {
         this.changesOnly = changesOnly;
@@ -125,12 +112,13 @@ public class PersistentSearchControl ext
         return changeTypes;
     }
 
+
     /**
      * Compute the PagedSearchControl length, which is the sum
      * of the control length and the value length.
      * 
      * <pre>
-     * PersistentSearchControl value length :
+     * PersistentSearchDecorator value length :
      * 
      * 0x30 L1 
      *   | 
@@ -191,7 +179,7 @@ public class PersistentSearchControl ext
      */
     public byte[] getValue()
     {
-        if ( value == null )
+        if ( getDecorated().getValue() == null )
         {
             try
             { 
@@ -206,7 +194,7 @@ public class PersistentSearchControl ext
                 Value.encode( buffer, changesOnly );
                 Value.encode( buffer, returnECs );
                 
-                value = buffer.array();
+                getDecorated().setValue( buffer.array() );
             }
             catch ( Exception e )
             {
@@ -214,7 +202,7 @@ public class PersistentSearchControl ext
             }
         }
         
-        return value;
+        return getDecorated().getValue();
     }
 
     

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchGrammar.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlGrammar.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchGrammar.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchGrammar.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlGrammar.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchGrammar.java Wed Jan 26 06:24:04 2011
@@ -53,27 +53,27 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class PersistentSearchControlGrammar extends AbstractGrammar
+public final class PersistentSearchGrammar extends AbstractGrammar
 {
     /** The logger */
-    static final Logger LOG = LoggerFactory.getLogger( PersistentSearchControlGrammar.class );
+    static final Logger LOG = LoggerFactory.getLogger( PersistentSearchGrammar.class );
 
     /** Speedup for logs */
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. PSearchControlGrammar is a singleton */
-    private static Grammar instance = new PersistentSearchControlGrammar();
+    private static Grammar instance = new PersistentSearchGrammar();
 
 
     /**
      * Creates a new PSearchControlGrammar object.
      */
-    private PersistentSearchControlGrammar()
+    private PersistentSearchGrammar()
     {
-        setName( PersistentSearchControlGrammar.class.getName() );
+        setName( PersistentSearchGrammar.class.getName() );
 
         // Create the transitions table
-        super.transitions = new GrammarTransition[PersistentSearchControlStatesEnum.LAST_PSEARCH_STATE.ordinal()][256];
+        super.transitions = new GrammarTransition[ PersistentSearchStates.LAST_PSEARCH_STATE.ordinal()][256];
 
         /** 
          * Transition from initial state to Psearch sequence
@@ -82,9 +82,9 @@ public final class PersistentSearchContr
          *     
          * Initialize the persistence search object
          */
-        super.transitions[PersistentSearchControlStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = 
-            new GrammarTransition( PersistentSearchControlStatesEnum.START_STATE, 
-                                    PersistentSearchControlStatesEnum.PSEARCH_SEQUENCE_STATE, 
+        super.transitions[ PersistentSearchStates.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition( PersistentSearchStates.START_STATE,
+                                    PersistentSearchStates.PSEARCH_SEQUENCE_STATE,
                                     UniversalTag.SEQUENCE.getValue(), null );
 
 
@@ -96,23 +96,23 @@ public final class PersistentSearchContr
          *     
          * Stores the change types value
          */
-        super.transitions[PersistentSearchControlStatesEnum.PSEARCH_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = 
-            new GrammarTransition( PersistentSearchControlStatesEnum.PSEARCH_SEQUENCE_STATE, 
-                PersistentSearchControlStatesEnum.CHANGE_TYPES_STATE, 
+        super.transitions[ PersistentSearchStates.PSEARCH_SEQUENCE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition( PersistentSearchStates.PSEARCH_SEQUENCE_STATE,
+                PersistentSearchStates.CHANGE_TYPES_STATE,
                 UniversalTag.INTEGER.getValue(),
                 new GrammarAction( "Set PSearchControl changeTypes" )
             {
                 public void action( Asn1Container container ) throws DecoderException
                 {
-                    PersistentSearchControlContainer psearchContainer = ( PersistentSearchControlContainer ) container;
+                    PersistentSearchContainer psearchContainer = ( PersistentSearchContainer ) container;
                     Value value = psearchContainer.getCurrentTLV().getValue();
 
                     try
                     {
                         // Check that the value is into the allowed interval
                         int changeTypes = IntegerDecoder.parse( value, 
-                            PersistentSearchControl.CHANGE_TYPES_MIN, 
-                            PersistentSearchControl.CHANGE_TYPES_MAX );
+                            PersistentSearch.CHANGE_TYPES_MIN,
+                            PersistentSearch.CHANGE_TYPES_MAX );
                         
                         if ( IS_DEBUG )
                         {
@@ -139,14 +139,14 @@ public final class PersistentSearchContr
          *     
          * Stores the change only flag
          */
-        super.transitions[PersistentSearchControlStatesEnum.CHANGE_TYPES_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = 
-            new GrammarTransition( PersistentSearchControlStatesEnum.CHANGE_TYPES_STATE,
-                                    PersistentSearchControlStatesEnum.CHANGES_ONLY_STATE, UniversalTag.BOOLEAN.getValue(),
+        super.transitions[ PersistentSearchStates.CHANGE_TYPES_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
+            new GrammarTransition( PersistentSearchStates.CHANGE_TYPES_STATE,
+                                    PersistentSearchStates.CHANGES_ONLY_STATE, UniversalTag.BOOLEAN.getValue(),
                 new GrammarAction( "Set PSearchControl changesOnly" )
             {
                 public void action( Asn1Container container ) throws DecoderException
                 {
-                    PersistentSearchControlContainer psearchContainer = ( PersistentSearchControlContainer ) container;
+                    PersistentSearchContainer psearchContainer = ( PersistentSearchContainer ) container;
                     Value value = psearchContainer.getCurrentTLV().getValue();
 
                     try
@@ -178,14 +178,14 @@ public final class PersistentSearchContr
          *     
          * Stores the return ECs flag 
          */
-        super.transitions[PersistentSearchControlStatesEnum.CHANGES_ONLY_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = 
-            new GrammarTransition( PersistentSearchControlStatesEnum.CHANGES_ONLY_STATE, 
-                                    PersistentSearchControlStatesEnum.RETURN_ECS_STATE, UniversalTag.BOOLEAN.getValue(),
+        super.transitions[ PersistentSearchStates.CHANGES_ONLY_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] =
+            new GrammarTransition( PersistentSearchStates.CHANGES_ONLY_STATE,
+                                    PersistentSearchStates.RETURN_ECS_STATE, UniversalTag.BOOLEAN.getValue(),
                 new GrammarAction( "Set PSearchControl returnECs" )
             {
                 public void action( Asn1Container container ) throws DecoderException
                 {
-                    PersistentSearchControlContainer psearchContainer = ( PersistentSearchControlContainer ) container;
+                    PersistentSearchContainer psearchContainer = ( PersistentSearchContainer ) container;
                     Value value = psearchContainer.getCurrentTLV().getValue();
 
                     try

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchGrammar.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchStates.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlStatesEnum.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchStates.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchStates.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlStatesEnum.java&r1=1063551&r2=1063609&rev=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchControlStatesEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchStates.java Wed Jan 26 06:24:04 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.asn1.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum PersistentSearchControlStatesEnum implements States
+public enum PersistentSearchStates implements States
 {
     // ~ Static fields/initializers
     // -----------------------------------------------------------------
@@ -80,7 +80,7 @@ public enum PersistentSearchControlState
      */
     public String getGrammarName( Grammar grammar )
     {
-        if ( grammar instanceof PersistentSearchControlGrammar )
+        if ( grammar instanceof PersistentSearchGrammar )
         {
             return "PSEARCH_GRAMMAR";
         }
@@ -113,7 +113,7 @@ public enum PersistentSearchControlState
     /**
      * {@inheritDoc}
      */
-    public PersistentSearchControlStatesEnum getStartState()
+    public PersistentSearchStates getStartState()
     {
         return START_STATE;
     }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchStates.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindResponseTest.java Wed Jan 26 06:24:04 2011
@@ -36,7 +36,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsDecorator;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
@@ -203,9 +203,9 @@ public class BindResponseTest
 
         Control control = controls.get( "1.2.840.113556.1.4.319" );
         assertEquals( "1.2.840.113556.1.4.319", control.getOid() );
-        assertTrue( control instanceof PagedResultsControl );
+        assertTrue( control instanceof PagedResultsDecorator );
 
-        PagedResultsControl pagedSearchControl = ( PagedResultsControl ) control;
+        PagedResultsDecorator pagedSearchControl = ( PagedResultsDecorator ) control;
 
         assertEquals( 5, pagedSearchControl.getSize() );
         assertTrue( Arrays.equals( "abcdef".getBytes(), pagedSearchControl.getCookie() ) );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java?rev=1063609&r1=1063608&r2=1063609&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/search/controls/EntryChangeControlTest.java Wed Jan 26 06:24:04 2011
@@ -31,9 +31,9 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
+import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeContainer;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeDecoder;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeDecorator;
-import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeControlContainer;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -68,7 +68,7 @@ public class EntryChangeControlTest
             } );
         bb.flip();
 
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( new EntryChangeDecorator() );
         
         try
@@ -108,7 +108,7 @@ public class EntryChangeControlTest
             } );
         bb.flip();
 
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( new EntryChangeDecorator() );
         
         try
@@ -147,7 +147,7 @@ public class EntryChangeControlTest
             } );
         bb.flip();
 
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( new EntryChangeDecorator() );
         
         try
@@ -189,7 +189,7 @@ public class EntryChangeControlTest
             } );
         bb.flip();
 
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( new EntryChangeDecorator() );
         
         try
@@ -225,7 +225,7 @@ public class EntryChangeControlTest
             } );
         bb.flip();
 
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( new EntryChangeDecorator() );
         
         try
@@ -264,7 +264,7 @@ public class EntryChangeControlTest
             } );
         bb.flip();
 
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( new EntryChangeDecorator() );
         
         try
@@ -303,7 +303,7 @@ public class EntryChangeControlTest
             } );
         bb.flip();
 
-        EntryChangeControlContainer container = new EntryChangeControlContainer();
+        EntryChangeContainer container = new EntryChangeContainer();
         container.setEntryChangeControl( new EntryChangeDecorator() );
         
         try



Mime
View raw message