directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r530993 [1/2] - in /directory/apacheds/trunk/core/src: main/java/org/apache/directory/server/core/authn/ main/java/org/apache/directory/server/core/authz/ main/java/org/apache/directory/server/core/authz/support/ main/java/org/apache/direct...
Date Sat, 21 Apr 2007 08:18:51 GMT
Author: elecharny
Date: Sat Apr 21 01:18:50 2007
New Revision: 530993

URL: http://svn.apache.org/viewvc?view=rev&rev=530993
Log:
Modified the search() operation to use SearchOperationContext.

Added:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.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/collective/CollectiveAttributeService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java Sat Apr 21 01:18:50 2007
@@ -33,7 +33,7 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.AuthenticatorConfiguration;
@@ -52,7 +52,6 @@
 import org.apache.directory.server.core.jndi.LdapJndiProperties;
 import org.apache.directory.server.core.jndi.ServerContext;
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationException;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.MessageTypeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
@@ -396,16 +395,15 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter,
-        SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
         if ( IS_DEBUG )
         {
-            log.debug( "Search for base = '" + base.toString() + "'" );
+            log.debug( "Search for base = '" + opContext.getDn().getUpName() + "'" );
         }
 
         checkAuthenticated( MessageTypeEnum.SEARCH_REQUEST );
-        return next.search( base, env, filter, searchCtls );
+        return next.search( opContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java Sat Apr 21 01:18:50 2007
@@ -21,6 +21,20 @@
 
 
 
+import java.text.ParseException;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.authn.LdapPrincipal;
 import org.apache.directory.server.core.authz.support.ACDFEngine;
@@ -35,9 +49,10 @@
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.jndi.ServerContext;
@@ -53,31 +68,14 @@
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.NamingException;
-import javax.naming.NamingEnumeration;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-
-import java.text.ParseException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
 
 /**
  * An ACI based authorization service.
@@ -887,21 +885,23 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter,
-        SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
         ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
         LdapPrincipal user = ctx.getPrincipal();
         LdapDN principalDn = user.getJndiName();
-        NamingEnumeration e = next.search( base, env, filter, searchCtls );
+        NamingEnumeration<SearchResult> e = next.search( opContext );
+
+        boolean isSubschemaSubentryLookup = subschemaSubentryDn.equals( opContext.getDn().getNormName() );
+        SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+        boolean isRootDSELookup = opContext.getDn().size() == 0 && searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE;
 
-        boolean isSubschemaSubentryLookup = subschemaSubentryDn.equals( base.toNormName() );
-        boolean isRootDSELookup = base.size() == 0 && searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE;
         if ( isPrincipalAnAdministrator( principalDn ) || !enabled || isRootDSELookup || isSubschemaSubentryLookup )
         {
             return e;
         }
+        
         AuthorizationFilter authzFilter = new AuthorizationFilter();
         return new SearchResultFilteringEnumeration( e, searchCtls, invocation, authzFilter );
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java Sat Apr 21 01:18:50 2007
@@ -43,12 +43,12 @@
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.jndi.ServerContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.shared.ldap.exception.LdapNoPermissionException;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.OidNormalizer;
 
@@ -448,21 +448,18 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
-                                     SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
-        NamingEnumeration e = nextInterceptor.search( base, env, filter, searchCtls );
+        NamingEnumeration<SearchResult> e = nextInterceptor.search( opContext );
+
         if ( !enabled )
         {
             return e;
         }
-        //if ( searchCtls.getReturningAttributes() != null )
-        //{
-        //    return null;
-        //}
 
         Invocation invocation = InvocationStack.getInstance().peek();
-        return new SearchResultFilteringEnumeration( e, searchCtls, invocation, new SearchResultFilter()
+        return new SearchResultFilteringEnumeration( e, ((SearchOperationContext)opContext).getSearchControls(), invocation, 
+            new SearchResultFilter()
         {
             public boolean accept( Invocation invocation, SearchResult result, SearchControls controls )
                 throws NamingException

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?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- 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 Sat Apr 21 01:18:50 2007
@@ -29,6 +29,7 @@
 import java.util.Set;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
@@ -132,7 +133,8 @@
             LdapDN baseDn = new LdapDN( suffix );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );
+            NamingEnumeration<SearchResult> results = 
+                nexus.search( new SearchOperationContext( baseDn, env, filter, ctls ) );
 
             while ( results.hasMore() )
             {

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?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- 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 Sat Apr 21 01:18:50 2007
@@ -38,6 +38,7 @@
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -132,7 +133,9 @@
             ExprNode filter = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, ACSUBENTRY_OC, AssertionEnum.EQUALITY );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );
+            NamingEnumeration<SearchResult> results = 
+                nexus.search( new SearchOperationContext( baseDn, env, filter, ctls ) );
+            
             while ( results.hasMore() )
             {
                 SearchResult result = ( SearchResult ) results.next();
@@ -147,6 +150,7 @@
                 LdapDN normName = parseNormalized( subentryDn );
                 subentryAdded( subentryDn, normName, result.getAttributes() );
             }
+            
             results.close();
         }
     }

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?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- 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 Sat Apr 21 01:18:50 2007
@@ -30,7 +30,9 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
@@ -118,7 +120,7 @@
     public static final Collection SEARCH_BYPASS;
     static
     {
-        Collection c = new HashSet();
+        Collection<String> c = new HashSet<String>();
         c.add( "normalizationService" );
         c.add( "authenticationService" );
         c.add( "authorizationService" );
@@ -134,10 +136,12 @@
     private int getImmSubCount( PartitionNexusProxy proxy, LdapDN entryName ) throws NamingException
     {
         int cnt = 0;
-        NamingEnumeration e = null;
+        NamingEnumeration<SearchResult> e = null;
+        
         try
         {
-            e = proxy.search( ( LdapDN ) entryName.getPrefix( 1 ), new HashMap(), childrenFilter, childrenSearchControls,
+            e = proxy.search( 
+                new SearchOperationContext( ( LdapDN ) entryName.getPrefix( 1 ), new HashMap(), childrenFilter, childrenSearchControls ),
                 SEARCH_BYPASS );
 
             while ( e.hasMore() )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java Sat Apr 21 01:18:50 2007
@@ -42,6 +42,7 @@
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -312,12 +313,12 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
-        SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
-        NamingEnumeration e = nextInterceptor.search( base, env, filter, searchCtls );
+        NamingEnumeration<SearchResult> e = nextInterceptor.search( opContext );
         Invocation invocation = InvocationStack.getInstance().peek();
-        return new SearchResultFilteringEnumeration( e, searchCtls, invocation, SEARCH_FILTER );
+        return new SearchResultFilteringEnumeration( 
+            e, ((SearchOperationContext)opContext).getSearchControls(), invocation, SEARCH_FILTER );
     }
     
     // ------------------------------------------------------------------------

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java Sat Apr 21 01:18:50 2007
@@ -27,7 +27,7 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
@@ -37,11 +37,11 @@
 import org.apache.directory.server.core.interceptor.context.GetMatchedNameOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.Partition;
@@ -54,7 +54,6 @@
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -424,24 +423,24 @@
     /**
      * Checks to see the entry being searched exists, otherwise throws the appropriate LdapException.
      */
-    public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
-        SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
         String msg = "Attempt to search under non-existant entry: ";
+        LdapDN base = opContext.getDn();
 
         if ( base.size() == 0 )
         {
-            return nextInterceptor.search( base, env, filter, searchCtls );
+            return nextInterceptor.search( opContext );
         }
 
         if ( ( subschemSubentryDn.toNormName() ).equalsIgnoreCase( base.toNormName() ) )
         {
-            return nextInterceptor.search( base, env, filter, searchCtls );
+            return nextInterceptor.search( opContext );
         }
 
         assertHasEntry( nextInterceptor, msg, base );
 
-        return nextInterceptor.search( base, env, filter, searchCtls );
+        return nextInterceptor.search( opContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Sat Apr 21 01:18:50 2007
@@ -21,13 +21,12 @@
 
 
 import java.util.Iterator;
-import java.util.Map;
 
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 import javax.naming.ldap.LdapContext;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
@@ -36,7 +35,6 @@
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.jndi.ServerContext;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -176,10 +174,9 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter,
-                                     SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.search( base, env, filter, searchCtls );
+        return next.search( opContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java Sat Apr 21 01:18:50 2007
@@ -21,19 +21,17 @@
 
 
 import java.util.Iterator;
-import java.util.Map;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -177,16 +175,15 @@
 
 
     /**
-     * Filters {@link Partition#list(OperationContext)} call.
+     * Filters {@link Partition#list( OperationContext )} call.
      */
     NamingEnumeration list( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)} call.
+     * Filters {@link Partition#search( OperationContext )} call.
      */
-    NamingEnumeration search( NextInterceptor next, LdapDN baseName, Map environment, ExprNode filter,
-                              SearchControls searchControls ) throws NamingException;
+    NamingEnumeration<SearchResult> search( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Sat Apr 21 01:18:50 2007
@@ -31,7 +31,7 @@
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
@@ -41,7 +41,6 @@
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -125,22 +124,15 @@
         }
 
 
-        /*public void modify( NextInterceptor next, LdapDN name, ModificationItemImpl[] mods ) throws NamingException
-        {
-            nexus.modify( name, mods );
-        }*/
-
-
         public NamingEnumeration list( NextInterceptor next, OperationContext opContext ) throws NamingException
         {
             return nexus.list( opContext );
         }
 
 
-        public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter,
-            SearchControls searchCtls ) throws NamingException
+        public NamingEnumeration<SearchResult> search( NextInterceptor next, OperationContext opContext ) throws NamingException
         {
-            return nexus.search( base, env, filter, searchCtls );
+            return nexus.search( opContext );
         }
 
 
@@ -822,7 +814,7 @@
     }
 
 
-    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException
     {
         Entry entry = getStartingEntry();
@@ -831,7 +823,7 @@
         
         try
         {
-            return head.search( next, base, env, filter, searchCtls );
+            return head.search( next, opContext );
         }
         catch ( NamingException ne )
         {
@@ -1201,7 +1193,7 @@
                 }
 
 
-                public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
+                public NamingEnumeration<SearchResult> search( OperationContext opContext )
                     throws NamingException
                 {
                     Entry next = getNextEntry();
@@ -1209,7 +1201,7 @@
 
                     try
                     {
-                        return interceptor.search( next.nextInterceptor, base, env, filter, searchCtls );
+                        return interceptor.search( next.nextInterceptor, opContext );
                     }
                     catch ( NamingException ne )
                     {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java Sat Apr 21 01:18:50 2007
@@ -21,16 +21,14 @@
 
 
 import java.util.Iterator;
-import java.util.Map;
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 /**
@@ -109,9 +107,9 @@
 
 
     /**
-     * Calls the next interceptor's {@link Interceptor#search( NextInterceptor,org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)}.
+     * Calls the next interceptor's {@link Interceptor#search( NextInterceptor, OperationContext opContext )}.
      */
-    NamingEnumeration search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
+    NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException;
 
 

Added: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java?view=auto&rev=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java (added)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java Sat Apr 21 01:18:50 2007
@@ -0,0 +1,109 @@
+/*
+ *  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.server.core.interceptor.context;
+
+import java.util.Map;
+
+import javax.naming.directory.SearchControls;
+
+import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+/**
+ * A Search context used for Interceptors. It contains all the informations
+ * needed for the search operation, and used by all the interceptors
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchOperationContext extends AbstractOperationContext
+{
+    /** The search environment type */
+    private Map env;
+    
+    /** The filter */
+    private ExprNode filter;
+    
+    /** The controls */
+    private SearchControls searchControls;
+
+    /**
+     * 
+     * Creates a new instance of SearchOperationContext.
+     *
+     */
+    public SearchOperationContext()
+    {
+    	super();
+    }
+
+    /**
+     * 
+     * Creates a new instance of SearchOperationContext.
+     *
+     */
+    public SearchOperationContext( LdapDN dn, Map env, ExprNode filter, SearchControls searchControls )
+    {
+        super( dn );
+        this.env = env;
+        this.filter = filter;
+        this.searchControls = searchControls;
+    }
+
+    public Map getEnv()
+    {
+        return env;
+    }
+
+    public void setEnv( Map env )
+    {
+        this.env = env;
+    }
+
+    public ExprNode getFilter()
+    {
+        return filter;
+    }
+
+    public void setFilter( ExprNode filter )
+    {
+        this.filter = filter;
+    }
+
+    public SearchControls getSearchControls()
+    {
+        return searchControls;
+    }
+
+    public void setSearchControls( SearchControls searchControls )
+    {
+        this.searchControls = searchControls;
+    }
+
+    /**
+     * @see Object#toString()
+     */
+    public String toString()
+    {
+        return "SearchContext for DN '" + getDn().getUpName() + "', filter :'"
+        + filter + "'"; 
+    }
+
+}

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Sat Apr 21 01:18:50 2007
@@ -55,9 +55,10 @@
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.constants.JndiPropertyConstants;
@@ -730,7 +731,7 @@
         PresenceNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );
         SearchControls ctls = new SearchControls();
         ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        return nexusProxy.search( base, getEnvironment(), filter, ctls );
+        return nexusProxy.search( new SearchOperationContext( base, getEnvironment(), filter, ctls ) );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java Sat Apr 21 01:18:50 2007
@@ -49,6 +49,7 @@
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.filter.AssertionEnum;
@@ -536,7 +537,8 @@
         if ( null == matchingAttributes || matchingAttributes.size() <= 0 )
         {
             PresenceNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );
-            return getNexusProxy().search( target, getEnvironment(), filter, ctls );
+            return getNexusProxy().search( 
+                new SearchOperationContext( target, getEnvironment(), filter, ctls ) );
         }
 
         // Handle simple filter expressions without multiple terms
@@ -560,7 +562,8 @@
                     node = new SimpleNode( attr.getID(), ( String ) value, AssertionEnum.EQUALITY );
                 }
 
-                return getNexusProxy().search( target, getEnvironment(), node, ctls );
+                return getNexusProxy().search( 
+                    new SearchOperationContext( target, getEnvironment(), node, ctls ) );
             }
         }
         
@@ -606,7 +609,8 @@
             }
         }
 
-        return getNexusProxy().search( target, getEnvironment(), filter, ctls );
+        return getNexusProxy().search( 
+            new SearchOperationContext( target, getEnvironment(), filter, ctls ) );
     }
 
 
@@ -634,7 +638,8 @@
     public NamingEnumeration search( Name name, ExprNode filter, SearchControls cons ) throws NamingException
     {
         LdapDN target = buildTarget( name );
-        return getNexusProxy().search( target, getEnvironment(), filter, cons );
+        return getNexusProxy().search( 
+            new SearchOperationContext( target, getEnvironment(), filter, cons ) );
     }
 
 
@@ -665,7 +670,8 @@
             throw ne;
         }
 
-        return getNexusProxy().search( target, getEnvironment(), filterNode, cons );
+        return getNexusProxy().search( 
+            new SearchOperationContext( target, getEnvironment(), filterNode, cons ) );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java Sat Apr 21 01:18:50 2007
@@ -27,6 +27,7 @@
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
@@ -36,6 +37,7 @@
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.ConcreteNameComponentNormalizer;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -154,9 +156,11 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
-        SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
+        LdapDN base = opContext.getDn();
+        ExprNode filter = ((SearchOperationContext)opContext).getFilter();
+        
         base.normalize( attrNormalizers);
 
         if ( filter.isLeaf() )
@@ -330,7 +334,8 @@
             }
         }
         
-        return nextInterceptor.search( base, env, filter, searchCtls );
+        ((SearchOperationContext)opContext).setFilter( filter );
+        return nextInterceptor.search( opContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java Sat Apr 21 01:18:50 2007
@@ -23,7 +23,6 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import javax.naming.NamingEnumeration;
@@ -49,12 +48,12 @@
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
@@ -302,11 +301,12 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
-                                     SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
-        NamingEnumeration e = nextInterceptor.search( base, env, filter, searchCtls );
+        NamingEnumeration e = nextInterceptor.search( opContext );
+        SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+        
         if ( searchCtls.getReturningAttributes() != null )
         {
             if ( isDenormalizeOpAttrsEnabled )

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?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- 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 Sat Apr 21 01:18:50 2007
@@ -50,6 +50,7 @@
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.impl.btree.MutableBTreePartitionConfiguration;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -66,7 +67,6 @@
 import org.apache.directory.shared.ldap.message.AttributeImpl;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.message.ManageDsaITControl;
-import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.message.PersistentSearchControl;
 import org.apache.directory.shared.ldap.message.SubentriesControl;
 import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect;
@@ -723,6 +723,8 @@
 
 
     /**
+<<<<<<< .mine
+=======
      * @see Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[])
      */
     /*public void modify( LdapDN dn, ModificationItemImpl[] mods ) throws NamingException
@@ -733,6 +735,7 @@
 
 
     /**
+>>>>>>> .r530934
      * @see Partition#list(org.apache.directory.shared.ldap.name.LdapDN)
      */
     public NamingEnumeration list( OperationContext opContext ) throws NamingException
@@ -745,10 +748,13 @@
     /**
      * @see Partition#search(org.apache.directory.shared.ldap.name.LdapDN,java.util.Map,org.apache.directory.shared.ldap.filter.ExprNode,javax.naming.directory.SearchControls)
      */
-    public NamingEnumeration<SearchResult> search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException
     {
-
+        LdapDN base = opContext.getDn();
+        SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+        ExprNode filter = ((SearchOperationContext)opContext).getFilter();
+        
         if ( base.size() == 0 )
         {
             boolean isObjectScope = searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE;
@@ -884,7 +890,7 @@
         }
 
         Partition backend = getBackend( base );
-        return backend.search( base, env, filter, searchCtls );
+        return backend.search( opContext );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Sat Apr 21 01:18:50 2007
@@ -20,19 +20,15 @@
 package org.apache.directory.server.core.partition;
 
 
-import java.util.Map;
-
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -159,16 +155,13 @@
      * namespace specific or implementation specific key for the set of LDAP
      * Controls.
      *
-     * @param baseName the normalized distinguished/absolute name of the search base
-     * @param environment the environment under which operation occurs
-     * @param filter the root node of the filter expression tree
-     * @param searchControls the search controls
+     * @param opContext The context containing the information used by the operation
      * @throws NamingException if there are any problems
      * @return a NamingEnumeration containing objects of type 
      * <a href="http://java.sun.com/j2se/1.4.2/docs/api/
      * javax/naming/directory/SearchResult.html">SearchResult</a>.
      */
-    NamingEnumeration<SearchResult> search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
+    NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException;
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java Sat Apr 21 01:18:50 2007
@@ -24,7 +24,6 @@
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Map;
 import java.util.Set;
 
 import javax.naming.Context;
@@ -33,7 +32,6 @@
 import javax.naming.NamingException;
 import javax.naming.ServiceUnavailableException;
 import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.event.EventContext;
@@ -48,6 +46,7 @@
 import org.apache.directory.server.core.event.EventService;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.shared.ldap.exception.LdapSizeLimitExceededException;
@@ -83,15 +82,6 @@
     /** Bypass String to use when ALL interceptors should be skipped */
     public static final Collection BYPASS_ALL_COLLECTION = Collections.singleton( BYPASS_ALL );
     
-    /** Integer const for DirContext.ADD_ATTRIBUTE */
-    private static final Integer ADD_MODOP = new Integer( DirContext.ADD_ATTRIBUTE );
-    
-    /** Integer const for DirContext.REMOVE_ATTRIBUTE */
-    private static final Integer REMOVE_MODOP = new Integer( DirContext.REMOVE_ATTRIBUTE );
-    
-    /** Integer const for DirContext.REPLACE_ATTRIBUTE */
-    private static final Integer REPLACE_MODOP = new Integer( DirContext.REPLACE_ATTRIBUTE );
-
     private final Context caller;
     private final DirectoryService service;
     private final DirectoryServiceConfiguration configuration;
@@ -355,9 +345,9 @@
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
-        
         stack.push( new Invocation( this, caller, "modify", new Object[]
             { opContext }, bypass ) );
+        
         try
         {
             this.configuration.getInterceptorChain().modify( opContext );
@@ -392,14 +382,16 @@
     }
 
 
-    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException
     {
-        NamingEnumeration ne = search( base, env, filter, searchCtls, null );
+        NamingEnumeration<SearchResult> ne = search( opContext, null );
 
         if ( ne instanceof SearchResultFilteringEnumeration )
         {
             SearchResultFilteringEnumeration results = ( SearchResultFilteringEnumeration ) ne;
+            SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+            
             if ( searchCtls.getTimeLimit() + searchCtls.getCountLimit() > 0 )
             {
                 // this will be he last filter added so other filters before it must 
@@ -437,20 +429,21 @@
                 } );
             }
         }
+        
         return ne;
     }
 
 
-    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls, Collection bypass )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext, Collection bypass )
         throws NamingException
     {
         ensureStarted();
         InvocationStack stack = InvocationStack.getInstance();
         stack.push( new Invocation( this, caller, "search", new Object[]
-            { base, env, filter, searchCtls }, bypass ) );
+            { opContext }, bypass ) );
         try
         {
-            return this.configuration.getInterceptorChain().search( base, env, filter, searchCtls );
+            return this.configuration.getInterceptorChain().search( opContext );
         }
         finally
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Sat Apr 21 01:18:50 2007
@@ -22,7 +22,6 @@
 
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Map;
 import java.util.Set;
 
 import javax.naming.NamingEnumeration;
@@ -30,6 +29,7 @@
 import javax.naming.directory.Attribute;
 import javax.naming.directory.Attributes;
 import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
 
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
@@ -37,6 +37,7 @@
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.Oid;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.gui.PartitionViewer;
@@ -45,7 +46,6 @@
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.exception.LdapContextNotEmptyException;
 import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException;
-import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.message.AttributesImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
@@ -421,13 +421,18 @@
     }
 
 
-    public NamingEnumeration search( LdapDN base, Map env, ExprNode filter, SearchControls searchCtls )
+    public NamingEnumeration<SearchResult> search( OperationContext opContext )
         throws NamingException
     {
+        SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
         String[] attrIds = searchCtls.getReturningAttributes();
         NamingEnumeration underlying = null;
 
-        underlying = searchEngine.search( base, env, filter, searchCtls );
+        underlying = searchEngine.search( 
+            opContext.getDn(), 
+            ((SearchOperationContext)opContext).getEnv(), 
+            ((SearchOperationContext)opContext).getFilter(), 
+            searchCtls );
 
         return new BTreeSearchResultEnumeration( attrIds, underlying, this, attributeTypeRegistry );
     }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java Sat Apr 21 01:18:50 2007
@@ -27,7 +27,6 @@
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 
 import javax.naming.Context;
 import javax.naming.NamingEnumeration;
@@ -48,11 +47,12 @@
 import org.apache.directory.server.core.interceptor.context.AddContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.jndi.ServerLdapContext;
@@ -61,9 +61,8 @@
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
-
-import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
@@ -76,7 +75,6 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -181,7 +179,9 @@
         while ( suffixes.hasNext() )
         {
             LdapDN suffix = new LdapDN( ( String ) suffixes.next() );
-            addReferrals( nexus.search( suffix, env, getReferralFilter(), getControls() ), suffix );
+            addReferrals( 
+                nexus.search( 
+                    new SearchOperationContext( suffix, env, getReferralFilter(), getControls() ) ), suffix );
         }
     }
 
@@ -776,7 +776,8 @@
         Partition partition = ((AddContextPartitionOperationContext)opContext).getCfg().getContextPartition();
         LdapDN suffix = partition.getSuffix();
         Invocation invocation = InvocationStack.getInstance().peek();
-        NamingEnumeration list = invocation.getProxy().search( suffix, env, getReferralFilter(), getControls(),
+        NamingEnumeration list = invocation.getProxy().search( 
+            new SearchOperationContext( suffix, env, getReferralFilter(), getControls() ),
             SEARCH_BYPASS );
         addReferrals( list, suffix );
     }
@@ -787,10 +788,11 @@
         // remove referrals immediately before removing the partition
         Invocation invocation = InvocationStack.getInstance().peek();
         NamingEnumeration list = invocation.getProxy().search( 
-            opContext.getDn(), 
-            env, 
-            getReferralFilter(), 
-            getControls(),
+            new SearchOperationContext( 
+                opContext.getDn(), 
+                env, 
+                getReferralFilter(), 
+                getControls() ),
             SEARCH_BYPASS );
         
         deleteReferrals( list, opContext.getDn() );
@@ -849,7 +851,7 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter, SearchControls controls )
+    public NamingEnumeration<SearchResult> search( NextInterceptor next, OperationContext opContext )
         throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
@@ -859,8 +861,12 @@
         // handle a normal modify without following referrals
         if ( refval == null || refval.equals( IGNORE ) )
         {
-            return next.search( base, env, filter, controls );
+            return next.search( opContext );
         }
+        
+        LdapDN base = opContext.getDn();
+        SearchControls controls = ((SearchOperationContext)opContext).getSearchControls();
+        
 
         /**
          * THROW_FINDING_BASE is a special setting which allows for finding base to 
@@ -877,9 +883,10 @@
             }
 
             LdapDN farthest = lut.getFarthestReferralAncestor( base );
+            
             if ( farthest == null )
             {
-                return next.search( base, env, filter, controls );
+                return next.search( opContext );
             }
 
             Attributes referral = invocation.getProxy().lookup( new LookupOperationContext( farthest ), PartitionNexusProxy.LOOKUP_BYPASS );
@@ -887,6 +894,7 @@
             doReferralExceptionOnSearchBase( farthest, new LdapDN( base.getUpName() ), refs, controls.getSearchScope() );
             throw new IllegalStateException( "Should never get here: shutting up compiler" );
         }
+        
         if ( refval.equals( THROW ) )
         {
             if ( lut.isReferral( base ) )
@@ -897,10 +905,11 @@
             }
 
             LdapDN farthest = lut.getFarthestReferralAncestor( base );
+            
             if ( farthest == null )
             {
-                SearchResultFilteringEnumeration srfe = ( SearchResultFilteringEnumeration ) next.search( base, env,
-                    filter, controls );
+                SearchResultFilteringEnumeration srfe = 
+                    ( SearchResultFilteringEnumeration ) next.search( opContext );
                 return new ReferralHandlingEnumeration( srfe, lut, attrRegistry, nexus, controls.getSearchScope(), true );
             }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java Sat Apr 21 01:18:50 2007
@@ -37,6 +37,7 @@
 import org.apache.directory.server.constants.MetaSchemaConstants;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.bootstrap.Schema;
@@ -190,7 +191,8 @@
         SearchControls searchControls = new SearchControls();
         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
         searchControls.setReturningAttributes( SCHEMA_ATTRIBUTES );
-        return partition.search( base, new HashMap(), filter, searchControls );
+        return partition.search( 
+            new SearchOperationContext( base, new HashMap(), filter, searchControls ) );
     }
 
 
@@ -229,7 +231,8 @@
 
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -272,7 +275,8 @@
 
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -315,7 +319,8 @@
 
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -358,7 +363,8 @@
 
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -401,7 +407,8 @@
 
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -492,7 +499,8 @@
         
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             
             if ( ! ne.hasMore() )
             {
@@ -608,7 +616,8 @@
         
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -657,7 +666,8 @@
         
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -684,7 +694,8 @@
         // (& (m-oid=*) (m-name=*) )
         filter.addNode( new PresenceNode( M_OID_OID ) );
         filter.addNode( new PresenceNode( M_NAME_OID ) );
-        return partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+        return partition.search( 
+            new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
     }
 
 
@@ -732,7 +743,8 @@
         
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -779,7 +791,8 @@
         
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );
@@ -820,7 +833,8 @@
         
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             while( ne.hasMore() )
             {
                 SearchResult sr = ne.next();
@@ -899,7 +913,8 @@
         
         try
         {
-            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            ne = partition.search( 
+                new SearchOperationContext( partition.getSuffix(), new HashMap(), filter, searchControls ) );
             while( ne.hasMore() )
             {
                 set.add( ne.next() );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java Sat Apr 21 01:18:50 2007
@@ -54,6 +54,7 @@
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -450,9 +451,12 @@
     /**
      * 
      */
-    public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
-        SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
+        LdapDN base = opContext.getDn();
+        SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
+        ExprNode filter = ((SearchOperationContext)opContext).getFilter();
+        
         // We have to eliminate bad attributes from the request, accordingly
         // to RFC 2251, chap. 4.5.1. Basically, all unknown attributes are removed
         // from the list
@@ -461,7 +465,7 @@
         // Deal with the normal case : searching for a normal value (not subSchemaSubEntry
         if ( !subschemaSubentryDn.toNormName().equals( base.toNormName() ) )
         {
-            NamingEnumeration e = nextInterceptor.search( base, env, filter, searchCtls );
+            NamingEnumeration e = nextInterceptor.search( opContext );
             
             Invocation invocation = InvocationStack.getInstance().peek();
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java Sat Apr 21 01:18:50 2007
@@ -25,6 +25,17 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.Control;
+import javax.naming.ldap.LdapContext;
+
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.enumeration.SearchResultFilter;
@@ -33,17 +44,17 @@
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
-import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveAndRenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.invocation.Invocation;
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
-
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.shared.ldap.exception.LdapNoSuchAttributeException;
@@ -63,21 +74,9 @@
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationParser;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.DirContext;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.SearchResult;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.LdapContext;
-import javax.naming.NamingException;
-import javax.naming.NamingEnumeration;
-import javax.naming.Name;
-
 
 /**
  * The Subentry interceptor service which is responsible for filtering
@@ -157,7 +156,8 @@
             LdapDN suffix = new LdapDN( ( String ) suffixes.next() );
             //suffix = LdapDN.normalize( suffix, registry.getNormalizerMapping() );
             suffix.normalize( attrRegistry.getNormalizerMapping() );
-            NamingEnumeration subentries = nexus.search( suffix, factoryCfg.getEnvironment(), filter, controls );
+            NamingEnumeration subentries = nexus.search( 
+                new SearchOperationContext( suffix, factoryCfg.getEnvironment(), filter, controls ) );
             while ( subentries.hasMore() )
             {
                 SearchResult result = ( SearchResult ) subentries.next();
@@ -239,11 +239,11 @@
     }
 
 
-    public NamingEnumeration search( NextInterceptor nextInterceptor, LdapDN base, Map env, ExprNode filter,
-        SearchControls searchCtls ) throws NamingException
+    public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
-        NamingEnumeration e = nextInterceptor.search( base, env, filter, searchCtls );
+        NamingEnumeration e = nextInterceptor.search( opContext );
         Invocation invocation = InvocationStack.getInstance().peek();
+        SearchControls searchCtls = ((SearchOperationContext)opContext).getSearchControls();
 
         // object scope searches by default return subentries
         if ( searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE )
@@ -450,7 +450,9 @@
             controls.setReturningAttributes( new String[]
                 { "+", "*" } );
 
-            NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls );
+            NamingEnumeration subentries = 
+                nexus.search( 
+                    new SearchOperationContext( baseDn, factoryCfg.getEnvironment(), filter, controls ) );
 
             while ( subentries.hasMore() )
             {
@@ -575,7 +577,9 @@
             controls.setReturningAttributes( new String[]
                 { "+", "*" } );
 
-            NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls );
+            NamingEnumeration subentries = 
+                nexus.search( 
+                    new SearchOperationContext( baseDn, factoryCfg.getEnvironment(), filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -615,7 +619,9 @@
         ExprNode filter = new PresenceNode( "administrativeRole" );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-        NamingEnumeration aps = nexus.search( name, factoryCfg.getEnvironment(), filter, controls );
+        NamingEnumeration aps = 
+            nexus.search( 
+                new SearchOperationContext( name, factoryCfg.getEnvironment(), filter, controls ) );
         if ( aps.hasMore() )
         {
             aps.close();
@@ -732,7 +738,9 @@
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[] { "+", "*" } );
-            NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls );
+            NamingEnumeration subentries = 
+                nexus.search( 
+                    new SearchOperationContext( baseDn, factoryCfg.getEnvironment(), filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -811,7 +819,9 @@
             SearchControls controls = new SearchControls();
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[] { "+", "*" } );
-            NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls );
+            NamingEnumeration subentries = 
+                nexus.search( 
+                    new SearchOperationContext( baseDn, factoryCfg.getEnvironment(), filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -884,7 +894,9 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { "+", "*" } );
-            NamingEnumeration subentries = nexus.search( baseDn, factoryCfg.getEnvironment(), filter, controls );
+            NamingEnumeration subentries = 
+                nexus.search( 
+                    new SearchOperationContext( baseDn, factoryCfg.getEnvironment(), filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -1049,7 +1061,9 @@
             controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             controls.setReturningAttributes( new String[]
                 { "+", "*" } );
-            NamingEnumeration subentries = nexus.search( oldBaseDn, factoryCfg.getEnvironment(), filter, controls );
+            NamingEnumeration subentries = 
+                nexus.search( 
+                    new SearchOperationContext( oldBaseDn, factoryCfg.getEnvironment(), filter, controls ) );
             
             while ( subentries.hasMore() )
             {
@@ -1069,7 +1083,8 @@
             Attributes operational = getSubentryOperatationalAttributes( name, subentry );
             LdapDN newBaseDn = ( LdapDN ) apName.clone();
             newBaseDn.addAll( ssNew.getBase() );
-            subentries = nexus.search( newBaseDn, factoryCfg.getEnvironment(), filter, controls );
+            subentries = nexus.search( 
+                new SearchOperationContext( newBaseDn, factoryCfg.getEnvironment(), filter, controls ) );
             while ( subentries.hasMore() )
             {
                 SearchResult result = ( SearchResult ) 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?view=diff&rev=530993&r1=530992&r2=530993
==============================================================================
--- 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 Sat Apr 21 01:18:50 2007
@@ -40,6 +40,7 @@
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
+import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -121,7 +122,9 @@
             ExprNode filter = new SimpleNode( SchemaConstants.OBJECT_CLASS_AT, TRIGGER_SUBENTRY_OC, AssertionEnum.EQUALITY );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
-            NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );
+            NamingEnumeration results = 
+                nexus.search( 
+                    new SearchOperationContext( baseDn, env, filter, ctls ) );
             
             while ( results.hasMore() )
             {



Mime
View raw message