directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r951501 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/interceptor/ core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core-api/src/main/java/org/apache/directory/server/cor...
Date Fri, 04 Jun 2010 17:31:23 GMT
Author: elecharny
Date: Fri Jun  4 17:31:22 2010
New Revision: 951501

URL: http://svn.apache.org/viewvc?rev=951501&view=rev
Log:
Removed the removeContextPartition from the Interceptor, and removed the RemoveContextPartitionContext,
as they are not used.

Removed:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RemoveContextPartitionOperationContext.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.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/logger/TimerInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
Fri Jun  4 17:31:22 2010
@@ -43,7 +43,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -213,12 +212,6 @@ public abstract class BaseInterceptor im
     }
 
 
-    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext
opContext ) throws LdapException
-    {
-        next.removeContextPartition( opContext );
-    }
-
-
     public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws
LdapException
     {
         return next.compare( opContext );

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
Fri Jun  4 17:31:22 2010
@@ -39,7 +39,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -160,12 +159,6 @@ public interface Interceptor
 
 
     /**
-     * Filters {@link DefaultPartitionNexus#removeContextPartition( RemoveContextPartitionOperationContext
)} call.
-     */
-    void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext
opContext ) throws LdapException;
-
-
-    /**
      * Filters {@link DefaultPartitionNexus#compare( CompareOperationContext )} call.
      */
     boolean compare( NextInterceptor next, CompareOperationContext opContext) throws LdapException;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
Fri Jun  4 17:31:22 2010
@@ -47,7 +47,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -190,13 +189,6 @@ public class InterceptorChain
         }
 
 
-        public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext
opContext )
-            throws LdapException
-        {
-            nexus.removeContextPartition( opContext );
-        }
-
-
         public void bind( NextInterceptor next, BindOperationContext opContext ) throws LdapException
         {
             nexus.bind( opContext );
@@ -643,28 +635,6 @@ public class InterceptorChain
     }
 
 
-    public void removeContextPartition( RemoveContextPartitionOperationContext opContext
) throws LdapException
-    {
-        Element entry = getStartingEntry();
-        Interceptor head = entry.interceptor;
-        NextInterceptor next = entry.nextInterceptor;
-
-        try
-        {
-            head.removeContextPartition( next, opContext );
-        }
-        catch ( LdapException le )
-        {
-            throw le;
-        }
-        catch ( Throwable e )
-        {
-            throwInterceptorException( head, e );
-            throw new InternalError(); // Should be unreachable
-        }
-    }
-
-
     /**
      * Eagerly populates fields of operation contexts so multiple Interceptors 
      * in the processing pathway can reuse this value without performing a 
@@ -1008,14 +978,6 @@ public class InterceptorChain
                         return Element.this.nextEntry;
                     }
 
-                    //  I don't think we really need this since this check is performed by
the chain when
-                    //  getting the interceptor head to use.
-                    //
-                    //                    if ( invocation.isBypassed( DirectoryPartitionNexusProxy.BYPASS_ALL
) )
-                    //                    {
-                    //                        return tail;
-                    //                    }
-
                     Element next = Element.this.nextEntry;
                     while ( next != tail )
                     {
@@ -1380,27 +1342,6 @@ public class InterceptorChain
                         throwInterceptorException( interceptor, e );
                     }
                 }
-
-
-                public void removeContextPartition( RemoveContextPartitionOperationContext
opContext ) throws LdapException
-                {
-                    Element next = getNextEntry();
-                    Interceptor interceptor = next.interceptor;
-
-                    try
-                    {
-                        interceptor.removeContextPartition( next.nextInterceptor, opContext
);
-                    }
-                    catch ( LdapException le )
-                    {
-                        throw le;
-                    }
-                    catch ( Throwable e )
-                    {
-                        throwInterceptorException( interceptor, e );
-                        throw new InternalError(); // Should be unreachable
-                    }
-                }
             };
         }
     }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
Fri Jun  4 17:31:22 2010
@@ -38,7 +38,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -88,12 +87,6 @@ public interface NextInterceptor
 
 
     /**
-     * Calls the next interceptor's {@link DefaultPartitionNexus#removeContextPartition(
RemoveContextPartitionOperationContext )}.
-     */
-    void removeContextPartition( RemoveContextPartitionOperationContext opContext ) throws
LdapException;
-
-
-    /**
      * Calls the next interceptor's {@link Interceptor#delete(NextInterceptor, DeleteOperationContext
)}.
      */
     void delete( DeleteOperationContext opContext ) throws LdapException;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
Fri Jun  4 17:31:22 2010
@@ -28,7 +28,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
-import org.apache.directory.server.core.interceptor.context.RemoveContextPartitionOperationContext;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.util.StringTools;
@@ -78,7 +77,7 @@ public interface PartitionNexus extends 
      * @param opContext The Remove Partition context
      * @throws Exception If the removal can't be done
      */
-    public void removeContextPartition( RemoveContextPartitionOperationContext removeContextPartition
)
+    public void removeContextPartition( DN partitionDn )
         throws LdapException;
 
 

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java
(original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java
Fri Jun  4 17:31:22 2010
@@ -41,7 +41,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -114,14 +113,6 @@ public class MockInterceptor implements 
     }
 
 
-    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext
opContext )
-        throws LdapException
-    {
-        interceptors.add( this );
-        next.removeContextPartition( opContext );
-    }
-
-
     public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws
LdapException
     {
         interceptors.add( this );

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=951501&r1=951500&r2=951501&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
Fri Jun  4 17:31:22 2010
@@ -55,7 +55,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
-import org.apache.directory.server.core.interceptor.context.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.journal.DefaultJournal;
 import org.apache.directory.server.core.journal.Journal;
 import org.apache.directory.server.core.journal.JournalInterceptor;
@@ -605,9 +604,7 @@ public class DefaultDirectoryService imp
             return;
         }
 
-        RemoveContextPartitionOperationContext removePartitionCtx =
-                new RemoveContextPartitionOperationContext( adminSession, partition.getSuffixDn()
);
-        partitionNexus.removeContextPartition( removePartitionCtx );
+        partitionNexus.removeContextPartition( partition.getSuffixDn() );
     }
 
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
Fri Jun  4 17:31:22 2010
@@ -42,7 +42,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -136,10 +135,6 @@ public class TimerInterceptor implements
     private static AtomicLong totalMoveAndRename = new AtomicLong( 0 );
     private static AtomicInteger nbMoveAndRenameCalls = new AtomicInteger( 0 );
     
-    /** Stats for the RemoveContextPartition operation */
-    private static AtomicLong totalRemoveContextPartition = new AtomicLong( 0 );
-    private static AtomicInteger nbRemoveContextPartitionCalls = new AtomicInteger( 0 );
-
     /** Stats for the rename operation */
     private static AtomicLong totalRename = new AtomicLong( 0 );
     private static AtomicInteger nbRenameCalls = new AtomicInteger( 0 );
@@ -682,33 +677,4 @@ public class TimerInterceptor implements
         
         return suffixes; 
     }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext
opContext )
-        throws LdapException
-    {
-        long t0 = System.nanoTime();
-        next.removeContextPartition( opContext );
-        long delta = System.nanoTime() - t0;
-        
-        if ( IS_DEBUG_STATS )
-        {
-            nbRemoveContextPartitionCalls.incrementAndGet();
-            totalRemoveContextPartition.getAndAdd( delta );
-    
-            if ( nbRemoveContextPartitionCalls.get() % 1000 == 0 )
-            {
-                long average = totalRemoveContextPartition.get()/(nbRemoveContextPartitionCalls.get()
* 1000);
-                OPERATION_STATS.debug( name + " : Average removeContextPartition = {} microseconds,
nb removeContextPartitions = {}", average, nbRemoveContextPartitionCalls.get() );
-            }
-        }
-
-        if ( IS_DEBUG_TIME )
-        {
-            OPERATION_TIME.debug( "{} : Delta removeContextPartition = {}", name, delta );
-        }
-    }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
Fri Jun  4 17:31:22 2010
@@ -39,7 +39,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.DefaultPartitionNexus;
@@ -348,17 +347,6 @@ public class NormalizationInterceptor ex
 
 
     /**
-     * {@inheritDoc}
-     */
-    public void removeContextPartition( NextInterceptor next, RemoveContextPartitionOperationContext
opContext )
-        throws LdapException
-    {
-        opContext.getDn().normalize( schemaManager.getNormalizerMapping() );
-        next.removeContextPartition( opContext );
-    }
-
-
-    /**
      * Adds missing RDN's attributes and values to the entry.
      *
      * @param dn the DN

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=951501&r1=951500&r2=951501&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Fri Jun  4 17:31:22 2010
@@ -58,7 +58,6 @@ import org.apache.directory.server.core.
 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.RemoveContextPartitionOperationContext;
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
@@ -372,9 +371,8 @@ public class DefaultPartitionNexus exten
             {
                 DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
                 adminDn.normalize( schemaManager.getNormalizerMapping() );
-                CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn,
-                    AuthenticationLevel.STRONG ), directoryService );
-                removeContextPartition( new RemoveContextPartitionOperationContext( adminSession,
new DN( suffix ) ) );
+
+                removeContextPartition(  new DN( suffix ) );
             }
             catch ( Exception e )
             {
@@ -984,13 +982,13 @@ public class DefaultPartitionNexus exten
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.PartitionNexus#removeContextPartition(org.apache.directory.server.core.interceptor.context.RemoveContextPartitionOperationContext)
+     * @see org.apache.directory.server.core.partition.PartitionNexus#removeContextPartition(DN
partitionDN)
      */
-    public synchronized void removeContextPartition( RemoveContextPartitionOperationContext
removeContextPartition )
+    public synchronized void removeContextPartition( DN partitionDn )
         throws LdapException
     {
         // Get the Partition name. It's a DN.
-        String key = removeContextPartition.getDn().getNormName();
+        String key = partitionDn.getNormName();
 
         // Retrieve this partition from the aprtition's table
         Partition partition = partitions.get( key );



Mime
View raw message