directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r541123 [7/25] - in /directory/apacheds/branches/apacheds-sasl-branch: ./ benchmarks/ bootstrap-extract/ bootstrap-extract/src/ bootstrap-extract/src/main/ bootstrap-extract/src/main/java/ bootstrap-extract/src/main/java/org/ bootstrap-extr...
Date Thu, 24 May 2007 00:27:07 GMT
Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java Wed May 23 17:26:40 2007
@@ -46,6 +46,8 @@
 import org.apache.directory.server.core.subtree.SubentryService;
 import org.apache.directory.server.core.trigger.TriggerService;
 import org.apache.directory.shared.ldap.ldif.Entry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -56,6 +58,11 @@
  */
 public class StartupConfiguration extends Configuration
 {
+    private static final Logger log = LoggerFactory.getLogger( StartupConfiguration.class );
+
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
+
     private static final long serialVersionUID = 4826762196566871677L;
 
     public static final int MAX_THREADS_DEFAULT = 4;
@@ -102,25 +109,14 @@
     {
         Set<AuthenticatorConfiguration> set = new HashSet<AuthenticatorConfiguration>();
 
-        MutableAuthenticatorConfiguration authCfg;
-
         // Anonymous
-        authCfg = new MutableAuthenticatorConfiguration();
-        authCfg.setName( "Anonymous" );
-        authCfg.setAuthenticator( new AnonymousAuthenticator() );
-        set.add( authCfg );
+        set.add( new MutableAuthenticatorConfiguration( "Anonymous", new AnonymousAuthenticator() ) );
 
         // Simple
-        authCfg = new MutableAuthenticatorConfiguration();
-        authCfg.setName( "Simple" );
-        authCfg.setAuthenticator( new SimpleAuthenticator() );
-        set.add( authCfg );
+        set.add( new MutableAuthenticatorConfiguration( "Simple", new SimpleAuthenticator() ) );
 
         // Strong
-        authCfg = new MutableAuthenticatorConfiguration();
-        authCfg.setName( "Strong" );
-        authCfg.setAuthenticator( new StrongAuthenticator() );
-        set.add( authCfg );
+        set.add( new MutableAuthenticatorConfiguration( "Strong", new StrongAuthenticator() ) );
 
         setAuthenticatorConfigurations( set );
     }
@@ -133,12 +129,12 @@
         List<InterceptorConfiguration> list = new ArrayList<InterceptorConfiguration>();
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "normalizationService" );
+        interceptorCfg.setName( NormalizationService.NAME );
         interceptorCfg.setInterceptor( new NormalizationService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "authenticationService" );
+        interceptorCfg.setName( AuthenticationService.NAME );
         interceptorCfg.setInterceptor( new AuthenticationService() );
         list.add( interceptorCfg );
 
@@ -148,47 +144,47 @@
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "authorizationService" );
+        interceptorCfg.setName( AuthorizationService.NAME );
         interceptorCfg.setInterceptor( new AuthorizationService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "defaultAuthorizationService" );
+        interceptorCfg.setName( DefaultAuthorizationService.NAME );
         interceptorCfg.setInterceptor( new DefaultAuthorizationService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "exceptionService" );
+        interceptorCfg.setName( ExceptionService.NAME );
         interceptorCfg.setInterceptor( new ExceptionService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "operationalAttributeService" );
+        interceptorCfg.setName( OperationalAttributeService.NAME );
         interceptorCfg.setInterceptor( new OperationalAttributeService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "schemaService" );
+        interceptorCfg.setName( SchemaService.NAME );
         interceptorCfg.setInterceptor( new SchemaService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "subentryService" );
+        interceptorCfg.setName( SubentryService.NAME );
         interceptorCfg.setInterceptor( new SubentryService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "collectiveAttributeService" );
+        interceptorCfg.setName( CollectiveAttributeService.NAME );
         interceptorCfg.setInterceptor( new CollectiveAttributeService() );
         list.add( interceptorCfg );
 
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "eventService" );
+        interceptorCfg.setName( EventService.NAME );
         interceptorCfg.setInterceptor( new EventService() );
         list.add( interceptorCfg );
         
         interceptorCfg = new MutableInterceptorConfiguration();
-        interceptorCfg.setName( "triggerService" );
+        interceptorCfg.setName( TriggerService.NAME );
         interceptorCfg.setInterceptor( new TriggerService() );
         list.add( interceptorCfg );
 
@@ -208,26 +204,30 @@
     /**
      * Sets {@link AuthenticatorConfiguration}s to use for authenticating clients.
      */
-    protected void setAuthenticatorConfigurations( Set authenticatorConfigurations )
+    protected void setAuthenticatorConfigurations( Set<AuthenticatorConfiguration> authenticatorConfigurations )
     {
-        Set newSet = ConfigurationUtil.getTypeSafeSet( authenticatorConfigurations, AuthenticatorConfiguration.class );
+        Set<String> names = new HashSet<String>();
 
-        Set names = new HashSet();
-        Iterator i = newSet.iterator();
-        while ( i.hasNext() )
+        // Loop through all the configurations to check if we do not have duplicated authenticators.
+        for ( AuthenticatorConfiguration cfg:authenticatorConfigurations )
         {
-            AuthenticatorConfiguration cfg = ( AuthenticatorConfiguration ) i.next();
             cfg.validate();
 
             String name = cfg.getName();
+
             if ( names.contains( name ) )
             {
+                // TODO Not sure that it worth to throw an excpetion here. We could simply ditch the
+                // duplicated authenticator, trace a warning and that's it. 
+                log.error( "The authenticator nammed '{}' has already been registred.", name );
                 throw new ConfigurationException( "Duplicate authenticator name: " + name );
             }
+            
             names.add( name );
         }
 
-        this.authenticatorConfigurations = newSet;
+        // The set has been checked, so we can now register it
+        this.authenticatorConfigurations = authenticatorConfigurations;
     }
 
 

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java Wed May 23 17:26:40 2007
@@ -31,6 +31,7 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
+import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.referral.ReferralLut;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
@@ -175,7 +176,7 @@
         {
             LdapDN prefetchedDn = new LdapDN( prefetched.getName() );
             prefetchedDn.normalize( normalizerMap );
-            refs = nexus.lookup( prefetchedDn ).get( REF_ATTR );
+            refs = nexus.lookup( new LookupOperationContext( prefetchedDn ) ).get( REF_ATTR );
         }
 
         if ( refs == null )

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java Wed May 23 17:26:40 2007
@@ -60,22 +60,30 @@
 
     /** the list of filters to be applied */
     private final List filters;
+    
     /** the underlying decorated enumeration */
     private final NamingEnumeration decorated;
 
     /** the first accepted search result that is prefetched */
     private SearchResult prefetched;
+    
     /** flag storing closed state of this naming enumeration */
     private boolean isClosed = false;
+    
     /** the controls associated with the search operation */
     private final SearchControls searchControls;
+    
     /** the Invocation that representing the search creating this enumeration */
     private final Invocation invocation;
+    
     /** whether or not the caller context has object factories which need to be applied to the results */
     private final boolean applyObjectFactories;
+    
     /** whether or not this search has been abandoned */
     private boolean abandoned = false;
 
+    /** A name used to distinguish enumeration while debugging */
+    private String name;
 
     // ------------------------------------------------------------------------
     // C O N S T R U C T O R S
@@ -91,7 +99,7 @@
      * @param invocation the invocation representing the seach that created this enumeration
      */
     public SearchResultFilteringEnumeration( NamingEnumeration decorated, SearchControls searchControls,
-        Invocation invocation, SearchResultFilter filter ) throws NamingException
+        Invocation invocation, SearchResultFilter filter, String name ) throws NamingException
     {
         this.searchControls = searchControls;
         this.invocation = invocation;
@@ -99,6 +107,7 @@
         this.filters.add( filter );
         this.decorated = decorated;
         this.applyObjectFactories = invocation.getCaller().getEnvironment().containsKey( Context.OBJECT_FACTORIES );
+        this.name = name;
 
         if ( !decorated.hasMore() )
         {
@@ -120,7 +129,7 @@
      * @param invocation the invocation representing the seach that created this enumeration
      */
     public SearchResultFilteringEnumeration( NamingEnumeration decorated, SearchControls searchControls,
-        Invocation invocation, List filters ) throws NamingException
+        Invocation invocation, List filters, String name ) throws NamingException
     {
         this.searchControls = searchControls;
         this.invocation = invocation;
@@ -128,6 +137,8 @@
         this.filters.addAll( filters );
         this.decorated = decorated;
         this.applyObjectFactories = invocation.getCaller().getEnvironment().containsKey( Context.OBJECT_FACTORIES );
+        this.name = name;
+        
 
         if ( !decorated.hasMore() )
         {
@@ -343,5 +354,10 @@
     public void requestAbandoned( AbandonableRequest req )
     {
         this.abandoned = true;
+    }
+    
+    public String toString()
+    {
+    	return name;
     }
 }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/event/EventService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/event/EventService.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/event/EventService.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/event/EventService.java Wed May 23 17:26:40 2007
@@ -29,10 +29,28 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.naming.Binding;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.SearchControls;
+import javax.naming.event.EventContext;
+import javax.naming.event.NamespaceChangeListener;
+import javax.naming.event.NamingEvent;
+import javax.naming.event.NamingListener;
+import javax.naming.event.ObjectChangeListener;
+
 import org.apache.directory.server.core.DirectoryServiceConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 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.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.normalization.NormalizingVisitor;
@@ -50,23 +68,9 @@
 import org.apache.directory.shared.ldap.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.NameComponentNormalizer;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.Binding;
-import javax.naming.NamingEnumeration;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.SearchControls;
-import javax.naming.directory.Attribute;
-import javax.naming.event.EventContext;
-import javax.naming.event.NamespaceChangeListener;
-import javax.naming.event.NamingEvent;
-import javax.naming.event.NamingListener;
-import javax.naming.event.ObjectChangeListener;
-
 
 /**
  * An interceptor based serivice for notifying NamingListeners of EventContext
@@ -78,6 +82,10 @@
 public class EventService extends BaseInterceptor
 {
     private static Logger log = LoggerFactory.getLogger( EventService.class );
+    
+    /** The service name */
+    public static final String NAME = "eventService";
+    
     private PartitionNexus nexus;
     private Map sources = new HashMap();
     private Evaluator evaluator = null;
@@ -229,16 +237,21 @@
     }
 
 
-    public void add( NextInterceptor next, LdapDN normName, Attributes entry ) throws NamingException
+    public void add( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        super.add( next, normName, entry );
-        Set selecting = getSelectingSources( normName, entry );
+        super.add( next, opContext );
+        LdapDN name = opContext.getDn();
+        Attributes entry = ((AddOperationContext)opContext).getEntry();
+        
+        Set selecting = getSelectingSources( name, entry );
+        
         if ( selecting.isEmpty() )
         {
             return;
         }
 
         Iterator list = selecting.iterator();
+        
         while ( list.hasNext() )
         {
             EventSourceRecord rec = ( EventSourceRecord ) list.next();
@@ -247,7 +260,7 @@
             if ( listener instanceof NamespaceChangeListener )
             {
                 NamespaceChangeListener nclistener = ( NamespaceChangeListener ) listener;
-                Binding binding = new Binding( normName.getUpName(), entry, false );
+                Binding binding = new Binding( name.getUpName(), entry, false );
                 nclistener.objectAdded( new NamingEvent( rec.getEventContext(), NamingEvent.OBJECT_ADDED, binding,
                     null, entry ) );
             }
@@ -255,17 +268,20 @@
     }
 
 
-    public void delete( NextInterceptor next, LdapDN name ) throws NamingException
+    public void delete( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        Attributes entry = nexus.lookup( name );
-        super.delete( next, name );
+    	LdapDN name = opContext.getDn();
+        Attributes entry = nexus.lookup( new LookupOperationContext( name ) );
+        super.delete( next, opContext );
         Set selecting = getSelectingSources( name, entry );
+        
         if ( selecting.isEmpty() )
         {
             return;
         }
 
         Iterator list = selecting.iterator();
+        
         while ( list.hasNext() )
         {
             EventSourceRecord rec = ( EventSourceRecord ) list.next();
@@ -284,7 +300,7 @@
 
     private void notifyOnModify( LdapDN name, ModificationItemImpl[] mods, Attributes oriEntry ) throws NamingException
     {
-        Attributes entry = nexus.lookup( name );
+        Attributes entry = nexus.lookup( new LookupOperationContext( name ) );
         Set selecting = getSelectingSources( name, entry );
         if ( selecting.isEmpty() )
         {
@@ -309,37 +325,19 @@
     }
 
 
-    public void modify( NextInterceptor next, LdapDN name, int modOp, Attributes mods ) throws NamingException
+    public void modify( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes oriEntry = proxy.lookup( name, PartitionNexusProxy.LOOKUP_BYPASS );
-        super.modify( next, name, modOp, mods );
-
-        // package modifications in ModItem format for event delivery
-        ModificationItemImpl[] modItems = new ModificationItemImpl[mods.size()];
-        NamingEnumeration list = mods.getAll();
-        for ( int ii = 0; ii < modItems.length; ii++ )
-        {
-            modItems[ii] = new ModificationItemImpl( modOp, ( Attribute ) list.next() );
-        }
-        notifyOnModify( name, modItems, oriEntry );
-    }
-
-
-    public void modify( NextInterceptor next, LdapDN name, ModificationItemImpl[] mods ) throws NamingException
-    {
-        Invocation invocation = InvocationStack.getInstance().peek();
-        PartitionNexusProxy proxy = invocation.getProxy();
-        Attributes oriEntry = proxy.lookup( name, PartitionNexusProxy.LOOKUP_BYPASS );
-        super.modify( next, name, mods );
-        notifyOnModify( name, mods, oriEntry );
+        Attributes oriEntry = proxy.lookup( new LookupOperationContext( opContext.getDn() ), PartitionNexusProxy.LOOKUP_BYPASS );
+        super.modify( next, opContext );
+        notifyOnModify( opContext.getDn(), ((ModifyOperationContext)opContext).getModItems(), oriEntry );
     }
 
 
     private void notifyOnNameChange( LdapDN oldName, LdapDN newName ) throws NamingException
     {
-        Attributes entry = nexus.lookup( newName );
+        Attributes entry = nexus.lookup( new LookupOperationContext( newName ) );
         Set selecting = getSelectingSources( oldName, entry );
         if ( selecting.isEmpty() )
         {
@@ -364,31 +362,33 @@
     }
 
 
-    public void modifyRn( NextInterceptor next, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException
+    public void rename( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        super.modifyRn( next, name, newRn, deleteOldRn );
-        LdapDN newName = ( LdapDN ) name.clone();
+        super.rename( next, opContext );
+        LdapDN newName = ( LdapDN ) opContext.getDn().clone();
         newName.remove( newName.size() - 1 );
-        newName.add( newRn );
+        newName.add( ((RenameOperationContext)opContext).getNewRdn() );
         newName.normalize( attributeRegistry.getNormalizerMapping() );
-        notifyOnNameChange( name, newName );
+        notifyOnNameChange( opContext.getDn(), newName );
     }
 
 
-    public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn )
+    public void moveAndRename( NextInterceptor next, OperationContext opContext )
         throws NamingException
     {
-        super.move( next, oriChildName, newParentName, newRn, deleteOldRn );
-        LdapDN newName = ( LdapDN ) newParentName.clone();
-        newName.add( newRn );
-        notifyOnNameChange( oriChildName, newName );
+        super.moveAndRename( next, opContext );
+        LdapDN newName = ( LdapDN ) ((MoveAndRenameOperationContext)opContext).getParent().clone();
+        newName.add( ((MoveAndRenameOperationContext)opContext).getNewRdn() );
+        notifyOnNameChange( opContext.getDn(), newName );
     }
 
 
-    public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName ) throws NamingException
+    public void move( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        super.move( next, oriChildName, newParentName );
-        LdapDN newName = ( LdapDN ) newParentName.clone();
+        super.move( next, opContext );
+        LdapDN oriChildName = opContext.getDn();
+        
+        LdapDN newName = ( LdapDN ) ((MoveOperationContext)opContext).getParent().clone();
         newName.add( oriChildName.get( oriChildName.size() - 1 ) );
         notifyOnNameChange( oriChildName, newName );
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java Wed May 23 17:26:40 2007
@@ -27,24 +27,33 @@
 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;
 import org.apache.directory.server.core.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.interceptor.NextInterceptor;
+import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
+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.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;
 import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapAttributeInUseException;
 import org.apache.directory.shared.ldap.exception.LdapContextNotEmptyException;
 import org.apache.directory.shared.ldap.exception.LdapNameAlreadyBoundException;
 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;
@@ -63,6 +72,9 @@
  */
 public class ExceptionService extends BaseInterceptor
 {
+    /** The service name */
+    public static final String NAME = "exceptionService";
+
     private PartitionNexus nexus;
     private LdapDN subschemSubentryDn;
     
@@ -83,7 +95,7 @@
     {
         nexus = factoryCfg.getPartitionNexus();
         normalizerMap = factoryCfg.getRegistries().getAttributeTypeRegistry().getNormalizerMapping();
-        Attribute attr = nexus.getRootDSE().get( "subschemaSubentry" );
+        Attribute attr = nexus.getRootDSE( null ).get( "subschemaSubentry" );
         subschemSubentryDn = new LdapDN( ( String ) attr.get() );
         subschemSubentryDn.normalize( normalizerMap );
     }
@@ -98,52 +110,55 @@
      * In the pre-invocation state this interceptor method checks to see if the entry to be added already exists.  If it
      * does an exception is raised.
      */
-    public void add( NextInterceptor nextInterceptor, LdapDN normName, Attributes entry )
+    public void add( NextInterceptor nextInterceptor, OperationContext opContext )
         throws NamingException
     {
-        if ( subschemSubentryDn.getNormName().equals( normName.getNormName() ) )
+    	LdapDN name = opContext.getDn();
+    	
+        if ( subschemSubentryDn.getNormName().equals( name.getNormName() ) )
         {
             throw new LdapNameAlreadyBoundException( 
                 "The global schema subentry cannot be added since it exists by default." );
         }
         
         // check if the entry already exists
-        if ( nextInterceptor.hasEntry( normName ) )
+        if ( nextInterceptor.hasEntry( new EntryOperationContext( name ) ) )
         {
-            NamingException ne = new LdapNameAlreadyBoundException( normName.toString() + " already exists!" );
-            ne.setResolvedName( new LdapDN( normName.getUpName() ) );
+            NamingException ne = new LdapNameAlreadyBoundException( name.getUpName() + " already exists!" );
+            ne.setResolvedName( new LdapDN( name.getUpName() ) );
             throw ne;
         }
 
-        LdapDN parentDn = ( LdapDN ) normName.clone();
-        parentDn.remove( normName.size() - 1 );
+        LdapDN parentDn = ( LdapDN ) name.clone();
+        parentDn.remove( name.size() - 1 );
 
         // check if we're trying to add to a parent that is an alias
         Attributes attrs = null;
         
         try
         {
-            attrs = nextInterceptor.lookup( parentDn );
+            attrs = nextInterceptor.lookup( new LookupOperationContext( parentDn ) );
         }
         catch ( Exception e )
         {
             LdapNameNotFoundException e2 = new LdapNameNotFoundException( "Parent " + parentDn.getUpName() 
                 + " not found" );
-            e2.setResolvedName( new LdapDN( nexus.getMatchedName( parentDn ).getUpName() ) );
+            e2.setResolvedName( new LdapDN( nexus.getMatchedName( new GetMatchedNameOperationContext( parentDn ) ).getUpName() ) );
             throw e2;
         }
         
-        Attribute objectClass = attrs.get( "objectClass" );
+        Attribute objectClass = attrs.get( SchemaConstants.OBJECT_CLASS_AT );
+        
         if ( objectClass.contains( "alias" ) )
         {
-            String msg = "Attempt to add entry to alias '" + normName.getUpName() + "' not allowed.";
+            String msg = "Attempt to add entry to alias '" + name.getUpName() + "' not allowed.";
             ResultCodeEnum rc = ResultCodeEnum.ALIAS_PROBLEM;
             NamingException e = new LdapNamingException( msg, rc );
             e.setResolvedName( new LdapDN( parentDn.getUpName() ) );
             throw e;
         }
 
-        nextInterceptor.add( normName, entry );
+        nextInterceptor.add( opContext );
     }
 
 
@@ -151,8 +166,10 @@
      * Checks to make sure the entry being deleted exists, and has no children, otherwise throws the appropriate
      * LdapException.
      */
-    public void delete( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
+    public void delete( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
+    	LdapDN name = opContext.getDn();
+    	
         if ( name.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
         {
             throw new LdapOperationNotSupportedException( 
@@ -167,13 +184,15 @@
 
         // check if entry to delete has children (only leaves can be deleted)
         boolean hasChildren = false;
-        NamingEnumeration list = nextInterceptor.list( name );
+        NamingEnumeration list = nextInterceptor.list( new ListOperationContext( name ) );
+        
         if ( list.hasMore() )
         {
             hasChildren = true;
         }
 
         list.close();
+        
         if ( hasChildren )
         {
             LdapContextNotEmptyException e = new LdapContextNotEmptyException();
@@ -181,16 +200,16 @@
             throw e;
         }
 
-        nextInterceptor.delete( name );
+        nextInterceptor.delete( opContext );
     }
 
 
     /**
      * Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
      */
-    public NamingEnumeration list( NextInterceptor nextInterceptor, LdapDN baseName ) throws NamingException
+    public NamingEnumeration list( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
-        if ( baseName.getNormName().equals( subschemSubentryDn.getNormName() ) )
+        if ( opContext.getDn().getNormName().equals( subschemSubentryDn.getNormName() ) )
         {
             // there is nothing under the schema subentry
             return new EmptyEnumeration();
@@ -198,112 +217,56 @@
         
         // check if entry to search exists
         String msg = "Attempt to search under non-existant entry: ";
-        assertHasEntry( nextInterceptor, msg, baseName );
-
-        return nextInterceptor.list( baseName );
-    }
-
-
-    /**
-     * Checks to make sure the entry being looked up exists other wise throws the appropriate LdapException.
-     */
-    public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name ) throws NamingException
-    {
-        if ( name.getNormName().equals( subschemSubentryDn.getNormName() ) )
-        {
-            return nexus.getRootDSE();
-        }
-        
-        String msg = "Attempt to lookup non-existant entry: ";
-        assertHasEntry( nextInterceptor, msg, name );
+        assertHasEntry( nextInterceptor, msg, opContext.getDn() );
 
-        return nextInterceptor.lookup( name );
+        return nextInterceptor.list( opContext );
     }
 
 
     /**
      * Checks to see the base being searched exists, otherwise throws the appropriate LdapException.
      */
-    public Attributes lookup( NextInterceptor nextInterceptor, LdapDN name, String[] attrIds ) throws NamingException
+    public Attributes lookup( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
-        if ( name.getNormName().equals( subschemSubentryDn.getNormName() ) )
+        LookupOperationContext ctx = (LookupOperationContext)opContext;
+        
+        if ( ctx.getDn().getNormName().equals( subschemSubentryDn.getNormName() ) )
         {
-            return nexus.getRootDSE();
+            return nexus.getRootDSE( null );
         }
         
         // check if entry to lookup exists
         String msg = "Attempt to lookup non-existant entry: ";
-        assertHasEntry( nextInterceptor, msg, name );
+        assertHasEntry( nextInterceptor, msg, ctx.getDn() );
 
-        return nextInterceptor.lookup( name, attrIds );
+        return nextInterceptor.lookup( opContext );
     }
 
 
     /**
      * Checks to see the entry being modified exists, otherwise throws the appropriate LdapException.
      */
-    public void modify( NextInterceptor nextInterceptor, LdapDN name, int modOp, Attributes attrs )
+    public void modify( NextInterceptor nextInterceptor, OperationContext opContext )
         throws NamingException
     {
-        // check if entry to modify exists
-        String msg = "Attempt to modify non-existant entry: ";
+    	ModifyOperationContext ctx = (ModifyOperationContext)opContext;
 
-        // handle operations against the schema subentry in the schema service
-        // and never try to look it up in the nexus below
-        if ( name.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
-        {
-            nextInterceptor.modify( name, modOp, attrs );
-            return;
-        }
-        
-        assertHasEntry( nextInterceptor, msg, name );
-
-        Attributes entry = nexus.lookup( name );
-        NamingEnumeration attrIds = attrs.getIDs();
-        while ( attrIds.hasMore() )
-        {
-            String attrId = ( String ) attrIds.next();
-            Attribute modAttr = attrs.get( attrId );
-            Attribute entryAttr = entry.get( attrId );
-
-            if ( modOp == DirContext.ADD_ATTRIBUTE )
-            {
-                if ( entryAttr != null )
-                {
-                    for ( int ii = 0; ii < modAttr.size(); ii++ )
-                    {
-                        if ( entryAttr.contains( modAttr.get( ii ) ) )
-                        {
-                            throw new LdapAttributeInUseException( "Trying to add existing value '" + modAttr.get( ii )
-                                + "' to attribute " + attrId );
-                        }
-                    }
-                }
-            }
-        }
-        nextInterceptor.modify( name, modOp, attrs );
-    }
-
-
-    /**
-     * Checks to see the entry being modified exists, otherwise throws the appropriate LdapException.
-     */
-    public void modify( NextInterceptor nextInterceptor, LdapDN name, ModificationItemImpl[] items ) throws NamingException
-    {
         // check if entry to modify exists
         String msg = "Attempt to modify non-existant entry: ";
 
         // handle operations against the schema subentry in the schema service
         // and never try to look it up in the nexus below
-        if ( name.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
+        if ( ctx.getDn().getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
         {
-            nextInterceptor.modify( name, items );
+            nextInterceptor.modify( opContext );
             return;
         }
         
-        assertHasEntry( nextInterceptor, msg, name );
+        assertHasEntry( nextInterceptor, msg, ctx.getDn() );
 
-        Attributes entry = nexus.lookup( name );
+        Attributes entry = nexus.lookup( new LookupOperationContext( ctx.getDn() ) );
+        ModificationItemImpl[] items = ctx.getModItems();
+        
         for ( int ii = 0; ii < items.length; ii++ )
         {
             if ( items[ii].getModificationOp() == DirContext.ADD_ATTRIBUTE )
@@ -324,16 +287,18 @@
                 }
             }
         }
-        nextInterceptor.modify( name, items );
-    }
 
+        nextInterceptor.modify( opContext );
+    }
 
     /**
      * Checks to see the entry being renamed exists, otherwise throws the appropriate LdapException.
      */
-    public void modifyRn( NextInterceptor nextInterceptor, LdapDN dn, String newRn, boolean deleteOldRn )
+    public void rename( NextInterceptor nextInterceptor, OperationContext opContext )
         throws NamingException
     {
+        LdapDN dn = opContext.getDn();
+        
         if ( dn.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
         {
             throw new LdapOperationNotSupportedException( 
@@ -349,9 +314,10 @@
         // check to see if target entry exists
         LdapDN newDn = ( LdapDN ) dn.clone();
         newDn.remove( dn.size() - 1 );
-        newDn.add( newRn );
+        newDn.add( ((RenameOperationContext)opContext).getNewRdn() );
         newDn.normalize( normalizerMap );
-        if ( nextInterceptor.hasEntry( newDn ) )
+        
+        if ( nextInterceptor.hasEntry( new EntryOperationContext( newDn ) ) )
         {
             LdapNameAlreadyBoundException e;
             e = new LdapNameAlreadyBoundException( "target entry " + newDn.getUpName() + " already exists!" );
@@ -359,7 +325,7 @@
             throw e;
         }
 
-        nextInterceptor.modifyRn( dn, newRn, deleteOldRn );
+        nextInterceptor.rename( opContext );
     }
 
 
@@ -367,8 +333,11 @@
      * Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate
      * LdapException.
      */
-    public void move( NextInterceptor nextInterceptor, LdapDN oriChildName, LdapDN newParentName ) throws NamingException
+    public void move( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
+        LdapDN oriChildName = opContext.getDn();
+        LdapDN newParentName = ((MoveOperationContext)opContext).getParent();
+        
         if ( oriChildName.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
         {
             throw new LdapOperationNotSupportedException( 
@@ -389,7 +358,8 @@
         String rdn = oriChildName.get( oriChildName.size() - 1 );
         LdapDN target = ( LdapDN ) newParentName.clone();
         target.add( rdn );
-        if ( nextInterceptor.hasEntry( target ) )
+        
+        if ( nextInterceptor.hasEntry( new EntryOperationContext( target ) ) )
         {
             // we must calculate the resolved name using the user provided Rdn value
             String upRdn = new LdapDN( oriChildName.getUpName() ).get( oriChildName.size() - 1 );
@@ -402,7 +372,7 @@
             throw e;
         }
 
-        nextInterceptor.move( oriChildName, newParentName );
+        nextInterceptor.move( opContext );
     }
 
 
@@ -410,9 +380,12 @@
      * Checks to see the entry being moved exists, and so does its parent, otherwise throws the appropriate
      * LdapException.
      */
-    public void move( NextInterceptor nextInterceptor, LdapDN oriChildName, LdapDN newParentName, String newRn,
-        boolean deleteOldRn ) throws NamingException
+    public void moveAndRename( NextInterceptor nextInterceptor, OperationContext opContext ) throws NamingException
     {
+        LdapDN oriChildName = opContext.getDn();
+        LdapDN parent = ((MoveAndRenameOperationContext)opContext).getParent();
+        String newRn = ((MoveAndRenameOperationContext)opContext).getNewRdn();
+        
         if ( oriChildName.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
         {
             throw new LdapOperationNotSupportedException( 
@@ -427,16 +400,17 @@
 
         // check if parent to move to exists
         msg = "Attempt to move to non-existant parent: ";
-        assertHasEntry( nextInterceptor, msg, newParentName );
+        assertHasEntry( nextInterceptor, msg, parent );
 
         // check to see if target entry exists
-        LdapDN target = ( LdapDN ) newParentName.clone();
+        LdapDN target = ( LdapDN ) parent.clone();
         target.add( newRn );
         target.normalize( normalizerMap );
-        if ( nextInterceptor.hasEntry( target ) )
+        
+        if ( nextInterceptor.hasEntry( new EntryOperationContext( target ) ) )
         {
             // we must calculate the resolved name using the user provided Rdn value
-            LdapDN upTarget = ( LdapDN ) newParentName.clone();
+            LdapDN upTarget = ( LdapDN ) parent.clone();
             upTarget.add( newRn );
 
             LdapNameAlreadyBoundException e;
@@ -445,31 +419,38 @@
             throw e;
         }
 
-        nextInterceptor.move( oriChildName, newParentName, newRn, deleteOldRn );
+        nextInterceptor.moveAndRename( opContext );
     }
 
 
     /**
      * 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 )
+        try
         {
-            return nextInterceptor.search( base, env, filter, searchCtls );
-        }
+	        NamingEnumeration<SearchResult> result =  nextInterceptor.search( opContext );
+	        
+	        if ( result.hasMoreElements() == false )
+	        {
+	            if ( !base.isEmpty() && !( subschemSubentryDn.toNormName() ).equalsIgnoreCase( base.toNormName() ) )
+	            {
+	                // We just check that the entry exists only if we didn't found any entry
+	                assertHasEntry( nextInterceptor, "Attempt to search under non-existant entry:" , base );
+	            }
+	        }
 
-        if ( ( subschemSubentryDn.toNormName() ).equalsIgnoreCase( base.toNormName() ) )
+	        return result;
+        }
+        catch ( NamingException ne )
         {
-            return nextInterceptor.search( base, env, filter, searchCtls );
+            String msg = "Attempt to search under non-existant entry: ";
+            assertHasEntry( nextInterceptor, msg, base );
+            throw ne;
         }
-
-        assertHasEntry( nextInterceptor, msg, base );
-
-        return nextInterceptor.search( base, env, filter, searchCtls );
     }
 
 
@@ -490,7 +471,8 @@
         
         Invocation invocation = InvocationStack.getInstance().peek();
         PartitionNexusProxy proxy = invocation.getProxy();
-        if ( !nextInterceptor.hasEntry( dn ) )
+        
+        if ( !nextInterceptor.hasEntry( new EntryOperationContext( dn ) ) )
         {
             LdapNameNotFoundException e;
 
@@ -503,7 +485,10 @@
                 e = new LdapNameNotFoundException( dn.toString() );
             }
 
-            e.setResolvedName( new LdapDN( proxy.getMatchedName( dn ).getUpName() ) );
+            e.setResolvedName( 
+                new LdapDN( 
+                    proxy.getMatchedName( 
+                        new GetMatchedNameOperationContext( dn ) ).getUpName() ) );
             throw e;
         }
     }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Wed May 23 17:26:40 2007
@@ -21,24 +21,20 @@
 
 
 import java.util.Iterator;
-import java.util.List;
-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;
 import org.apache.directory.server.core.authn.LdapPrincipal;
-import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.configuration.InterceptorConfiguration;
+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.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -99,137 +95,117 @@
     // Interceptor's Invoke Method
     // ------------------------------------------------------------------------
 
-    public void add(NextInterceptor next, LdapDN normName, Attributes entry) throws NamingException
+    public void add(NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.add(normName, entry );
+        next.add( opContext );
     }
 
 
-    public void delete( NextInterceptor next, LdapDN name ) throws NamingException
+    public void delete( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.delete( name );
+        next.delete( opContext );
     }
 
 
-    public LdapDN getMatchedName ( NextInterceptor next, LdapDN dn ) throws NamingException
+    public LdapDN getMatchedName ( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.getMatchedName( dn );
+        return next.getMatchedName( opContext );
     }
 
 
-    public Attributes getRootDSE( NextInterceptor next ) throws NamingException
+    public Attributes getRootDSE( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.getRootDSE();
+        return next.getRootDSE( opContext );
     }
 
 
-    public LdapDN getSuffix ( NextInterceptor next, LdapDN dn ) throws NamingException
+    public LdapDN getSuffix( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.getSuffix( dn );
+        return next.getSuffix( opContext );
     }
 
 
-    public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException
+    public boolean hasEntry( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.hasEntry( name );
+        return next.hasEntry( opContext );
     }
 
 
-    public boolean isSuffix( NextInterceptor next, LdapDN name ) throws NamingException
+    public NamingEnumeration list( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.isSuffix( name );
+        return next.list( opContext );
     }
 
 
-    public NamingEnumeration list( NextInterceptor next, LdapDN base ) throws NamingException
+    public Iterator listSuffixes ( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.list( base );
+        return next.listSuffixes( opContext );
     }
 
 
-    public Iterator listSuffixes ( NextInterceptor next ) throws NamingException
+    public Attributes lookup( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.listSuffixes();
+        return next.lookup( opContext );
     }
 
-
-    public Attributes lookup( NextInterceptor next, LdapDN dn, String[] attrIds ) throws NamingException
-    {
-        return next.lookup( dn, attrIds );
-    }
-
-
-    public Attributes lookup( NextInterceptor next, LdapDN name ) throws NamingException
-    {
-        return next.lookup( name );
-    }
-
-
-    public void modify( NextInterceptor next, LdapDN name, int modOp, Attributes mods ) throws NamingException
+    
+    public void modify( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.modify( name, modOp, mods );
+        next.modify( opContext );
     }
 
 
-    public void modify( NextInterceptor next, LdapDN name, ModificationItemImpl[] mods ) throws NamingException
+    public void rename( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.modify( name, mods );
+        next.rename( opContext );
     }
 
 
-    public void modifyRn( NextInterceptor next, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException
-    {
-        next.modifyRn( name, newRn, deleteOldRn );
-    }
-
-
-    public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn )
+    public void moveAndRename( NextInterceptor next, OperationContext opContext )
         throws NamingException
     {
-        next.move( oriChildName, newParentName, newRn, deleteOldRn );
+        next.moveAndRename( opContext );
     }
 
 
-    public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName ) throws NamingException
+    public void move( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.move( oriChildName, newParentName );
+        next.move( 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 next.search( base, env, filter, searchCtls );
+        return next.search( opContext );
     }
 
 
-    public void addContextPartition( NextInterceptor next, PartitionConfiguration cfg ) throws NamingException
+    public void addContextPartition( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.addContextPartition( cfg );
+        next.addContextPartition( opContext );
     }
 
 
-    public void removeContextPartition( NextInterceptor next, LdapDN suffix ) throws NamingException
+    public void removeContextPartition( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.removeContextPartition( suffix );
+        next.removeContextPartition( opContext );
     }
 
 
-    public boolean compare( NextInterceptor next, LdapDN name, String oid, Object value ) throws NamingException
+    public boolean compare( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        return next.compare( name, oid, value );
+        return next.compare( opContext );
     }
 
 
-    public void bind( NextInterceptor next, LdapDN bindDn, byte[] credentials, List<String> mechanisms, String saslAuthId )
-        throws NamingException
+    public void bind( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.bind( bindDn, credentials, mechanisms, saslAuthId );
+        next.bind( opContext );
     }
 
 
-    public void unbind( NextInterceptor next, LdapDN bindDn ) throws NamingException
+    public void unbind( NextInterceptor next, OperationContext opContext ) throws NamingException
     {
-        next.unbind( bindDn );
+        next.unbind( opContext );
     }
 }

Modified: directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?view=diff&rev=541123&r1=541122&r2=541123
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java (original)
+++ directory/apacheds/branches/apacheds-sasl-branch/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java Wed May 23 17:26:40 2007
@@ -21,21 +21,17 @@
 
 
 import java.util.Iterator;
-import java.util.List;
-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.PartitionConfiguration;
 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.message.ModificationItemImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -119,136 +115,115 @@
 
 
     /**
-     * Filters {@link PartitionNexus#getRootDSE()} call.
+     * Filters {@link PartitionNexus#getRootDSE( OperationContext )} call.
      */
-    Attributes getRootDSE( NextInterceptor next ) throws NamingException;
+    Attributes getRootDSE( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link PartitionNexus#getMatchedName(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link PartitionNexus#getMatchedName( OperationContext )} call.
      */
-    LdapDN getMatchedName ( NextInterceptor next, LdapDN name ) throws NamingException;
+    LdapDN getMatchedName( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link PartitionNexus#getSuffix(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link PartitionNexus#getSuffix( OperationContext )} call.
      */
-    LdapDN getSuffix ( NextInterceptor next, LdapDN name ) throws NamingException;
+    LdapDN getSuffix ( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link PartitionNexus#listSuffixes()} call.
+     * Filters {@link PartitionNexus#listSuffixes( OperationContext )} call.
      */
-    Iterator listSuffixes ( NextInterceptor next ) throws NamingException;
+    Iterator listSuffixes( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link PartitionNexus#addContextPartition(PartitionConfiguration)} call.
+     * Filters {@link PartitionNexus#addContextPartition( OperationContext )} call.
      */
-    void addContextPartition( NextInterceptor next, PartitionConfiguration cfg ) throws NamingException;
+    void addContextPartition( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link PartitionNexus#removeContextPartition(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link PartitionNexus#removeContextPartition( OperationContext )} call.
      */
-    void removeContextPartition( NextInterceptor next, LdapDN suffix ) throws NamingException;
+    void removeContextPartition( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link PartitionNexus#compare(org.apache.directory.shared.ldap.name.LdapDN,String,Object)} call.
+     * Filters {@link PartitionNexus#compare( OperationContext )} call.
      */
-    boolean compare( NextInterceptor next, LdapDN name, String oid, Object value ) throws NamingException;
+    boolean compare( NextInterceptor next, OperationContext opContext) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#delete(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link Partition#delete( OperationContext )} call.
      */
-    void delete( NextInterceptor next, LdapDN name ) throws NamingException;
+    void delete( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#add(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.Attributes)} call.
+     * Filters {@link Partition#add( OperationContext )} call.
      */
-    void add( NextInterceptor next, LdapDN name, Attributes entry ) throws NamingException;
+    void add( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,int,javax.naming.directory.Attributes)} call.
+     * Filters {@link Partition#modify( OperationContext )} call.
      */
-    void modify( NextInterceptor next, LdapDN name, int modOp, Attributes attributes ) throws NamingException;
+    void modify( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#modify(org.apache.directory.shared.ldap.name.LdapDN,javax.naming.directory.ModificationItem[])} call.
+     * Filters {@link Partition#list( OperationContext )} call.
      */
-    void modify( NextInterceptor next, LdapDN name, ModificationItemImpl[] items ) throws NamingException;
+    NamingEnumeration list( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#list(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link Partition#search( OperationContext )} call.
      */
-    NamingEnumeration list( NextInterceptor next, LdapDN baseName ) throws NamingException;
+    NamingEnumeration<SearchResult> search( 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#lookup( OperationContext )} call.
      */
-    NamingEnumeration search( NextInterceptor next, LdapDN baseName, Map environment, ExprNode filter,
-                              SearchControls searchControls ) throws NamingException;
+    Attributes lookup( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link Partition#hasEntry( OperationContext )} call.
      */
-    Attributes lookup( NextInterceptor next, LdapDN name ) throws NamingException;
+    boolean hasEntry( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])} call.
+     * Filters {@link Partition#rename( OperationContext )} call.
      */
-    Attributes lookup( NextInterceptor next, LdapDN dn, String[] attrIds ) throws NamingException;
+    void rename( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#lookup(org.apache.directory.shared.ldap.name.LdapDN,String[])} call.
+     * Filters {@link Partition#move( OperationContext )} call.
      */
-    boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException;
+    void move( NextInterceptor next, OperationContext opContext ) throws NamingException;
 
 
     /**
-     * Filters {@link Partition#isSuffix(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link Partition#moveAndRename( OperationContext) } call.
      */
-    boolean isSuffix( NextInterceptor next, LdapDN name ) throws NamingException;
-
-
-    /**
-     * Filters {@link Partition#modifyRn(org.apache.directory.shared.ldap.name.LdapDN,String,boolean)} call.
-     */
-    void modifyRn( NextInterceptor next, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException;
-
-
-    /**
-     * Filters {@link Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN)} call.
-     */
-    void move( NextInterceptor next, LdapDN oldName, LdapDN newParentName ) throws NamingException;
-
-
-    /**
-     * Filters {@link Partition#move(org.apache.directory.shared.ldap.name.LdapDN,org.apache.directory.shared.ldap.name.LdapDN,String,boolean)} call.
-     */
-    void move( NextInterceptor next, LdapDN oldName, LdapDN newParentName, String newRn, boolean deleteOldRn )
+    void moveAndRename( NextInterceptor next, OperationContext opContext )
         throws NamingException;
 
-
     /**
-     * Filters {@link Partition#bind(org.apache.directory.shared.ldap.name.LdapDN,byte[],java.util.List,String)} call.
+     * Filters {@link Partition#bind( OperationContext )} call.
      */
-    void bind( NextInterceptor next, LdapDN bindDn, byte[] credentials, List<String> mechanisms, String saslAuthId )
+    void bind( NextInterceptor next, OperationContext opContext )
         throws NamingException;
 
-
     /**
-     * Filters {@link Partition#unbind(org.apache.directory.shared.ldap.name.LdapDN)} call.
+     * Filters {@link Partition#unbind( OperationContext )} call.
      */
-    void unbind( NextInterceptor next, LdapDN bindDn ) throws NamingException;
+    void unbind( NextInterceptor next, OperationContext opContext ) throws NamingException;
 }



Mime
View raw message