directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r918819 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core-api/src/main/java/org/apache/directory/server/core/schema/ core-jndi/src/main/java/org/apache/directory/server/core/jn...
Date Thu, 04 Mar 2010 02:26:48 GMT
Author: elecharny
Date: Thu Mar  4 02:26:48 2010
New Revision: 918819

URL: http://svn.apache.org/viewvc?rev=918819&view=rev
Log:
Some preliminary step to get rid of the SearchControls in the server

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.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/ReferralManagerImpl.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
Thu Mar  4 02:26:48 2010
@@ -79,11 +79,11 @@
         
         if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
         {
-            ignoreReferral();
+            throwReferral = false;
         }
         else
         {
-            throwReferral();
+            throwReferral = true;
         }
     }
 
@@ -91,15 +91,13 @@
     /**
      * Creates a new instance of SearchOperationContext.
      * 
-     * @param aliasDerefMode the alias dereferencing mode
      * @param dn the dn of the search base
      * @param filter the filter AST to use for the search
      * @param searchControls the search controls
      */
-    public SearchOperationContext( CoreSession session, DN dn, AliasDerefMode aliasDerefMode,
ExprNode filter,
-                                   SearchControls searchControls ) throws Exception
+    public SearchOperationContext( CoreSession session, DN dn, ExprNode filter, SearchControls
searchControls ) throws Exception
     {
-        super( session, dn, aliasDerefMode, searchControls );
+        super( session, dn, searchControls );
         this.filter = filter;
     }
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchingOperationContext.java
Thu Mar  4 02:26:48 2010
@@ -87,7 +87,7 @@
     protected boolean typesOnly = false;
     
     /**
-     * Creates a new instance of ListOperationContext.
+     * Creates a new instance of SearchingOperationContext.
      */
     public SearchingOperationContext( CoreSession session )
     {
@@ -96,7 +96,7 @@
 
 
     /**
-     * Creates a new instance of ListOperationContext.
+     * Creates a new instance of SearchingOperationContext.
      *
      * @param dn The DN to get the suffix from
      */
@@ -107,7 +107,7 @@
 
 
     /**
-     * Creates a new instance of ListOperationContext.
+     * Creates a new instance of SearchingOperationContext.
      *
      * @param dn The DN to get the suffix from
      * @param aliasDerefMode the alias dereferencing mode to use
@@ -119,6 +119,76 @@
     }
 
     
+    /**
+     * Creates a new instance of ListOperationContext.
+     *
+     * @param dn The DN to get the suffix from
+     * @param aliasDerefMode the alias dereferencing mode to use
+     * @throws NamingException 
+     */
+    public SearchingOperationContext( CoreSession session, DN dn, AliasDerefMode aliasDerefMode,

+        SearchControls searchControls ) throws Exception
+    {
+        super( session, dn );
+        this.aliasDerefMode = aliasDerefMode;
+        this.scope = SearchScope.getSearchScope( searchControls.getSearchScope() );
+        this.timeLimit = searchControls.getTimeLimit();
+        this.sizeLimit = searchControls.getCountLimit();
+        
+        if ( searchControls.getReturningAttributes() != null )
+        {
+            setReturningAttributes( searchControls.getReturningAttributes() );
+        }
+        else
+        {
+            setReturningAttributes( SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
+        }
+    }
+
+    
+    /**
+     * Creates a new instance of ListOperationContext.
+     *
+     * @param dn The DN to get the suffix from
+     * @param aliasDerefMode the alias dereferencing mode to use
+     * @throws NamingException 
+     */
+    public SearchingOperationContext( CoreSession session, DN dn, 
+        SearchControls searchControls ) throws Exception
+    {
+        super( session, dn );
+        this.scope = SearchScope.getSearchScope( searchControls.getSearchScope() );
+        this.timeLimit = searchControls.getTimeLimit();
+        this.sizeLimit = searchControls.getCountLimit();
+
+        if ( searchControls.getReturningAttributes() != null )
+        {
+            setReturningAttributes( searchControls.getReturningAttributes() );
+        }
+        else
+        {
+            setReturningAttributes( SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
+        }
+    }
+
+    
+    /**
+     * Creates a new instance of a SearchingOperationContext using one level 
+     * scope, with attributes to return.
+     *
+     * @param dn The DN to get the suffix from
+     * @param aliasDerefMode the alias dereferencing mode to use
+     * @throws NamingException 
+     */
+    public SearchingOperationContext( CoreSession session, DN dn, AliasDerefMode aliasDerefMode,
+        Set<AttributeTypeOptions> returningAttributes )
+    {
+        super( session, dn );
+        this.aliasDerefMode = aliasDerefMode;
+        this.returningAttributes = returningAttributes;
+    }
+
+
     protected void setReturningAttributes( Collection<String> attributesIds ) 
         throws Exception
     {
@@ -180,50 +250,6 @@
     
     
     /**
-     * Creates a new instance of ListOperationContext.
-     *
-     * @param dn The DN to get the suffix from
-     * @param aliasDerefMode the alias dereferencing mode to use
-     * @throws NamingException 
-     */
-    public SearchingOperationContext( CoreSession session, DN dn, AliasDerefMode aliasDerefMode,

-        SearchControls searchControls ) throws Exception
-    {
-        super( session, dn );
-        this.aliasDerefMode = aliasDerefMode;
-        this.scope = SearchScope.getSearchScope( searchControls.getSearchScope() );
-        this.timeLimit = searchControls.getTimeLimit();
-        this.sizeLimit = searchControls.getCountLimit();
-        
-        if ( searchControls.getReturningAttributes() != null )
-        {
-            setReturningAttributes( searchControls.getReturningAttributes() );
-        }
-        else
-        {
-            setReturningAttributes( SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
-        }
-    }
-
-    
-    /**
-     * Creates a new instance of a SearchingOperationContext using one level 
-     * scope, with attributes to return.
-     *
-     * @param dn The DN to get the suffix from
-     * @param aliasDerefMode the alias dereferencing mode to use
-     * @throws NamingException 
-     */
-    public SearchingOperationContext( CoreSession session, DN dn, AliasDerefMode aliasDerefMode,
-        Set<AttributeTypeOptions> returningAttributes )
-    {
-        super( session, dn );
-        this.aliasDerefMode = aliasDerefMode;
-        this.returningAttributes = returningAttributes;
-    }
-
-
-    /**
      * @see Object#toString()
      */
     public String toString()
@@ -238,6 +264,12 @@
     }
 
 
+    public void setAliasDerefMode( AliasDerefMode aliasDerefMode )
+    {
+        this.aliasDerefMode = aliasDerefMode;
+    }
+
+
     /**
      * @param sizeLimit the sizeLimit to set
      */

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
Thu Mar  4 02:26:48 2010
@@ -247,8 +247,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
 
             if ( !cursor.next() )
             {
@@ -296,8 +299,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
 
             if ( !cursor.next() )
             {
@@ -345,8 +351,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
 
             if ( !cursor.next() )
             {
@@ -394,8 +403,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
 
             if ( !cursor.next() )
             {
@@ -443,8 +455,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
 
             if ( !cursor.next() )
             {
@@ -520,8 +535,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
 
             if ( !cursor.next() )
             {
@@ -611,8 +629,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
             
             while ( cursor.next() )
             {
@@ -667,8 +688,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
             
             while ( cursor.next() )
             {
@@ -699,8 +723,12 @@
         // (& (m-oid=*) (m-name=*) )
         filter.addNode( new PresenceNode( M_OID_OID ) );
         filter.addNode( new PresenceNode( M_NAME_OID ) );
-        return partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-            AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+
+        SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+            filter, searchControls );
+        searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+        
+        return partition.search( searchOperationContext );
     }
 
 
@@ -750,8 +778,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
             
             while ( cursor.next() )
             {
@@ -795,8 +826,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
             
             while ( cursor.next() )
             {
@@ -834,8 +868,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
 
             while ( cursor.next() )
             {
@@ -917,8 +954,11 @@
 
         try
         {
-            cursor = partition.search( new SearchOperationContext( null, partition.getSuffixDn(),
-                AliasDerefMode.DEREF_ALWAYS, filter, searchControls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null,
partition.getSuffixDn(),
+                filter, searchControls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            cursor = partition.search( searchOperationContext );
             
             while ( cursor.next() )
             {

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=918819&r1=918818&r2=918819&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
Thu Mar  4 02:26:48 2010
@@ -341,8 +341,9 @@
             boolean result = operationManager.compare( (CompareOperationContext)opContext
);
 
             // setup the op context and populate with request controls
-            opContext = new SearchOperationContext( session, dn, aliasDerefMode, filter,
+            opContext = new SearchOperationContext( session, dn, filter,
                 searchControls );
+            ((SearchOperationContext)opContext).setAliasDerefMode( aliasDerefMode );
             opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
             
             ( ( SearchOperationContext ) opContext ).setTypesOnly(  typesOnly );
@@ -362,8 +363,8 @@
             // It's a Search
             
             // setup the op context and populate with request controls
-            opContext = new SearchOperationContext( session, dn, aliasDerefMode, filter,
-                searchControls );
+            opContext = new SearchOperationContext( session, dn, filter, searchControls );
+            ( ( SearchOperationContext ) opContext ).setAliasDerefMode( aliasDerefMode );
             opContext.addRequestControls( JndiUtils.fromJndiControls( requestControls ) );
             ( ( SearchOperationContext ) opContext ).setTypesOnly(  typesOnly );
             

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
Thu Mar  4 02:26:48 2010
@@ -156,8 +156,10 @@
             // We will store each entry's DN into the Referral tree
             DN suffixDn = new DN( suffix );
             suffixDn.normalize( directoryService.getSchemaManager().getNormalizerMapping()
);
-            EntryFilteringCursor cursor = nexus.search( new SearchOperationContext( adminSession,
suffixDn, AliasDerefMode.DEREF_ALWAYS,
-                referralFilter, searchControl ) );
+            
+            SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession,
suffixDn, referralFilter, searchControl );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            EntryFilteringCursor cursor = nexus.search( searchOperationContext );
             
             // Move to the first entry in the cursor
             cursor.beforeFirst();
@@ -196,8 +198,10 @@
         PartitionNexus nexus = directoryService.getPartitionNexus();
 
         // We will store each entry's DN into the Referral tree
-        EntryFilteringCursor cursor = nexus.search( new SearchOperationContext( adminSession,
suffix, AliasDerefMode.DEREF_ALWAYS,
-            referralFilter, searchControl ) );
+        SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession,
suffix,
+            referralFilter, searchControl );
+        searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+        EntryFilteringCursor cursor = nexus.search( searchOperationContext );
         
         // Move to the first entry in the cursor
         cursor.beforeFirst();

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Thu Mar  4 02:26:48 2010
@@ -140,9 +140,10 @@
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             
-            
-            EntryFilteringCursor results = nexus.search( new SearchOperationContext( session,
-                baseDn, AliasDerefMode.DEREF_ALWAYS, filter, ctls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( session,
+                baseDn, filter, ctls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            EntryFilteringCursor results = nexus.search( searchOperationContext );
 
             while ( results.next() )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
Thu Mar  4 02:26:48 2010
@@ -125,8 +125,12 @@
                 new ClientStringValue( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            EntryFilteringCursor results = nexus.search( new SearchOperationContext( session,
-                baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, ctls ) );
+            
+            SearchOperationContext searchOperationContext = new SearchOperationContext( session,
+                baseDn, filter, ctls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+
+            EntryFilteringCursor results = nexus.search( searchOperationContext );
 
             while ( results.next() )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java
Thu Mar  4 02:26:48 2010
@@ -162,9 +162,10 @@
         try
         {
             SearchOperationContext searchContext = new SearchOperationContext( opContext.getSession(),

-                ( DN ) entryName.getPrefix( 1 ), AliasDerefMode.DEREF_ALWAYS, 
-                childrenFilter, childrenSearchControls );
+                ( DN ) entryName.getPrefix( 1 ), childrenFilter, childrenSearchControls );
             searchContext.setByPassed( SEARCH_BYPASS );
+            searchContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
             results = opContext.getSession().getDirectoryService().getOperationManager().search(
searchContext );
 
             while ( results.next() )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
Thu Mar  4 02:26:48 2010
@@ -173,8 +173,11 @@
             CoreSession adminSession = new DefaultCoreSession( 
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService
);
 
-            EntryFilteringCursor subentries = nexus.search( new SearchOperationContext( adminSession,
-                suffixDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession,
suffixDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            EntryFilteringCursor subentries = nexus.search( searchOperationContext );
 
             while ( subentries.next() )
             {
@@ -473,8 +476,11 @@
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES
} );
 
-            EntryFilteringCursor subentries = nexus.search( new SearchOperationContext( addContext.getSession(),
-                baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( addContext.getSession(),
baseDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            EntryFilteringCursor subentries = nexus.search( searchOperationContext );
 
             while ( subentries.next() )
             {
@@ -611,8 +617,11 @@
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES
} );
 
-            EntryFilteringCursor subentries = nexus.search( new SearchOperationContext( opContext.getSession(),
-                baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+            SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(),
baseDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            EntryFilteringCursor subentries = nexus.search( searchOperationContext );
 
             while ( subentries.next() )
             {
@@ -652,8 +661,12 @@
         ExprNode filter = new PresenceNode( "administrativeRole" );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        EntryFilteringCursor aps = nexus.search( new SearchOperationContext( opContext.getSession(),
name,
-            AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+
+        SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(),
name,
+            filter, controls );
+        searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES );
+        
+        EntryFilteringCursor aps = nexus.search( searchOperationContext );
 
         if ( aps.next() )
         {
@@ -771,8 +784,12 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES
} );
-            EntryFilteringCursor subentries = nexus.search( new SearchOperationContext( opContext.getSession(),
-                baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+            
+            SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(),
baseDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            EntryFilteringCursor subentries = nexus.search( searchOperationContext );
 
             while ( subentries.next() )
             {
@@ -846,8 +863,12 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES
} );
-            EntryFilteringCursor subentries = nexus.search( new SearchOperationContext( opContext.getSession(),
-                baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+
+            SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(),
baseDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            EntryFilteringCursor subentries = nexus.search( searchOperationContext );
 
             while ( subentries.next() )
             {
@@ -920,8 +941,12 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES
} );
-            EntryFilteringCursor subentries = nexus.search( new SearchOperationContext( opContext.getSession(),
-                baseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+
+            SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(),
baseDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            EntryFilteringCursor subentries = nexus.search( searchOperationContext );
 
             while ( subentries.next() )
             {
@@ -1054,8 +1079,12 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { SchemaConstants.ALL_OPERATIONAL_ATTRIBUTES, SchemaConstants.ALL_USER_ATTRIBUTES
} );
-            EntryFilteringCursor subentries = nexus.search( new SearchOperationContext( opContext.getSession(),
-                oldBaseDn, AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+
+            SearchOperationContext searchOperationContext = new SearchOperationContext( opContext.getSession(),
oldBaseDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            EntryFilteringCursor subentries = nexus.search( searchOperationContext );
 
             while ( subentries.next() )
             {
@@ -1075,8 +1104,12 @@
             ServerEntry operational = getSubentryOperatationalAttributes( name, subentry
);
             DN newBaseDn = ( DN ) apName.clone();
             newBaseDn.addAll( ssNew.getBase() );
-            subentries = nexus.search( new SearchOperationContext( opContext.getSession(),
newBaseDn,
-                AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls ) );
+            
+            searchOperationContext = new SearchOperationContext( opContext.getSession(),
newBaseDn,
+                filter, controls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.NEVER_DEREF_ALIASES
);
+            
+            subentries = nexus.search( searchOperationContext );
             
             while ( subentries.next() )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?rev=918819&r1=918818&r2=918819&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
Thu Mar  4 02:26:48 2010
@@ -128,8 +128,12 @@
             adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping()
);
             CoreSession adminSession = new DefaultCoreSession( 
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService
);
-            EntryFilteringCursor results = nexus.search( new SearchOperationContext( 
-                adminSession, baseDn, AliasDerefMode.DEREF_ALWAYS, filter, ctls ) );
+
+            SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession,
baseDn,
+                filter, ctls );
+            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+            
+            EntryFilteringCursor results = nexus.search( searchOperationContext );
             
             while ( results.next() )
             {



Mime
View raw message