You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2011/11/08 17:04:07 UTC

svn commit: r1199319 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/ core-api/src/main/java/org/apache/directory/server/core/api/interceptor/ core-api/src/main/java/org/apache/directory/server/core/api/inter...

Author: elecharny
Date: Tue Nov  8 16:04:05 2011
New Revision: 1199319

URL: http://svn.apache.org/viewvc?rev=1199319&view=rev
Log:
First drop of modifications in the way we process operations : the chain is now computed in the DS, and we don't go though the BasicInterceptor when interceptors are bypassed.
The getRootDSE, delete and unbind operation have been modified, not the other operations.

Added:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/OperationEnum.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/CoreSession.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/DirectoryService.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/OperationContext.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockDirectoryService.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockOperation.java
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
    directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
    directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
    directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
    directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
    directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/CoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/CoreSession.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/CoreSession.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/CoreSession.java Tue Nov  8 16:04:05 2011
@@ -325,9 +325,24 @@ public interface CoreSession
     void delete( Dn dn, LogChange log ) throws LdapException;
     
     
+    /**
+     * Deletes an entry in the server.
+     *
+     * @param deleteRequest the delete request containing all the informations 
+     * necessary to delete the entry
+     * @throws Exception if there are failures while deleting the entry
+     */
     void delete( DeleteRequest deleteRequest ) throws LdapException;
     
     
+    /**
+     * Deletes an entry in the server. The operation can be logged if requested
+     *
+     * @param deleteRequest the delete request containing all the informations 
+     * necessary to delete the entry
+     * @param log Tells if we should log the deletion in the ChangeLog interceptor
+     * @throws Exception if there are failures while deleting the entry
+     */
     void delete( DeleteRequest deleteRequest, LogChange log ) throws LdapException;
 
     
@@ -796,8 +811,19 @@ public interface CoreSession
     EntryFilteringCursor search( SearchRequest searchRequest ) throws LdapException;
 
 
+    /**
+     * Unbind from the current LdapSession.
+     * 
+     * @throws LdapException If the operation failed
+     */
     void unbind() throws LdapException;
     
     
+    /**
+     * Unbind from the current LdapSession.
+     * 
+     * @param unbindRequest The Unbind requst, potentially containing some controls
+     * @throws LdapException If the operation failed
+     */
     void unbind( UnbindRequest unbindRequest ) throws LdapException;
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/DirectoryService.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/DirectoryService.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/DirectoryService.java Tue Nov  8 16:04:05 2011
@@ -319,7 +319,6 @@ public interface DirectoryService extend
     void setAllowAnonymousAccess( boolean enableAnonymousAccess );
 
 
-
     /**
      * Returns interceptors in the server.
      *
@@ -329,6 +328,14 @@ public interface DirectoryService extend
 
 
     /**
+     * Returns interceptors in the server.
+     *
+     * @return the interceptors in the server.
+     */
+    List<String> getInterceptors( OperationEnum operation );
+
+
+    /**
      * Sets the interceptors in the server.
      *
      * @param interceptors the interceptors to be used in the server.

Added: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/OperationEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/OperationEnum.java?rev=1199319&view=auto
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/OperationEnum.java (added)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/OperationEnum.java Tue Nov  8 16:04:05 2011
@@ -0,0 +1,63 @@
+/*
+ *  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.api;
+
+/**
+ * The list of Operation we can process on the Interceptors.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public enum OperationEnum {
+	ADD( "add" ),
+	BIND( "bind" ),
+	COMPARE( "compare" ),
+	DELETE( "delete" ),
+	GET_ROOT_DSE( "getRootDSE" ),
+	HAS_ENTRY( "hasEntry" ),
+	LIST( "list" ),
+	LOOKUP( "lookup" ),
+	MODIFY( "modify" ),
+	MOVE( "move" ),
+	MOVE_AND_RENAME( "moveAndRename" ),
+	RENAME( "rename" ),
+	SEARCH( "search" ),
+	UNBIND( "unbind" );
+	
+	/** The associated method name */
+	private String methodName;
+	
+	/**
+	 * The private constructor 
+	 * @param methodName The associated method name
+	 */
+	private OperationEnum( String methodName )
+	{
+		this.methodName = methodName;
+	}
+	
+	
+	/**
+	 * @return The associated method name
+	 */
+	public String getMethodName()
+	{
+		return methodName;
+	}
+}

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/BaseInterceptor.java Tue Nov  8 16:04:05 2011
@@ -44,6 +44,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
 import org.apache.directory.server.core.api.invocation.InvocationStack;
+import org.apache.directory.server.core.api.partition.PartitionNexus;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -116,6 +117,129 @@ public abstract class BaseInterceptor im
 
 
     /**
+     * The final interceptor which acts as a proxy in charge to dialog with the nexus partition.
+     */
+    private final Interceptor FINAL_INTERCEPTOR = new Interceptor()
+    {
+        private PartitionNexus nexus;
+
+
+        public String getName()
+        {
+            return "FINAL";
+        }
+
+
+        public void init( DirectoryService directoryService )
+        {
+            this.nexus = directoryService.getPartitionNexus();
+        }
+
+
+        public void destroy()
+        {
+            // unused
+        }
+
+
+        public boolean compare( NextInterceptor next, CompareOperationContext compareContext ) throws LdapException
+        {
+            return nexus.compare( compareContext );
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
+        {
+            return nexus.getRootDSE( getRootDseContext );
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void delete( DeleteOperationContext deleteContext ) throws LdapException
+        {
+            nexus.delete( deleteContext );
+        }
+
+
+        public void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException
+        {
+            nexus.add( addContext );
+        }
+
+
+        public void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException
+        {
+            nexus.modify( modifyContext );
+        }
+
+
+        public EntryFilteringCursor list( NextInterceptor next, ListOperationContext listContext ) throws LdapException
+        {
+            return nexus.list( listContext );
+        }
+
+
+        public EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext )
+            throws LdapException
+        {
+            return nexus.search( searchContext );
+        }
+
+
+        public Entry lookup( NextInterceptor next, LookupOperationContext lookupContext )
+            throws LdapException
+        {
+            return nexus.lookup( lookupContext );
+        }
+
+
+        public boolean hasEntry( NextInterceptor next, EntryOperationContext hasEntryContext ) throws LdapException
+        {
+            return nexus.hasEntry( hasEntryContext );
+        }
+
+
+        public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException
+        {
+            nexus.rename( renameContext );
+        }
+
+
+        public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+        {
+            nexus.move( moveContext );
+        }
+
+
+        public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext moveAndRenameContext )
+            throws LdapException
+        {
+            nexus.moveAndRename( moveAndRenameContext );
+        }
+
+
+        public void bind( NextInterceptor next, BindOperationContext bindContext ) throws LdapException
+        {
+            nexus.bind( bindContext );
+        }
+
+
+        /**
+         * {@inheritDoc}
+         */
+        public void unbind( UnbindOperationContext unbindContext ) throws LdapException
+        {
+            nexus.unbind( unbindContext );
+        }
+    };
+
+
+    /**
      * default interceptor name is its class, preventing accidental duplication of interceptors by naming
      * instances differently
      * @return (default, class name) interceptor name
@@ -183,6 +307,8 @@ public abstract class BaseInterceptor im
         TRIGGER_EXECUTION_SUBENTRIES_AT = schemaManager
             .getAttributeType( SchemaConstants.TRIGGER_EXECUTION_SUBENTRIES_AT );
         UNIQUE_MEMBER_AT = schemaManager.getAttributeType( SchemaConstants.UNIQUE_MEMBER_AT_OID );
+        
+        FINAL_INTERCEPTOR.init( directoryService );
     }
 
 
@@ -194,6 +320,28 @@ public abstract class BaseInterceptor im
     }
 
 
+    /**
+     * Computes the next interceptor to call for a given operation. If we find none, 
+     * we return the proxy to the nexus.
+     * 
+     * @param operationContext The operation context
+     * @return The next interceptor in the list for this operation
+     */
+    private Interceptor getNextInterceptor( OperationContext operationContext )
+    {
+    	String currentInterceptor = operationContext.getNextInterceptor();
+    	
+    	if ( currentInterceptor.equals( "FINAL" ) )
+    	{
+    		return FINAL_INTERCEPTOR;
+    	}
+
+    	Interceptor interceptor = directoryService.getInterceptor( currentInterceptor );
+    	
+    	return interceptor;
+    }
+    
+
     // ------------------------------------------------------------------------
     // Interceptor's Invoke Method
     // ------------------------------------------------------------------------
@@ -206,18 +354,53 @@ public abstract class BaseInterceptor im
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
-        next.delete( deleteContext );
+    	// Do nothing
     }
+    
 
+    /**
+     * Calls the next interceptor for the delete operation.
+     * 
+     * @param deleteContext The context in which we are executing this operation
+     * @throws LdapException If something went wrong
+     */
+    protected final void next( DeleteOperationContext deleteContext ) throws LdapException
+    {
+    	Interceptor interceptor = getNextInterceptor( deleteContext );
+    	
+    	interceptor.delete( deleteContext );
+    }
 
-    public Entry getRootDSE( NextInterceptor next, GetRootDSEOperationContext getRootDseContext ) throws LdapException
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
     {
-        return next.getRootDSE( getRootDseContext );
+    	// Nothing to do
+        return null;
     }
+    
+    
+    /**
+     * Calls the next interceptor for the getRootDse operation.
+     * 
+     * @param deleteContext The context in which we are executing this operation
+     * @throws LdapException If something went wrong
+     */
+    protected final Entry next( GetRootDSEOperationContext getRootDseContext ) throws LdapException
+    {
+    	Interceptor interceptor = getNextInterceptor( getRootDseContext );
 
+        return interceptor.getRootDSE( getRootDseContext );
+    }
 
+    
     public boolean hasEntry( NextInterceptor next, EntryOperationContext hasEntryContext ) throws LdapException
     {
         return next.hasEntry( hasEntryContext );
@@ -283,8 +466,25 @@ public abstract class BaseInterceptor im
     }
 
 
-    public void unbind( NextInterceptor next, UnbindOperationContext unbindContext ) throws LdapException
+    /**
+     * {@inheritDoc}
+     */
+    public void unbind( UnbindOperationContext unbindContext ) throws LdapException
+    {
+        // Nothing to do
+    }
+    
+    
+    /**
+     * Compute the next interceptor for the unbind operation.
+     * 
+     * @param deleteContext The context in which we are executing this operation
+     * @throws LdapException If something went wrong
+     */
+    protected final void next( UnbindOperationContext unbindContext ) throws LdapException
     {
-        next.unbind( unbindContext );
+    	Interceptor interceptor = getNextInterceptor( unbindContext );
+
+        interceptor.unbind( unbindContext );
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/Interceptor.java Tue Nov  8 16:04:05 2011
@@ -127,9 +127,19 @@ public interface Interceptor
 
 
     /**
-     * Filters {@link DefaultPartitionNexus#getRootDSE( GetRootDSEOperationContext )} call.
+     * Filters {@link Partition#add( AddOperationContext )} call.
+     * 
+     * @param next The next {@link Interceptor} in the chain
+     * @param addContext The {@link AddOperationContext} instance
+     * @throws LdapException If we had some error while processing the Add operation
      */
-    Entry getRootDSE( NextInterceptor next, GetRootDSEOperationContext getRootDseContext ) throws LdapException;
+    void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException;
+
+
+    /**
+     * Filters {@link Partition#bind( BindOperationContext )} call.
+     */
+    void bind( NextInterceptor next, BindOperationContext bindContext ) throws LdapException;
 
 
     /**
@@ -141,23 +151,23 @@ public interface Interceptor
     /**
      * Filters {@link Partition#delete( DeleteOperationContext )} call.
      */
-    void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException;
+    void delete( DeleteOperationContext deleteContext ) throws LdapException;
 
 
     /**
-     * Filters {@link Partition#add( AddOperationContext )} call.
+     * Filters {@link DefaultPartitionNexus#getRootDSE( GetRootDSEOperationContext )} call.
      * 
-     * @param next The next {@link Interceptor} in the chain
-     * @param addContext The {@link AddOperationContext} instance
-     * @throws LdapException If we had some error while processing the Add operation
+     * @param getRootDseContext The getRoot() operation context
+     * @return The RootDSE entry, if found
+     * @throws LdapException If we can't get back the RootDSE entry
      */
-    void add( NextInterceptor next, AddOperationContext addContext ) throws LdapException;
+    Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException;
 
 
     /**
-     * Filters {@link Partition#modify( ModifyOperationContext )} call.
+     * Filters {@link Partition#hasEntry( EntryOperationContext )} call.
      */
-    void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException;
+    boolean hasEntry( NextInterceptor next, EntryOperationContext hasEntryContext ) throws LdapException;
 
 
     /**
@@ -167,27 +177,15 @@ public interface Interceptor
 
 
     /**
-     * Filters {@link Partition#search( SearchOperationContext )} call.
-     */
-    EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext ) throws LdapException;
-
-
-    /**
      * Filters {@link Partition#lookup( LookupOperationContext )} call.
      */
     Entry lookup( NextInterceptor next, LookupOperationContext lookupContext ) throws LdapException;
 
 
     /**
-     * Filters {@link Partition#hasEntry( EntryOperationContext )} call.
-     */
-    boolean hasEntry( NextInterceptor next, EntryOperationContext hasEntryContext ) throws LdapException;
-
-
-    /**
-     * Filters {@link Partition#rename( RenameOperationContext )} call.
+     * Filters {@link Partition#modify( ModifyOperationContext )} call.
      */
-    void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException;
+    void modify( NextInterceptor next, ModifyOperationContext modifyContext ) throws LdapException;
 
 
     /**
@@ -203,13 +201,19 @@ public interface Interceptor
 
 
     /**
-     * Filters {@link Partition#bind( BindOperationContext )} call.
+     * Filters {@link Partition#rename( RenameOperationContext )} call.
      */
-    void bind( NextInterceptor next, BindOperationContext bindContext ) throws LdapException;
+    void rename( NextInterceptor next, RenameOperationContext renameContext ) throws LdapException;
+
+
+    /**
+     * Filters {@link Partition#search( SearchOperationContext )} call.
+     */
+    EntryFilteringCursor search( NextInterceptor next, SearchOperationContext searchContext ) throws LdapException;
 
 
     /**
      * Filters {@link Partition#unbind( UnbindOperationContext )} call.
      */
-    void unbind( NextInterceptor next, UnbindOperationContext unbindContext ) throws LdapException;
+    void unbind( UnbindOperationContext unbindContext ) throws LdapException;
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java Tue Nov  8 16:04:05 2011
@@ -97,16 +97,21 @@ public class InterceptorChain
         }
 
 
-        public Entry getRootDSE( NextInterceptor next, GetRootDSEOperationContext getRootDseContext )
-            throws LdapException
+        /**
+         * {@inheritDoc}
+         */
+        public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
         {
-            return nexus.getRootDSE( getRootDseContext );
+            return null;
         }
 
 
-        public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+        /**
+         * {@inheritDoc}
+         */
+        public void delete( DeleteOperationContext deleteContext ) throws LdapException
         {
-            nexus.delete( deleteContext );
+            // Do nothing
         }
 
 
@@ -173,9 +178,9 @@ public class InterceptorChain
         }
 
 
-        public void unbind( NextInterceptor next, UnbindOperationContext unbindContext ) throws LdapException
+        public void unbind( UnbindOperationContext unbindContext ) throws LdapException
         {
-            nexus.unbind( unbindContext );
+            // Do nothing
         }
     };
 
@@ -499,28 +504,6 @@ public class InterceptorChain
     }
 
 
-    public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
-    {
-        Element entry = getStartingEntry();
-        Interceptor head = entry.interceptor;
-        NextInterceptor next = entry.nextInterceptor;
-
-        try
-        {
-            return head.getRootDSE( next, getRootDseContext );
-        }
-        catch ( LdapException le )
-        {
-            throw le;
-        }
-        catch ( Throwable e )
-        {
-            throwInterceptorException( head, e );
-            throw new InternalError(); // Should be unreachable
-        }
-    }
-
-
     public boolean compare( CompareOperationContext compareContext ) throws LdapException
     {
         Element entry = getStartingEntry();
@@ -605,6 +588,7 @@ public class InterceptorChain
     }
 
 
+    /*
     public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         Element entry = getStartingEntry();
@@ -625,6 +609,7 @@ public class InterceptorChain
             throwInterceptorException( head, e );
         }
     }
+    */
 
 
     public void add( AddOperationContext addContext ) throws LdapException
@@ -669,27 +654,6 @@ public class InterceptorChain
     }
 
 
-    public void unbind( UnbindOperationContext unbindContext ) throws LdapException
-    {
-        Element node = getStartingEntry();
-        Interceptor head = node.interceptor;
-        NextInterceptor next = node.nextInterceptor;
-
-        try
-        {
-            head.unbind( next, unbindContext );
-        }
-        catch ( LdapException le )
-        {
-            throw le;
-        }
-        catch ( Throwable e )
-        {
-            throwInterceptorException( head, e );
-        }
-    }
-
-
     public void modify( ModifyOperationContext modifyContext ) throws LdapException
     {
         Element entry = getStartingEntry();
@@ -964,53 +928,6 @@ public class InterceptorChain
                 }
 
 
-                public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
-                {
-                    Element next = getNextEntry();
-                    Interceptor interceptor = next.interceptor;
-
-                    try
-                    {
-                        //System.out.println( ">>> Entering into " + interceptor.getClass().getSimpleName() + ", getRootDSERequest" );
-                        Entry rootDSE = interceptor.getRootDSE( next.nextInterceptor, getRootDseContext );
-                        //System.out.println( "<<< Exiting from " + interceptor.getClass().getSimpleName() + ", getRootDSERequest" );
-                        
-                        return rootDSE;
-                    }
-                    catch ( LdapException le )
-                    {
-                        throw le;
-                    }
-                    catch ( Throwable e )
-                    {
-                        throwInterceptorException( interceptor, e );
-                        throw new InternalError(); // Should be unreachable
-                    }
-                }
-
-
-                public void delete( DeleteOperationContext deleteContext ) throws LdapException
-                {
-                    Element next = getNextEntry();
-                    Interceptor interceptor = next.interceptor;
-
-                    try
-                    {
-                        //System.out.println( ">>> Entering into " + interceptor.getClass().getSimpleName() + ", deleteRequest" );
-                        interceptor.delete( next.nextInterceptor, deleteContext );
-                        //System.out.println( "<<< Exiting from " + interceptor.getClass().getSimpleName() + ", deleteRequest" );
-                    }
-                    catch ( LdapException le )
-                    {
-                        throw le;
-                    }
-                    catch ( Throwable e )
-                    {
-                        throwInterceptorException( interceptor, e );
-                    }
-                }
-
-
                 public void add( AddOperationContext addContext ) throws LdapException
                 {
                     Element next = getNextEntry();
@@ -1241,28 +1158,6 @@ public class InterceptorChain
                         throwInterceptorException( interceptor, e );
                     }
                 }
-
-
-                public void unbind( UnbindOperationContext unbindContext ) throws LdapException
-                {
-                    Element next = getNextEntry();
-                    Interceptor interceptor = next.interceptor;
-
-                    try
-                    {
-                        //System.out.println( ">>> Entering into " + interceptor.getClass().getSimpleName() + ", unbindRequest" );
-                        interceptor.unbind( next.nextInterceptor, unbindContext );
-                        //System.out.println( "<<< Exiting from " + interceptor.getClass().getSimpleName() + ", unbindRequest" );
-                    }
-                    catch ( LdapException le )
-                    {
-                        throw le;
-                    }
-                    catch ( Throwable e )
-                    {
-                        throwInterceptorException( interceptor, e );
-                    }
-                }
             };
         }
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/NextInterceptor.java Tue Nov  8 16:04:05 2011
@@ -24,9 +24,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.CompareOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.EntryOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.GetRootDSEOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
@@ -34,7 +32,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 
@@ -55,18 +52,6 @@ public interface NextInterceptor
 
 
     /**
-     * Calls the next interceptor's {@link Interceptor#getRootDSE( NextInterceptor, GetRootDSEOperationContext )}.
-     */
-    Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException;
-
-
-    /**
-     * Calls the next interceptor's {@link Interceptor#delete(NextInterceptor, DeleteOperationContext )}.
-     */
-    void delete( DeleteOperationContext deleteContext ) throws LdapException;
-
-
-    /**
      * Calls the next interceptor's {@link Interceptor#add( NextInterceptor, AddOperationContext )}.
      */
     void add( AddOperationContext addContext ) throws LdapException;
@@ -123,9 +108,4 @@ public interface NextInterceptor
      * Calls the next interceptor's {@link Interceptor#bind( NextInterceptor, BindOperationContext )}
      */
     void bind( BindOperationContext bindContext ) throws LdapException;
-
-    /**
-     * Calls the next interceptor's {@link Interceptor#unbind( NextInterceptor, UnbindOperationContext )}
-     */
-    void unbind( UnbindOperationContext unbindContext ) throws LdapException;
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/AbstractOperationContext.java Tue Nov  8 16:04:05 2011
@@ -28,6 +28,7 @@ import java.util.Map;
 
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Modification;
@@ -64,7 +65,13 @@ public abstract class AbstractOperationC
     /** the Interceptors bypassed by this operation */
     protected Collection<String> byPassed;
     
-    protected LdapPrincipal authorizedPrincipal;
+    /** The interceptors to call for this operation */
+    protected List<String> interceptors;
+    
+    /** The current interceptor position */
+    protected int currentInterceptor;
+    
+	protected LdapPrincipal authorizedPrincipal;
     
     /** The core session */
     protected CoreSession session;
@@ -83,6 +90,7 @@ public abstract class AbstractOperationC
     public AbstractOperationContext( CoreSession session )
     {
         this.session = session;
+        currentInterceptor = 0;
     }
     
     
@@ -261,6 +269,32 @@ public abstract class AbstractOperationC
     
     
     /**
+     * {@inheritDoc}
+     */
+    public final void setInterceptors( List<String> interceptors )
+    {
+    	this.interceptors = interceptors;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public final String getNextInterceptor() 
+    {
+    	if ( currentInterceptor == interceptors.size() )
+    	{
+    		return "FINAL";
+    	}
+    	
+		String interceptor = interceptors.get( currentInterceptor );
+		currentInterceptor++;
+		
+		return interceptor;
+	}
+
+
+    /**
      * Sets the set of bypassed Interceptors.
      * 
      * @param byPassed the set of bypassed Interceptors
@@ -298,7 +332,6 @@ public abstract class AbstractOperationC
     {
         opContext.setPreviousOperation( this );
         next = opContext;
-        opContext.setByPassed( byPassed );
         opContext.setAuthorizedPrincipal( authorizedPrincipal );
     }
     
@@ -321,11 +354,11 @@ public abstract class AbstractOperationC
     }
     
     
-    public void delete( Dn dn, Collection<String> byPassed ) throws LdapException
+    public void delete( Dn dn ) throws LdapException
     {
         DeleteOperationContext deleteContext = new DeleteOperationContext( session, dn );
         setup( deleteContext );
-        deleteContext.setByPassed( byPassed );
+        deleteContext.setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.DELETE ) );
         session.getDirectoryService().getOperationManager().delete( deleteContext );
     }
     

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/OperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/OperationContext.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/OperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/OperationContext.java Tue Nov  8 16:04:05 2011
@@ -272,6 +272,22 @@ public interface OperationContext
      */
     Collection<String> getByPassed();
     
+    /**
+     * Gets the next interceptor in the list of interceptors. The 
+     * position in the list will be incremented.
+     * 
+     * @return The next interceptor from the list of interceptors
+     */
+    String getNextInterceptor();
+    
+
+    /**
+     * Sets the list of interceptors to go through for an operation
+     * 
+     * @param interceptors The list of interceptors
+     */
+    void setInterceptors( List<String> interceptors );
+    
     
     /**
      * Sets the set of bypassed Interceptors.
@@ -312,7 +328,14 @@ public interface OperationContext
     void add( Entry entry, Collection<String> byPass ) throws LdapException;
     
     
-    void delete( Dn dn, Collection<String> byPass ) throws LdapException;
+    /**
+     * Process the delete for inner operations. This is only valid for SubschemaSubentry
+     * operations, and will most certainly be removed later.
+     *  
+     * @param dn
+     * @throws LdapException
+     */
+    void delete( Dn dn ) throws LdapException;
 
 
     /**

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockDirectoryService.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockDirectoryService.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockDirectoryService.java Tue Nov  8 16:04:05 2011
@@ -578,4 +578,11 @@ public class MockDirectoryService implem
         // TODO Auto-generated method stub
         return null;
     }
+
+
+	@Override
+	public List<String> getInterceptors(OperationEnum operation) {
+		// TODO Auto-generated method stub
+		return null;
+	}
 }

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.java Tue Nov  8 16:04:05 2011
@@ -24,7 +24,7 @@ import java.util.List;
 
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
-import org.apache.directory.server.core.api.interceptor.Interceptor;
+import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.api.interceptor.NextInterceptor;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
@@ -44,7 +44,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 
 
-public class MockInterceptor implements Interceptor
+public class MockInterceptor extends BaseInterceptor
 {
     final String name;
     final List<MockInterceptor> interceptors;
@@ -79,11 +79,14 @@ public class MockInterceptor implements 
     }
 
 
-    public Entry getRootDSE( NextInterceptor next, GetRootDSEOperationContext getRootDseContext )
+    /**
+     * {@inheritDoc}
+     */
+    public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext )
         throws LdapException
     {
         interceptors.add( this );
-        return next.getRootDSE( getRootDseContext );
+        return next( getRootDseContext );
     }
 
 
@@ -94,10 +97,13 @@ public class MockInterceptor implements 
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    /**
+     * {@inheritDoc}
+     */
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         interceptors.add( this );
-        next.delete( deleteContext );
+        next( deleteContext );
     }
 
 
@@ -171,10 +177,13 @@ public class MockInterceptor implements 
     }
 
 
-    public void unbind( NextInterceptor next, UnbindOperationContext unbindContext ) throws LdapException
+    /**
+     * {@inheritDoc}
+     */
+   public void unbind( UnbindOperationContext unbindContext ) throws LdapException
     {
         interceptors.add( this );
-        next.unbind( unbindContext );
+        next( unbindContext );
     }
 
 

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockOperation.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockOperation.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockOperation.java Tue Nov  8 16:04:05 2011
@@ -250,7 +250,7 @@ public class MockOperation implements Op
     }
 
 
-    public void delete( Dn dn, Collection<String> bypass ) throws LdapException
+    public void delete( Dn dn ) throws LdapException
     {
     }
 
@@ -308,4 +308,20 @@ public class MockOperation implements Op
     {
         return false;
     }
+
+
+	@Override
+	public void setInterceptors( List<String> interceptors ) 
+	{
+		// TODO Auto-generated method stub
+		
+	}
+
+
+	@Override
+	public String getNextInterceptor() 
+	{
+		// TODO Auto-generated method stub
+		return "";
+	}
 }

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Tue Nov  8 16:04:05 2011
@@ -49,6 +49,7 @@ import javax.naming.spi.DirectoryManager
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.server.core.api.OperationManager;
 import org.apache.directory.server.core.api.entry.ServerEntryUtils;
 import org.apache.directory.server.core.api.event.DirectoryListener;
@@ -352,21 +353,24 @@ public abstract class ServerContext impl
     protected void doDeleteOperation( Dn target ) throws Exception
     {
         // setup the op context and populate with request controls
-        DeleteOperationContext opCtx = new DeleteOperationContext( session, target );
+        DeleteOperationContext deleteContext = new DeleteOperationContext( session, target );
 
-        opCtx.addRequestControls( convertControls( true, requestControls ) );
+        deleteContext.addRequestControls( convertControls( true, requestControls ) );
 
         // Inject the referral handling into the operation context
-        injectReferralControl( opCtx );
+        injectReferralControl( deleteContext );
+
+        // We should get this list from the DS
+        deleteContext.setInterceptors( service.getInterceptors( OperationEnum.DELETE ) );
 
         // execute delete operation
         OperationManager operationManager = service.getOperationManager();
-        operationManager.delete( opCtx );
+        operationManager.delete( deleteContext );
 
         // clear the request controls and set the response controls
         requestControls = EMPTY_CONTROLS;
         responseControls = JndiUtils.toJndiControls( getDirectoryService().getLdapCodecService(),
-            opCtx.getResponseControls() );
+            deleteContext.getResponseControls() );
     }
 
 
@@ -597,10 +601,14 @@ public abstract class ServerContext impl
     {
         GetRootDSEOperationContext getRootDseContext = new GetRootDSEOperationContext( session, target );
         getRootDseContext.addRequestControls( convertControls( true, requestControls ) );
+        
+        // We should get this list from the DS
+        getRootDseContext.setInterceptors( service.getInterceptors( OperationEnum.GET_ROOT_DSE ) );
 
         // do not reset request controls since this is not an external
         // operation and not do bother setting the response controls either
         OperationManager operationManager = service.getOperationManager();
+        
         return operationManager.getRootDSE( getRootDseContext );
     }
 

Modified: directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java (original)
+++ directory/apacheds/trunk/core-shared/src/main/java/org/apache/directory/server/core/shared/DefaultCoreSession.java Tue Nov  8 16:04:05 2011
@@ -31,6 +31,7 @@ import org.apache.directory.server.const
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.server.core.api.OperationManager;
 import org.apache.directory.server.core.api.changelog.LogChange;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
@@ -87,17 +88,29 @@ import org.apache.directory.shared.util.
  */
 public class DefaultCoreSession implements CoreSession
 {
+	/** The DirectoryService we are connected to */
     private final DirectoryService directoryService;
+    
+    /** The Principal used to process operations */
     private final LdapPrincipal authenticatedPrincipal;
+    
+    /** The anonymous principal, if we have to process operation as anonymous */
     private final LdapPrincipal anonymousPrincipal;
+    
+    /** The authorized principal, which will be used when a user has been authorized */
     private LdapPrincipal authorizedPrincipal;
 
 
+    /**
+     * Creates a new instance of a DefaultCoreSession
+     * @param principal The principal to use to process operation for this session
+     * @param directoryService The DirectoryService to which we will send requests
+     */
     public DefaultCoreSession( LdapPrincipal principal, DirectoryService directoryService )
     {
         this.directoryService = directoryService;
-        this.authenticatedPrincipal = principal;
-        this.anonymousPrincipal = new LdapPrincipal( directoryService.getSchemaManager() );
+        authenticatedPrincipal = principal;
+        anonymousPrincipal = new LdapPrincipal( directoryService.getSchemaManager() );
     }
 
 
@@ -285,6 +298,9 @@ public class DefaultCoreSession implemen
 
         deleteContext.setLogChange( log );
 
+        // Gets the list of interceptors from the DS
+        deleteContext.setInterceptors( directoryService.getInterceptors( OperationEnum.DELETE ) );
+
         OperationManager operationManager = directoryService.getOperationManager();
         operationManager.delete( deleteContext );
     }
@@ -309,6 +325,9 @@ public class DefaultCoreSession implemen
         deleteContext.setLogChange( log );
         setReferralHandling( deleteContext, ignoreReferral );
 
+        // Gets the list of interceptors from the DS
+        deleteContext.setInterceptors( directoryService.getInterceptors( OperationEnum.DELETE ) );
+
         OperationManager operationManager = directoryService.getOperationManager();
         operationManager.delete( deleteContext );
     }
@@ -876,7 +895,11 @@ public class DefaultCoreSession implemen
 
         deleteContext.setLogChange( log );
 
+        // Gets the list of interceptors from the DS
+        deleteContext.setInterceptors( directoryService.getInterceptors( OperationEnum.DELETE ) );
+
         OperationManager operationManager = directoryService.getOperationManager();
+        
         try
         {
             operationManager.delete( deleteContext );
@@ -1070,15 +1093,32 @@ public class DefaultCoreSession implemen
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void unbind() throws LdapException
     {
+    	UnbindOperationContext unbindContext = new UnbindOperationContext( this );
+    	
+        // Gets the list of interceptors from the DS
+        unbindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.UNBIND ) );
+
         OperationManager operationManager = directoryService.getOperationManager();
-        operationManager.unbind( new UnbindOperationContext( this ) );
+        operationManager.unbind( unbindContext );
     }
 
 
-    public void unbind( UnbindRequest unbindRequest )
+    /**
+     * {@inheritDoc}
+     */
+    public void unbind( UnbindRequest unbindRequest ) throws LdapException
     {
-        // TODO Auto-generated method stub
+    	UnbindOperationContext unbindContext = new UnbindOperationContext( this, unbindRequest );
+    	
+        // Gets the list of interceptors from the DS
+        unbindContext.setInterceptors( directoryService.getInterceptors( OperationEnum.UNBIND ) );
+
+        OperationManager operationManager = directoryService.getOperationManager();
+        operationManager.unbind( unbindContext );
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Tue Nov  8 16:04:05 2011
@@ -26,14 +26,17 @@ import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.RandomAccessFile;
 import java.io.StringReader;
+import java.lang.reflect.Method;
 import java.nio.channels.FileLock;
 import java.nio.channels.OverlappingFileLockException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
+import java.util.concurrent.ConcurrentHashMap;
 
 import javax.naming.directory.Attributes;
 
@@ -45,6 +48,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.DnFactory;
 import org.apache.directory.server.core.api.InstanceLayout;
 import org.apache.directory.server.core.api.LdapPrincipal;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.server.core.api.OperationManager;
 import org.apache.directory.server.core.api.ReferralManager;
 import org.apache.directory.server.core.api.administrative.AccessControlAdministrativePoint;
@@ -234,6 +238,9 @@ public class DefaultDirectoryService imp
 
     /** The list of declared interceptors */
     private List<Interceptor> interceptors;
+    
+    /** A map associating a list of interceptor to each operation */
+    private Map<OperationEnum, List<String>> operationInterceptors;
 
     /** The System partition */
     private Partition systemPartition;
@@ -459,8 +466,53 @@ public class DefaultDirectoryService imp
     {
         List<Interceptor> cloned = new ArrayList<Interceptor>();
         cloned.addAll( interceptors );
+        
+        return cloned;
+    }
+
+
+    /**
+     * Returns interceptors in the server for a given operation.
+     *
+     * @return the interceptors in the server for the given operation.
+     */
+    public List<String> getInterceptors( OperationEnum operation )
+    {
+        List<String> cloned = new ArrayList<String>();
+        cloned.addAll( operationInterceptors.get( operation ) );
+        
         return cloned;
     }
+    
+    
+    /**
+     * Compute the list of interceptors to call for each operation
+     */
+    private void initOperationsList( OperationEnum... operations)
+    {
+    	operationInterceptors = new ConcurrentHashMap<OperationEnum, List<String>>();
+    	
+    	for ( OperationEnum operation : operations )
+    	{
+	    	List<String> operationList = new ArrayList<String>();
+	    	
+	        for ( Interceptor interceptor : interceptors )
+	        {
+		    	Method[] methods = interceptor.getClass().getDeclaredMethods();
+		    	
+		    	for ( Method method : methods )
+		    	{
+		    		if ( method.getName().equals( operation.getMethodName() ) )
+		    		{
+		    			operationList.add( interceptor.getName() );
+		    			break;
+		    		}
+		    	}
+	        }
+	        
+	        operationInterceptors.put( operation, operationList );
+    	}
+    }
 
 
     /**
@@ -472,17 +524,37 @@ public class DefaultDirectoryService imp
     {
         Set<String> names = new HashSet<String>();
 
+        // Check if we don't have duplicate names in the interceptors list
         for ( Interceptor interceptor : interceptors )
         {
             if ( names.contains( interceptor.getName() ) )
             {
                 LOG.warn( "Encountered duplicate definitions for {} interceptor", interceptor.getName() );
+                continue;
             }
             
             names.add( interceptor.getName() );
         }
-
+        
         this.interceptors = interceptors;
+
+        // Now update the Map that connect each operation with the list of interceptors.
+    	initOperationsList( 
+    			OperationEnum.ADD, 
+    			OperationEnum.BIND,
+    			OperationEnum.COMPARE,
+    			OperationEnum.DELETE,
+    			OperationEnum.GET_ROOT_DSE,
+    			OperationEnum.HAS_ENTRY,
+    			OperationEnum.LIST,
+    			OperationEnum.LOOKUP,
+    			OperationEnum.MODIFY,
+    			OperationEnum.MOVE,
+    			OperationEnum.MOVE_AND_RENAME,
+    			OperationEnum.RENAME,
+    			OperationEnum.SEARCH,
+    			OperationEnum.UNBIND
+    			);
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java Tue Nov  8 16:04:05 2011
@@ -23,10 +23,12 @@ package org.apache.directory.server.core
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.OperationManager;
 import org.apache.directory.server.core.api.ReferralManager;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
+import org.apache.directory.server.core.api.interceptor.Interceptor;
 import org.apache.directory.server.core.api.interceptor.InterceptorChain;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
@@ -51,6 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapAffectMultipleDsaException;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapNoSuchObjectException;
 import org.apache.directory.shared.ldap.model.exception.LdapOperationErrorException;
 import org.apache.directory.shared.ldap.model.exception.LdapPartialResultException;
 import org.apache.directory.shared.ldap.model.exception.LdapReferralException;
@@ -87,6 +90,44 @@ public class DefaultOperationManager imp
     }
 
 
+    /**
+     * Eagerly populates fields of operation contexts so multiple Interceptors
+     * in the processing pathway can reuse this value without performing a
+     * redundant lookup operation.
+     *
+     * @param opContext the operation context to populate with cached fields
+     */
+    private void eagerlyPopulateFields( OperationContext opContext ) throws LdapException
+    {
+        // If the entry field is not set for ops other than add for example
+        // then we set the entry but don't freak if we fail to do so since it
+        // may not exist in the first place
+
+        if ( opContext.getEntry() == null )
+        {
+            // We have to use the admin session here, otherwise we may have
+            // trouble reading the entry due to insufficient access rights
+            CoreSession adminSession = opContext.getSession().getDirectoryService().getAdminSession();
+            
+            LookupOperationContext lookupContext = new LookupOperationContext( adminSession, opContext.getDn(), SchemaConstants.ALL_ATTRIBUTES_ARRAY );
+            Entry foundEntry = opContext.getSession().getDirectoryService().getPartitionNexus().lookup( lookupContext );
+
+            if ( foundEntry != null )
+            {
+                opContext.setEntry( foundEntry );
+            }
+            else
+            {
+                // This is an error : we *must* have an entry if we want to be able to rename.
+                LdapNoSuchObjectException ldnfe = new LdapNoSuchObjectException( I18n.err( I18n.ERR_256_NO_SUCH_OBJECT,
+                    opContext.getDn() ) );
+
+                throw ldnfe;
+            }
+        }
+    }
+
+
     private LdapReferralException buildReferralException( Entry parentEntry, Dn childDn )
         throws LdapException //, LdapURLEncodingException
     {
@@ -443,9 +484,13 @@ public class DefaultOperationManager imp
             // Unlock the ReferralManager
             directoryService.getReferralManager().unlock();
 
-            // Call the Add method
-            InterceptorChain interceptorChain = directoryService.getInterceptorChain();
-            interceptorChain.delete( deleteContext );
+            // populate the context with the old entry
+            eagerlyPopulateFields( deleteContext );
+
+            // Call the Delete method
+            Interceptor head = directoryService.getInterceptor( deleteContext.getNextInterceptor() );
+
+            head.delete( deleteContext );
         }
         finally
         {
@@ -469,8 +514,9 @@ public class DefaultOperationManager imp
 
         try
         {
-            InterceptorChain chain = directoryService.getInterceptorChain();
-            return chain.getRootDSE( getRootDseContext );
+            Interceptor head = directoryService.getInterceptor( getRootDseContext.getNextInterceptor() );
+
+            return head.getRootDSE( getRootDseContext );
         }
         finally
         {
@@ -1035,7 +1081,10 @@ public class DefaultOperationManager imp
 
         try
         {
-            directoryService.getInterceptorChain().unbind( unbindContext );
+            // Call the Unbind method
+            Interceptor head = directoryService.getInterceptor( unbindContext.getNextInterceptor() );
+
+            head.unbind( unbindContext );
         }
         finally
         {

Modified: directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/admin/src/main/java/org/apache/directory/server/core/admin/AdministrativePointInterceptor.java Tue Nov  8 16:04:05 2011
@@ -1241,7 +1241,7 @@ public class AdministrativePointIntercep
      * </ul> 
      * {@inheritDoc}
      */
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         LOG.debug( ">>> Entering into the Administrative Interceptor, delRequest" );
         Entry entry = deleteContext.getEntry();
@@ -1253,7 +1253,7 @@ public class AdministrativePointIntercep
         if ( adminPoint == null )
         {
             // Nope, go on.
-            next.delete( deleteContext );
+            next( deleteContext );
 
             LOG.debug( "Exit from Administrative Interceptor" );
 
@@ -1278,7 +1278,7 @@ public class AdministrativePointIntercep
         }
 
         // Ok, we can remove the AP
-        next.delete( deleteContext );
+        next( deleteContext );
 
         // Now, update the AdminPoint cache
         deleteAdminPointCache( adminPoint, deleteContext );

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Tue Nov  8 16:04:05 2011
@@ -346,6 +346,7 @@ public class AuthenticationInterceptor e
             }
 
             String pwdChangedTime = DateUtils.getGeneralizedTime();
+            
             if ( ( policyConfig.getPwdMinAge() > 0 ) || ( policyConfig.getPwdMaxAge() > 0 ) )
             {
                 Attribute pwdChangedTimeAt = new DefaultAttribute( AT_PWD_CHANGED_TIME );
@@ -373,7 +374,7 @@ public class AuthenticationInterceptor e
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -382,12 +383,15 @@ public class AuthenticationInterceptor e
 
         checkAuthenticated( deleteContext );
         checkPwdReset( deleteContext );
-        next.delete( deleteContext );
+        next( deleteContext );
         invalidateAuthenticatorCaches( deleteContext.getDn() );
     }
 
 
-    public Entry getRootDSE( NextInterceptor next, GetRootDSEOperationContext getRootDseContext ) throws LdapException
+    /**
+     * {@inheritDoc}
+     */
+    public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -396,7 +400,8 @@ public class AuthenticationInterceptor e
 
         checkAuthenticated( getRootDseContext );
         checkPwdReset( getRootDseContext );
-        return next.getRootDSE( getRootDseContext );
+        
+        return next( getRootDseContext );
     }
 
 
@@ -409,6 +414,7 @@ public class AuthenticationInterceptor e
 
         checkAuthenticated( hasEntryContext );
         checkPwdReset( hasEntryContext );
+        
         return next.hasEntry( hasEntryContext );
     }
 
@@ -422,6 +428,7 @@ public class AuthenticationInterceptor e
 
         checkAuthenticated( listContext );
         checkPwdReset( listContext );
+        
         return next.list( listContext );
     }
 
@@ -780,6 +787,7 @@ public class AuthenticationInterceptor e
 
         checkAuthenticated( searchContext );
         checkPwdReset( searchContext );
+        
         return next.search( searchContext );
     }
 
@@ -936,6 +944,7 @@ public class AuthenticationInterceptor e
             if ( ( policyConfig != null ) && ( userEntry != null ) )
             {
                 Attribute pwdFailTimeAt = userEntry.get( PWD_FAILURE_TIME_AT );
+                
                 if ( pwdFailTimeAt == null )
                 {
                     pwdFailTimeAt = new DefaultAttribute( AT_PWD_FAILURE_TIME );
@@ -1017,6 +1026,7 @@ public class AuthenticationInterceptor e
             }
 
             Attribute pwdFailTimeAt = userEntry.get( AT_PWD_FAILURE_TIME );
+            
             if ( pwdFailTimeAt != null )
             {
                 Modification pwdFailTimeMod = new DefaultModification( REMOVE_ATTRIBUTE, pwdFailTimeAt );
@@ -1024,6 +1034,7 @@ public class AuthenticationInterceptor e
             }
 
             Attribute pwdAccLockedTimeAt = userEntry.get( AT_PWD_ACCOUNT_LOCKED_TIME );
+            
             if ( pwdAccLockedTimeAt != null )
             {
                 Modification pwdAccLockedTimeMod = new DefaultModification( REMOVE_ATTRIBUTE, pwdAccLockedTimeAt );
@@ -1095,9 +1106,9 @@ public class AuthenticationInterceptor e
 
 
     @Override
-    public void unbind( NextInterceptor next, UnbindOperationContext unbindContext ) throws LdapException
+    public void unbind( UnbindOperationContext unbindContext ) throws LdapException
     {
-        super.unbind( next, unbindContext );
+        next( unbindContext );
 
         // remove the Dn from the password reset Set
         // we do not perform a check to see if the reset flag in the associated ppolicy is enabled
@@ -1290,6 +1301,7 @@ public class AuthenticationInterceptor e
         boolean mustChange = false;
 
         Attribute pwdResetAt = userEntry.get( PWD_RESET_AT );
+        
         if ( pwdResetAt != null )
         {
             mustChange = Boolean.parseBoolean( pwdResetAt.getString() );
@@ -1304,6 +1316,7 @@ public class AuthenticationInterceptor e
         PwdModDetailsHolder pwdModDetails = new PwdModDetailsHolder();
 
         List<Modification> mods = modifyContext.getModItems();
+        
         for ( Modification m : mods )
         {
             Attribute at = m.getAttribute();

Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Tue Nov  8 16:04:05 2011
@@ -598,14 +598,14 @@ public class AciAuthorizationInterceptor
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         CoreSession session = deleteContext.getSession();
 
         // bypass authz code if we are disabled
         if ( !directoryService.isAccessControlEnabled() )
         {
-            next.delete( deleteContext );
+            next( deleteContext );
             return;
         }
 
@@ -620,7 +620,7 @@ public class AciAuthorizationInterceptor
         // bypass authz code but manage caches if operation is performed by the admin
         if ( isPrincipalAnAdministrator( principalDn ) )
         {
-            next.delete( deleteContext );
+            next( deleteContext );
 
             tupleCache.subentryDeleted( dn, entry );
             groupCache.groupDeleted( dn, entry );
@@ -645,7 +645,7 @@ public class AciAuthorizationInterceptor
 
         engine.checkPermission( aciContext );
 
-        next.delete( deleteContext );
+        next( deleteContext );
 
         tupleCache.subentryDeleted( dn, entry );
         groupCache.groupDeleted( dn, entry );

Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Tue Nov  8 16:04:05 2011
@@ -152,11 +152,11 @@ public class DefaultAuthorizationInterce
     //    Lookup, search and list operations need to be handled using a filter
     // and so we need access to the filter service.
 
-    public void delete( NextInterceptor nextInterceptor, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         if ( deleteContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
-            nextInterceptor.delete( deleteContext );
+            next( deleteContext );
             return;
         }
 
@@ -202,7 +202,7 @@ public class DefaultAuthorizationInterce
             }
         }
 
-        nextInterceptor.delete( deleteContext );
+        next( deleteContext );
     }
 
 

Modified: directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/changelog/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Tue Nov  8 16:04:05 2011
@@ -133,7 +133,7 @@ public class ChangeLogInterceptor extend
      * The delete operation has to be stored with a way to restore the deleted element.
      * There is no way to do that but reading the entry and dump it into the LOG.
      */
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         // @todo make sure we're not putting in operational attributes that cannot be user modified
         // must save the entry if change log is enabled
@@ -144,7 +144,7 @@ public class ChangeLogInterceptor extend
             serverEntry = getAttributes( deleteContext );
         }
 
-        next.delete( deleteContext );
+        next( deleteContext );
 
         if ( !changeLog.isEnabled() )
         {

Modified: directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/event/src/main/java/org/apache/directory/server/core/event/EventInterceptor.java Tue Nov  8 16:04:05 2011
@@ -182,10 +182,10 @@ public class EventInterceptor extends Ba
     /**
      * {@inheritDoc}
      */
-    public void delete( NextInterceptor next, final DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( final DeleteOperationContext deleteContext ) throws LdapException
     {
         List<RegistrationEntry> selecting = getSelectingRegistrations( deleteContext.getDn(), deleteContext.getEntry() );
-        next.delete( deleteContext );
+        next( deleteContext );
 
         if ( selecting.isEmpty() )
         {

Modified: directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/exception/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Tue Nov  8 16:04:05 2011
@@ -194,7 +194,7 @@ public class ExceptionInterceptor extend
      * Checks to make sure the entry being deleted exists, and has no children, otherwise throws the appropriate
      * LdapException.
      */
-    public void delete( NextInterceptor nextInterceptor, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         Dn dn = deleteContext.getDn();
 
@@ -204,7 +204,7 @@ public class ExceptionInterceptor extend
                 subschemSubentryDn ) );
         }
 
-        nextInterceptor.delete( deleteContext );
+        next( deleteContext );
 
         // Update the alias cache
         synchronized ( notAliasCache )

Modified: directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/journal/src/main/java/org/apache/directory/server/core/journal/JournalInterceptor.java Tue Nov  8 16:04:05 2011
@@ -151,7 +151,7 @@ public class JournalInterceptor extends 
     /**
      * {@inheritDoc}
      */
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         long opRevision = 0;
         
@@ -169,7 +169,7 @@ public class JournalInterceptor extends 
 
         try
         {
-            next.delete( deleteContext );
+            next( deleteContext );
 
             if ( journalEnabled )
             {

Modified: directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/logger/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java Tue Nov  8 16:04:05 2011
@@ -24,7 +24,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
-import org.apache.directory.server.core.api.interceptor.Interceptor;
+import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.api.interceptor.NextInterceptor;
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
@@ -57,7 +57,7 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class TimerInterceptor implements Interceptor
+public class TimerInterceptor extends BaseInterceptor
 {
     /** A aggregating logger */
     private static final Logger OPERATION_STATS = LoggerFactory.getLogger( "OPERATION_STATS" );
@@ -229,10 +229,10 @@ public class TimerInterceptor implements
     /**
      * {@inheritDoc}
      */
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         long t0 = System.nanoTime();
-        next.delete( deleteContext );
+        next( deleteContext );
         long delta = System.nanoTime() - t0;
         
         if ( IS_DEBUG_STATS )
@@ -274,11 +274,11 @@ public class TimerInterceptor implements
     /**
      * {@inheritDoc}
      */
-    public Entry getRootDSE( NextInterceptor next, GetRootDSEOperationContext getRootDseContext )
+    public Entry getRootDSE( GetRootDSEOperationContext getRootDseContext )
         throws LdapException
     {
         long t0 = System.nanoTime();
-        Entry rootDSE = next.getRootDSE( getRootDseContext );
+        Entry rootDSE = next( getRootDseContext );
         long delta = System.nanoTime() - t0;
         
         if ( IS_DEBUG_STATS )
@@ -545,10 +545,10 @@ public class TimerInterceptor implements
     /**
      * {@inheritDoc}
      */
-    public void unbind( NextInterceptor next, UnbindOperationContext unbindContext ) throws LdapException
+    public void unbind( UnbindOperationContext unbindContext ) throws LdapException
     {
         long t0 = System.nanoTime();
-        next.unbind( unbindContext );
+        next( unbindContext );
         long delta = System.nanoTime() - t0;
         
         if ( IS_DEBUG_STATS )

Modified: directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/normalization/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Tue Nov  8 16:04:05 2011
@@ -119,7 +119,7 @@ public class NormalizationInterceptor ex
     /**
      * {@inheritDoc}
      */
-    public void delete( NextInterceptor nextInterceptor, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         Dn dn = deleteContext.getDn();
 
@@ -128,7 +128,7 @@ public class NormalizationInterceptor ex
             dn.apply( schemaManager );
         }
 
-        nextInterceptor.delete( deleteContext );
+        next( deleteContext );
     }
 
 

Modified: directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Tue Nov  8 16:04:05 2011
@@ -261,10 +261,10 @@ public class ReferralInterceptor extends
      * 
      * If the entry does not exist in the server, we will get a NoSuchObject error
      */
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         // First delete the entry into the server
-        next.delete( deleteContext );
+        next( deleteContext );
 
         Entry entry = deleteContext.getEntry();
 

Modified: directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/trunk/interceptors/schema/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Tue Nov  8 16:04:05 2011
@@ -196,7 +196,7 @@ public class SchemaSubentryModifier
     public void deleteSchemaObject( OperationContext opContext, SchemaObject obj ) throws LdapException
     {
         Dn dn = getDn( obj );
-        opContext.delete( dn, BYPASS );
+        opContext.delete( dn );
     }
 
     
@@ -209,7 +209,7 @@ public class SchemaSubentryModifier
             "cn=" + schemaName, 
             SchemaConstants.OU_SCHEMA );
         
-        opContext.delete( dn, BYPASS );
+        opContext.delete( dn );
     }
 
 
@@ -221,7 +221,7 @@ public class SchemaSubentryModifier
             SchemaConstants.SYNTAX_CHECKERS_PATH,
             "cn=" + schemaName,
             SchemaConstants.OU_SCHEMA );
-        opContext.delete( dn, BYPASS );
+        opContext.delete( dn );
     }
 
 
@@ -234,7 +234,7 @@ public class SchemaSubentryModifier
             "cn=" + schemaName,
             SchemaConstants.OU_SCHEMA );
         
-        opContext.delete( dn, BYPASS );
+        opContext.delete( dn );
     }
 
 

Modified: directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/subtree/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Tue Nov  8 16:04:05 2011
@@ -974,7 +974,7 @@ public class SubentryInterceptor extends
     /**
      * {@inheritDoc}
      */
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         Dn dn = deleteContext.getDn();
         Entry entry = deleteContext.getEntry();
@@ -1004,12 +1004,12 @@ public class SubentryInterceptor extends
             directoryService.getSubentryCache().removeSubentry( dn );
 
             // Now delete the subentry itself
-            next.delete( deleteContext );
+            next( deleteContext );
         }
         else
         {
             // TODO : deal with AP removal.
-            next.delete( deleteContext );
+            next( deleteContext );
         }
     }
 

Modified: directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=1199319&r1=1199318&r2=1199319&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/trunk/interceptors/trigger/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Tue Nov  8 16:04:05 2011
@@ -293,14 +293,14 @@ public class TriggerInterceptor extends 
     }
 
 
-    public void delete( NextInterceptor next, DeleteOperationContext deleteContext ) throws LdapException
+    public void delete( DeleteOperationContext deleteContext ) throws LdapException
     {
         Dn name = deleteContext.getDn();
 
         // Bypass trigger handling if the service is disabled.
         if ( !enabled )
         {
-            next.delete( deleteContext );
+            next( deleteContext );
             return;
         }
 
@@ -317,7 +317,7 @@ public class TriggerInterceptor extends 
         Map<ActionTime, List<TriggerSpecification>> triggerMap = getActionTimeMappedTriggerSpecsForOperation(
             triggerSpecs, LdapOperation.DELETE );
 
-        next.delete( deleteContext );
+        next( deleteContext );
 
         triggerSpecCache.subentryDeleted( name, deletedEntry );