directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063610 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/event/ core-jndi/src/main/java/org/apache/directory/server/core/jndi/ core/src/main/java/org/apache/directory/server/core/partition/ protocol-l...
Date Wed, 26 Jan 2011 06:28:35 GMT
Author: akarasulu
Date: Wed Jan 26 06:28:34 2011
New Revision: 1063610

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

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/event/EventType.java Wed Jan 26 06:28:34 2011
@@ -21,8 +21,7 @@ package org.apache.directory.server.core
 
 import java.util.ArrayList;
 
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
-
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchDecorator;
 
 
 /**
@@ -71,7 +70,7 @@ public enum EventType
      * NOTE: When the changeTypes mask includes a modDN(8) we include both the 
      * RENAME and MOVE EventType objects in the array.
      * 
-     * @see PersistentSearchControl
+     * @see PersistentSearchDecorator
      * @param psearchChangeTypes the value of the changeTypes parameter
      * @return array of EventType objects
      */

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Wed Jan 26 06:28:34 2011
@@ -99,15 +99,17 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControlContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControlDecoder;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChange;
+import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeContainer;
 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.codec.search.controls.entryChange.EntryChangeDecoder;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControlContainer;
-import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControlDecoder;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControlContainer;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControlDecoder;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResults;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsContainer;
+import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsDecoder;
+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.PersistentSearchContainer;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchDecoder;
+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.codec.search.controls.subentries.SubentriesControlContainer;
 import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesControlDecoder;
@@ -184,9 +186,9 @@ public abstract class ServerContext impl
         ADS_CONTROLS.put( Cascade.OID, ControlEnum.CASCADE_CONTROL );
         ADS_CONTROLS.put( EntryChange.OID, ControlEnum.ENTRY_CHANGE_CONTROL );
         ADS_CONTROLS.put( ManageDsaIT.OID, ControlEnum.MANAGE_DSA_IT_CONTROL );
-        ADS_CONTROLS.put( PagedResultsControl.CONTROL_OID, ControlEnum.PAGED_RESULTS_CONTROL );
+        ADS_CONTROLS.put( PagedResults.OID, ControlEnum.PAGED_RESULTS_CONTROL );
         ADS_CONTROLS.put( PasswordPolicyRequestControl.CONTROL_OID, ControlEnum.PASSWORD_POLICY_REQUEST_CONTROL );
-        ADS_CONTROLS.put( PersistentSearchControl.CONTROL_OID, ControlEnum.PERSISTENT_SEARCH_CONTROL );
+        ADS_CONTROLS.put( PersistentSearch.CONTROL_OID, ControlEnum.PERSISTENT_SEARCH_CONTROL );
         ADS_CONTROLS.put( SubentriesControl.CONTROL_OID, ControlEnum.SUBENTRIES_CONTROL );
         ADS_CONTROLS.put( SyncDoneValueControl.CONTROL_OID, ControlEnum.SYNC_DONE_VALUE_CONTROL );
         ADS_CONTROLS.put( SyncInfoValueControl.CONTROL_OID, ControlEnum.SYNC_INFO_VALUE_CONTROL );
@@ -394,12 +396,12 @@ public abstract class ServerContext impl
             case ENTRY_CHANGE_CONTROL:
                 control = new EntryChangeDecorator();
                 Asn1Decoder entryChangeControlDecoder = new EntryChangeDecoder();
-                EntryChangeControlContainer entryChangeControlContainer = new EntryChangeControlContainer();
-                entryChangeControlContainer.setEntryChangeControl( ( EntryChangeDecorator ) control );
+                EntryChangeContainer entryChangeContainer = new EntryChangeContainer();
+                entryChangeContainer.setEntryChangeControl( ( EntryChangeDecorator ) control );
                 ByteBuffer bb = ByteBuffer.allocate( jndiControl.getEncodedValue().length );
                 bb.put( jndiControl.getEncodedValue() ).flip();
 
-                entryChangeControlDecoder.decode( bb, entryChangeControlContainer );
+                entryChangeControlDecoder.decode( bb, entryChangeContainer );
 
                 break;
 
@@ -408,14 +410,14 @@ public abstract class ServerContext impl
                 break;
 
             case PAGED_RESULTS_CONTROL:
-                control = new PagedResultsControl();
-                entryChangeControlDecoder = new PagedResultsControlDecoder();
-                PagedResultsControlContainer pagedSearchControlContainer = new PagedResultsControlContainer();
-                pagedSearchControlContainer.setPagedSearchControl( ( PagedResultsControl ) control );
+                control = new PagedResultsDecorator();
+                entryChangeControlDecoder = new PagedResultsDecoder();
+                PagedResultsContainer pagedSearchContainer = new PagedResultsContainer();
+                pagedSearchContainer.setPagedSearchControl( ( PagedResultsDecorator ) control );
                 bb = ByteBuffer.allocate( jndiControl.getEncodedValue().length );
                 bb.put( jndiControl.getEncodedValue() ).flip();
 
-                entryChangeControlDecoder.decode( bb, pagedSearchControlContainer );
+                entryChangeControlDecoder.decode( bb, pagedSearchContainer );
 
                 break;
 
@@ -440,14 +442,14 @@ public abstract class ServerContext impl
                 break;
 
             case PERSISTENT_SEARCH_CONTROL:
-                control = new PersistentSearchControl();
-                PersistentSearchControlDecoder persistentSearchControlDecoder = new PersistentSearchControlDecoder();
-                PersistentSearchControlContainer persistentSearchControlContainer = new PersistentSearchControlContainer();
-                persistentSearchControlContainer.setPSearchControl( ( PersistentSearchControl ) control );
+                control = new PersistentSearchDecorator();
+                PersistentSearchDecoder persistentSearchDecoder = new PersistentSearchDecoder();
+                PersistentSearchContainer persistentSearchContainer = new PersistentSearchContainer();
+                persistentSearchContainer.setPSearchControl( ( PersistentSearchDecorator ) control );
                 bb = ByteBuffer.allocate( jndiControl.getEncodedValue().length );
                 bb.put( jndiControl.getEncodedValue() ).flip();
 
-                persistentSearchControlDecoder.decode( bb, persistentSearchControlContainer );
+                persistentSearchDecoder.decode( bb, persistentSearchContainer );
 
                 break;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Wed Jan 26 06:28:34 2011
@@ -60,6 +60,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.codec.controls.Cascade;
 import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChange;
+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.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.SingletonCursor;
 import org.apache.directory.shared.ldap.model.exception.*;
@@ -74,8 +76,6 @@ 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.subentries.SubentriesControl;
 import org.apache.directory.shared.ldap.model.cursor.EmptyCursor;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
@@ -174,9 +174,9 @@ public class DefaultPartitionNexus exten
         rootDSE.put( SchemaConstants.SUPPORTED_EXTENSION_AT, NoticeOfDisconnect.EXTENSION_OID );
 
         // Add the supported controls
-        rootDSE.put( SchemaConstants.SUPPORTED_CONTROL_AT, PersistentSearchControl.CONTROL_OID,
+        rootDSE.put( SchemaConstants.SUPPORTED_CONTROL_AT, PersistentSearch.CONTROL_OID,
             EntryChange.OID, SubentriesControl.CONTROL_OID, ManageDsaIT.OID,
-            Cascade.OID, PagedResultsControl.CONTROL_OID,
+            Cascade.OID, PagedResults.OID,
             // Replication controls
             SyncDoneValueControl.CONTROL_OID, SyncInfoValueControl.CONTROL_OID, SyncRequestValueControl.CONTROL_OID,
             SyncStateValueControl.CONTROL_OID );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java Wed Jan 26 06:28:34 2011
@@ -67,8 +67,8 @@ import org.apache.directory.shared.ldap.
 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.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;
 import org.apache.directory.shared.ldap.model.constants.SaslQoP;
 import org.apache.directory.shared.ldap.model.exception.LdapConfigurationException;
@@ -235,12 +235,12 @@ public class LdapServer extends Director
         saslRealms.add( "example.com" );
 
         this.supportedControls = new HashSet<String>();
-        this.supportedControls.add( PersistentSearchControl.CONTROL_OID );
+        this.supportedControls.add( PersistentSearch.CONTROL_OID );
         this.supportedControls.add( EntryChange.OID );
         this.supportedControls.add( SubentriesControl.CONTROL_OID );
         this.supportedControls.add( ManageDsaIT.OID );
         this.supportedControls.add( Cascade.OID );
-        this.supportedControls.add( PagedResultsControl.CONTROL_OID );
+        this.supportedControls.add( PagedResults.OID );
         // Replication controls
         this.supportedControls.add( SyncDoneValueControl.CONTROL_OID );
         this.supportedControls.add( SyncInfoValueControl.CONTROL_OID );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java Wed Jan 26 06:28:34 2011
@@ -234,7 +234,7 @@ public abstract class LdapRequestHandler
 
 
     /**
-     * Handles processing with referrals without ManageDsaIT control.
+     * Handles processing with referrals without ManageDsaIT decorator.
      */
     public void handleException( LdapSession session, ResultResponseRequest req, Exception e )
     {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/PersistentSearchListener.java Wed Jan 26 06:28:34 2011
@@ -32,7 +32,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.shared.ldap.codec.search.controls.ChangeType;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeDecorator;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
+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.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.message.SearchResultEntryImpl;
@@ -57,7 +58,7 @@ public class PersistentSearchListener im
     private static final Logger LOG = LoggerFactory.getLogger( PersistentSearchListener.class );
     final LdapSession session;
     final SearchRequest req;
-    final PersistentSearchControl control;
+    final PersistentSearchDecorator decorator;
 
 
     PersistentSearchListener( LdapSession session, SearchRequest req )
@@ -65,7 +66,7 @@ public class PersistentSearchListener im
         this.session = session;
         this.req = req;
         req.addAbandonListener( this );
-        this.control = ( PersistentSearchControl ) req.getControls().get( PersistentSearchControl.CONTROL_OID );
+        this.decorator = ( PersistentSearchDecorator ) req.getControls().get( PersistentSearch.CONTROL_OID );
     }
 
 
@@ -104,7 +105,7 @@ public class PersistentSearchListener im
 
     private void setECResponseControl( SearchResultEntry response, ChangeOperationContext opContext, ChangeType type )
     {
-        if ( control.isReturnECs() )
+        if ( decorator.isReturnECs() )
         {
             EntryChangeDecorator ecControl = new EntryChangeDecorator();
             ecControl.setChangeType( type );
@@ -126,7 +127,7 @@ public class PersistentSearchListener im
 
     public void entryAdded( AddOperationContext addContext )
     {
-        if ( !control.isNotificationEnabled( ChangeType.ADD ) )
+        if ( !decorator.isNotificationEnabled( ChangeType.ADD ) )
         {
             return;
         }
@@ -141,7 +142,7 @@ public class PersistentSearchListener im
 
     public void entryDeleted( DeleteOperationContext deleteContext )
     {
-        if ( !control.isNotificationEnabled( ChangeType.DELETE ) )
+        if ( !decorator.isNotificationEnabled( ChangeType.DELETE ) )
         {
             return;
         }
@@ -156,7 +157,7 @@ public class PersistentSearchListener im
 
     public void entryModified( ModifyOperationContext modifyContext )
     {
-        if ( !control.isNotificationEnabled( ChangeType.MODIFY ) )
+        if ( !decorator.isNotificationEnabled( ChangeType.MODIFY ) )
         {
             return;
         }
@@ -171,7 +172,7 @@ public class PersistentSearchListener im
 
     public void entryMoved( MoveOperationContext moveContext )
     {
-        if ( !control.isNotificationEnabled( ChangeType.MODDN ) )
+        if ( !decorator.isNotificationEnabled( ChangeType.MODDN ) )
         {
             return;
         }
@@ -192,7 +193,7 @@ public class PersistentSearchListener im
 
     public void entryRenamed( RenameOperationContext renameContext )
     {
-        if ( !control.isNotificationEnabled( ChangeType.MODDN ) )
+        if ( !decorator.isNotificationEnabled( ChangeType.MODDN ) )
         {
             return;
         }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Wed Jan 26 06:28:34 2011
@@ -40,8 +40,10 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.replication.ReplicationProvider;
 import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControl;
-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.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.*;
 import org.apache.directory.shared.ldap.model.exception.*;
@@ -110,23 +112,23 @@ public class SearchHandler extends LdapR
 
 
     /**
-     * Handles search requests containing the persistent search control but
+     * Handles search requests containing the persistent search decorator but
      * delegates to doSimpleSearch() if the changesOnly parameter of the
-     * control is set to false.
+     * decorator is set to false.
      *
      * @param session the LdapSession for which this search is conducted
-     * @param req the search request containing the persistent search control
-     * @param psearchControl the persistent search control extracted
+     * @param req the search request containing the persistent search decorator
+     * @param psearchDecorator the persistent search decorator extracted
      * @throws Exception if failures are encountered while searching
      */
     private void handlePersistentSearch( LdapSession session, SearchRequest req,
-        PersistentSearchControl psearchControl ) throws Exception
+        PersistentSearchDecorator psearchDecorator ) throws Exception
     {
         /*
          * We want the search to complete first before we start listening to
-         * events when the control does NOT specify changes ONLY mode.
+         * events when the decorator does NOT specify changes ONLY mode.
          */
-        if ( !psearchControl.isChangesOnly() )
+        if ( !psearchDecorator.isChangesOnly() )
         {
             SearchResultDone done = doSimpleSearch( session, req );
 
@@ -154,7 +156,7 @@ public class SearchHandler extends LdapR
         criteria.setBase( req.getBase() );
         criteria.setFilter( req.getFilter() );
         criteria.setScope( req.getScope() );
-        criteria.setEventMask( EventType.getEventTypes( psearchControl.getChangeTypes() ) );
+        criteria.setEventMask( EventType.getEventTypes( psearchDecorator.getChangeTypes() ) );
         getLdapServer().getDirectoryService().getEventService().addListener( handler, criteria );
         req.addAbandonListener( new SearchAbandonListener( ldapServer, handler ) );
     }
@@ -167,16 +169,16 @@ public class SearchHandler extends LdapR
     {
         LOG.debug( "Handling single reply request: {}", req );
 
-        // check first for the syncrepl search request control
+        // check first for the syncrepl search request decorator
         if ( req.getControls().containsKey( SyncRequestValueControl.CONTROL_OID ) )
         {
             handleSyncreplSearch( session, req );
         }
-        // if we have the ManageDSAIt control, go directly
+        // if we have the ManageDSAIt decorator, go directly
         // to the handling without pre-processing the request
         else if ( req.getControls().containsKey( ManageDsaIT.OID ) )
         {
-            // If the ManageDsaIT control is present, we will
+            // If the ManageDsaIT decorator is present, we will
             // consider that the user wants to get entry which
             // are referrals as plain entry. We have to return
             // SearchResponseEntry elements instead of
@@ -186,7 +188,7 @@ public class SearchHandler extends LdapR
         }
         else
         {
-            // No ManageDsaIT control. If the found entries is a referral,
+            // No ManageDsaIT decorator. If the found entries is a referral,
             // we will return SearchResponseReference elements.
             LOG.debug( "ManageDsaITControl NOT detected." );
 
@@ -395,7 +397,7 @@ public class SearchHandler extends LdapR
 
     private void readPagedResults( LdapSession session, SearchRequest req, LdapResult ldapResult,
         EntryFilteringCursor cursor, long sizeLimit, int pagedLimit, PagedSearchContext pagedContext,
-        PagedResultsControl pagedResultsControl ) throws Exception
+        PagedResultsDecorator pagedResultsControl ) throws Exception
     {
         req.addAbandonListener( new SearchAbandonListener( ldapServer, cursor ) );
         setTimeLimitsOnCursor( req, session, cursor );
@@ -447,7 +449,7 @@ public class SearchHandler extends LdapR
                 }
             }
 
-            pagedResultsControl = new PagedResultsControl();
+            pagedResultsControl = new PagedResultsDecorator();
             pagedResultsControl.setCritical( true );
             pagedResultsControl.setSize( 0 );
             req.getResultResponse().addControl( pagedResultsControl );
@@ -493,9 +495,9 @@ public class SearchHandler extends LdapR
      */
     private SearchResultDone abandonPagedSearch( LdapSession session, SearchRequest req ) throws Exception
     {
-        PagedResultsControl pagedResultsControl = null;
-        PagedResultsControl pagedSearchControl = ( PagedResultsControl ) req.getControls().get(
-            PagedResultsControl.CONTROL_OID );
+        PagedResultsDecorator pagedResultsControl = null;
+        PagedResultsDecorator pagedSearchControl = ( PagedResultsDecorator ) req.getControls().get(
+            PagedResults.OID );
         byte[] cookie = pagedSearchControl.getCookie();
 
         if ( !Strings.isEmpty(cookie) )
@@ -504,7 +506,7 @@ public class SearchHandler extends LdapR
             // cursor stored into the session (if any)
             int cookieValue = pagedSearchControl.getCookieValue();
             PagedSearchContext psCookie = session.removePagedSearchContext( cookieValue );
-            pagedResultsControl = new PagedResultsControl();
+            pagedResultsControl = new PagedResultsDecorator();
             pagedResultsControl.setCookie( psCookie.getCookie() );
             pagedResultsControl.setSize( 0 );
             pagedResultsControl.setCritical( true );
@@ -519,7 +521,7 @@ public class SearchHandler extends LdapR
         }
         else
         {
-            pagedResultsControl = new PagedResultsControl();
+            pagedResultsControl = new PagedResultsDecorator();
             pagedResultsControl.setSize( 0 );
             pagedResultsControl.setCritical( true );
         }
@@ -552,11 +554,11 @@ public class SearchHandler extends LdapR
     /**
      * Handle a Paged Search request.
      */
-    private SearchResultDone doPagedSearch( LdapSession session, SearchRequest req, PagedResultsControl control )
+    private SearchResultDone doPagedSearch( LdapSession session, SearchRequest req, PagedResultsDecorator control )
         throws Exception
     {
-        PagedResultsControl pagedSearchControl = control;
-        PagedResultsControl pagedResultsControl = null;
+        PagedResultsDecorator pagedSearchControl = control;
+        PagedResultsDecorator pagedResultsControl = null;
 
         // Get the size limits
         // Don't bother setting size limits for administrators that don't ask for it
@@ -636,7 +638,7 @@ public class SearchHandler extends LdapR
 
                 session.addPagedSearchContext( pagedContext );
                 cookie = pagedContext.getCookie();
-                pagedResultsControl = new PagedResultsControl();
+                pagedResultsControl = new PagedResultsDecorator();
                 pagedResultsControl.setCookie( cookie );
                 pagedResultsControl.setSize( 0 );
                 pagedResultsControl.setCritical( true );
@@ -675,7 +677,7 @@ public class SearchHandler extends LdapR
 
                 // get the cookie
                 cookie = pagedContext.getCookie();
-                pagedResultsControl = new PagedResultsControl();
+                pagedResultsControl = new PagedResultsDecorator();
                 pagedResultsControl.setCookie( cookie );
                 pagedResultsControl.setSize( 0 );
                 pagedResultsControl.setCritical( true );
@@ -698,7 +700,7 @@ public class SearchHandler extends LdapR
                 session.addPagedSearchContext( pagedContext );
 
                 cookie = pagedContext.getCookie();
-                pagedResultsControl = new PagedResultsControl();
+                pagedResultsControl = new PagedResultsDecorator();
                 pagedResultsControl.setCookie( cookie );
                 pagedResultsControl.setSize( 0 );
                 pagedResultsControl.setCritical( true );
@@ -751,12 +753,12 @@ public class SearchHandler extends LdapR
         LdapResult ldapResult = req.getResultResponse().getLdapResult();
 
         // Check if we are using the Paged Search Control
-        Object control = req.getControls().get( PagedResultsControl.CONTROL_OID );
+        Object control = req.getControls().get( PagedResults.OID );
 
         if ( control != null )
         {
             // Let's deal with the pagedControl
-            return doPagedSearch( session, req, ( PagedResultsControl ) control );
+            return doPagedSearch( session, req, ( PagedResultsDecorator ) control );
         }
 
         // A normal search
@@ -870,7 +872,7 @@ public class SearchHandler extends LdapR
         }
         else
         {
-            // The entry is not a referral, or the ManageDsaIt control is set
+            // The entry is not a referral, or the ManageDsaIt decorator is set
             SearchResultEntry respEntry;
             respEntry = new SearchResultEntryImpl( req.getMessageId() );
             respEntry.setEntry( entry );
@@ -890,7 +892,7 @@ public class SearchHandler extends LdapR
 
     /**
      * Alters the filter expression based on the presence of the
-     * ManageDsaIT control.  If the control is not present, the search
+     * ManageDsaIT decorator.  If the decorator is not present, the search
      * filter will be altered to become a disjunction with two terms.
      * The first term is the original filter.  The second term is a
      * (objectClass=referral) assertion.  When OR'd together these will
@@ -964,7 +966,7 @@ public class SearchHandler extends LdapR
 
     /**
      * Main message handing method for search requests.  This will be called
-     * even if the ManageDsaIT control is present because the super class does
+     * even if the ManageDsaIT decorator is present because the super class does
      * not know that the search operation has more to do after finding the
      * base.  The call to this means that finding the base can ignore
      * referrals.
@@ -1008,16 +1010,16 @@ public class SearchHandler extends LdapR
             // Handle psearch differently
             // ===============================================================
 
-            PersistentSearchControl psearchControl = ( PersistentSearchControl ) req.getControls().get(
-                PersistentSearchControl.CONTROL_OID );
+            PersistentSearchDecorator psearchDecorator = ( PersistentSearchDecorator ) req.getControls().get(
+                PersistentSearch.CONTROL_OID );
 
-            if ( psearchControl != null )
+            if ( psearchDecorator != null )
             {
                 // Set the flag to avoid the request being removed
                 // from the session
                 isPersistentSearch = true;
 
-                handlePersistentSearch( session, req, psearchControl );
+                handlePersistentSearch( session, req, psearchDecorator );
 
                 return;
             }
@@ -1074,7 +1076,7 @@ public class SearchHandler extends LdapR
 
 
     /**
-     * Handles processing with referrals without ManageDsaIT control.
+     * Handles processing with referrals without ManageDsaIT decorator.
      */
     private void handleWithReferrals( LdapSession session, SearchRequest req ) throws LdapException
     {
@@ -1340,7 +1342,7 @@ public class SearchHandler extends LdapR
 
 
     /**
-     * Handles processing with referrals without ManageDsaIT control and with
+     * Handles processing with referrals without ManageDsaIT decorator and with
      * an ancestor that is a referral.  The original entry was not found and
      * the walk of the ancestry returned a referral.
      *
@@ -1421,7 +1423,7 @@ public class SearchHandler extends LdapR
 
 
     /**
-     * Handles processing with referrals without ManageDsaIT control and with
+     * Handles processing with referrals without ManageDsaIT decorator and with
      * an ancestor that is a referral.  The original entry was not found and
      * the walk of the ancestry returned a referral.
      *
@@ -1518,7 +1520,7 @@ public class SearchHandler extends LdapR
 
 
     /**
-     * Handles processing with referrals without ManageDsaIT control.
+     * Handles processing with referrals without ManageDsaIT decorator.
      */
     public void handleException( LdapSession session, ResultResponseRequest req, Exception e )
     {

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PagedSearchIT.java Wed Jan 26 06:28:34 2011
@@ -44,7 +44,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
 import org.apache.directory.server.core.integ.FrameworkRunner;
 import org.apache.directory.server.ldap.LdapServer;
-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.Control;
 import org.apache.directory.shared.ldap.util.JndiUtils;
 import org.apache.directory.shared.util.Strings;
@@ -206,7 +206,7 @@ public class PagedSearchIT extends Abstr
         SearchControls controls = new SearchControls();
         controls.setCountLimit( sizeLimit );
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        PagedResultsControl pagedSearchControl = new PagedResultsControl();
+        PagedResultsDecorator pagedSearchControl = new PagedResultsDecorator();
         pagedSearchControl.setSize( pagedSize );
         
         ((LdapContext)ctx).setRequestControls( JndiUtils.toJndiControls( new Control[] {pagedSearchControl} ) );
@@ -221,7 +221,7 @@ public class PagedSearchIT extends Abstr
     private void createNextSearchControls( DirContext ctx, byte[] cookie, int pagedSize ) 
         throws NamingException
     {
-        PagedResultsControl pagedSearchControl = new PagedResultsControl();
+        PagedResultsDecorator pagedSearchControl = new PagedResultsDecorator();
         pagedSearchControl.setCookie( cookie );
         pagedSearchControl.setSize( pagedSize );
         ((LdapContext)ctx).setRequestControls( JndiUtils.toJndiControls( new Control[] {pagedSearchControl} ) );

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java Wed Jan 26 06:28:34 2011
@@ -54,7 +54,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChange;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeDecorator;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.EntryChangeDecoder;
-import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
+import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchDecorator;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.ldif.LdifUtils;
 import org.apache.directory.shared.ldap.model.message.Control;
@@ -67,7 +67,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * Test case which tests the correct operation of the persistent search control.
+ * Test case which tests the correct operation of the persistent search decorator.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -119,11 +119,11 @@ public class PersistentSearchIT extends 
 
     private void setUpListenerReturnECs() throws Exception
     {
-        setUpListener( true, new PersistentSearchControl(), false );
+        setUpListener( true, new PersistentSearchDecorator(), false );
     }
     
     
-    private void setUpListener( boolean returnECs, PersistentSearchControl  control, boolean ignoreEmptyRegistryCheck ) 
+    private void setUpListener( boolean returnECs, PersistentSearchDecorator decorator, boolean ignoreEmptyRegistryCheck )
         throws Exception
     {
         ctx = ( EventDirContext ) getWiredContext( ldapServer).lookup( BASE );
@@ -135,8 +135,8 @@ public class PersistentSearchIT extends 
             assertTrue( registrationEntryList.isEmpty() );
         }
         
-        control.setReturnECs( returnECs );
-        listener = new PSearchListener( control );
+        decorator.setReturnECs( returnECs );
+        listener = new PSearchListener( decorator );
         t = new Thread( listener, "PSearchListener" );
         t.start();
 
@@ -331,11 +331,11 @@ public class PersistentSearchIT extends 
     @Test
     public void testPsearchAddModifyEnabledWithEC() throws Exception
     {
-        PersistentSearchControl control = new PersistentSearchControl();
-        control.setReturnECs( true );
-        control.setChangeTypes( ChangeType.ADD.getValue() );
-        control.enableNotification( ChangeType.MODIFY );
-        setUpListener( true, control, false );
+        PersistentSearchDecorator decorator = new PersistentSearchDecorator();
+        decorator.setReturnECs( true );
+        decorator.setChangeTypes( ChangeType.ADD.getValue() );
+        decorator.enableNotification( ChangeType.MODIFY );
+        setUpListener( true, decorator, false );
         ctx.createSubcontext( "cn=Jack Black", getPersonAttributes( "Black", "Jack Black" ) );
         waitForThreadToDie( t );
 
@@ -344,7 +344,7 @@ public class PersistentSearchIT extends 
         assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
         tearDownListener();
 
-        setUpListener( true, control, true );
+        setUpListener( true, decorator, true );
         ctx.destroySubcontext( "cn=Jack Black" );
         waitForThreadToDie( t );
         assertNull( listener.result );
@@ -372,10 +372,10 @@ public class PersistentSearchIT extends 
      */
     //    public void testPsearchAddWithECAndFalseChangesOnly() throws Exception
     //    {
-    //        PersistentSearchControl control = new PersistentSearchControl();
-    //        control.setReturnECs( true );
-    //        control.setChangesOnly( false );
-    //        PSearchListener listener = new PSearchListener( control );
+    //        PersistentSearchDecorator decorator = new PersistentSearchDecorator();
+    //        decorator.setReturnECs( true );
+    //        decorator.setChangesOnly( false );
+    //        PSearchListener listener = new PSearchListener( decorator );
     //        Thread t = new Thread( listener );
     //        t.start();
     //        
@@ -397,7 +397,7 @@ public class PersistentSearchIT extends 
     //        assertEquals( 6, listener.count );
     //        assertNotNull( listener.result );
     //        assertEquals( "cn=Jack Black", listener.result.getName() );
-    //        assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
+    //        assertEquals( listener.result.decorator.getChangeType(), ChangeType.ADD );
     //    }
 
     /**
@@ -407,9 +407,9 @@ public class PersistentSearchIT extends 
     @Test
     public void testPsearchAbandon() throws Exception
     {
-        PersistentSearchControl control = new PersistentSearchControl();
-        control.setReturnECs( true );
-        PSearchListener listener = new PSearchListener( control );
+        PersistentSearchDecorator decorator = new PersistentSearchDecorator();
+        decorator.setReturnECs( true );
+        PSearchListener listener = new PSearchListener( decorator );
         Thread t = new Thread( listener );
         t.start();
 
@@ -433,9 +433,9 @@ public class PersistentSearchIT extends 
 
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
-        assertEquals( listener.result.control.getChangeType(), ChangeType.ADD );
+        assertEquals( listener.result.decorator.getChangeType(), ChangeType.ADD );
         
-        listener = new PSearchListener( control );
+        listener = new PSearchListener( decorator );
 
         t = new Thread( listener );
         t.start();
@@ -456,7 +456,7 @@ public class PersistentSearchIT extends 
         // assertNull( listener.result );
         assertNotNull( listener.result );
         assertEquals( "cn=Jack Black", listener.result.getName() );
-        assertEquals( ChangeType.DELETE, listener.result.control.getChangeType() );
+        assertEquals( ChangeType.DELETE, listener.result.decorator.getChangeType() );
         listener.result = null;
 
         // thread is still waiting for notifications try a modify
@@ -474,7 +474,7 @@ public class PersistentSearchIT extends 
 
         assertNull( listener.result );
         //assertEquals( Rdn, listener.result.getName() );
-        //assertEquals( listener.result.control.getChangeType(), ChangeType.MODIFY );
+        //assertEquals( listener.result.decorator.getChangeType(), ChangeType.MODIFY );
     }*/
 
     
@@ -521,19 +521,19 @@ public class PersistentSearchIT extends 
     {
         boolean isReady = false;
         PSearchNotification result;
-        final PersistentSearchControl control;
+        final PersistentSearchDecorator decorator;
         LdapContext ctx;
         NamingEnumeration<SearchResult> list;
         
         PSearchListener()
         {
-            control = new PersistentSearchControl();
+            decorator = new PersistentSearchDecorator();
         }
 
 
-        PSearchListener(PersistentSearchControl control)
+        PSearchListener(PersistentSearchDecorator decorator )
         {
-            this.control = control;
+            this.decorator = decorator;
         }
 
         
@@ -570,12 +570,12 @@ public class PersistentSearchIT extends 
         public void run()
         {
             LOG.debug( "PSearchListener.run() called." );
-            control.setCritical( true );
+            decorator.setCritical( true );
             
-            control.setValue( control.getValue() );
+            decorator.setValue( decorator.getValue() );
 
             Control[] ctxCtls = new Control[]
-                { control };
+                { decorator };
 
             try
             {

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java Wed Jan 26 06:28:34 2011
@@ -292,14 +292,14 @@ public class SchemaSearchIT extends Abst
     
     /**
      * Test case for DIRSERVER-: Ensure that schema entry is returned, 
-     * even if no ManageDsaIT control is present in the search request.
+     * even if no ManageDsaIT decorator is present in the search request.
      */
     @Test
     public void testRequestWithoutManageDsaITControl() throws Exception
     {
         DirContext ctx = getWiredContext( ldapServer );
 
-        // this removes the ManageDsaIT control from the search request
+        // this removes the ManageDsaIT decorator from the search request
         ctx.addToEnvironment( DirContext.REFERRAL, "throw" );
 
         SearchControls ctls = new SearchControls();

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java?rev=1063610&r1=1063609&r2=1063610&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java Wed Jan 26 06:28:34 2011
@@ -611,7 +611,7 @@ public class SearchIT extends AbstractLd
 
 
     /**
-     * Creates an access control subentry under ou=system whose subtree covers
+     * Creates an access decorator subentry under ou=system whose subtree covers
      * the entire naming context.
      *
      * @param cn the common name and rdn for the subentry
@@ -726,7 +726,7 @@ public class SearchIT extends AbstractLd
     {
         LdapContext ctx = ( LdapContext ) getWiredContext( ldapServer ).lookup( BASE );
 
-        // create a real access control subentry
+        // create a real access decorator subentry
         createAccessControlSubentry( "anyBodyAdd", "{}", "{ " + "  identificationTag \"addAci\", "
             + "  precedence 14, " + "  authenticationLevel none, " + "  itemOrUserFirst userFirst: " + "  { "
             + "    userClasses " + "    { " + "      allUsers " + "    }, " + "    userPermissions " + "    { "
@@ -734,7 +734,7 @@ public class SearchIT extends AbstractLd
             + "        }, " + "        grantsAndDenials " + "        { " + "          grantAdd, grantBrowse "
             + "        } " + "      } " + "    } " + "  } " + "}" );
 
-        // prepare the subentry control to make the subentry visible
+        // prepare the subentry decorator to make the subentry visible
         SubentriesControl control = new SubentriesControl();
         control.setVisibility( true );
         Control[] reqControls = new Control[]



Mime
View raw message