directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1200460 - in /directory/apacheds/trunk: core-api/src/main/java/org/apache/directory/server/core/api/interceptor/ core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/ core-api/src/test/java/org/apache/directory/s...
Date Thu, 10 Nov 2011 18:13:13 GMT
Author: elecharny
Date: Thu Nov 10 18:13:12 2011
New Revision: 1200460

URL: http://svn.apache.org/viewvc?rev=1200460&view=rev
Log:
Moved the Move operation out of the InterceptorChain

Modified:
    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/MoveOperationContext.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/api/MockInterceptor.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/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/interceptors/referral/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.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/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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -226,7 +226,7 @@ public abstract class BaseInterceptor im
         /**
          * {@inheritDoc}
          */
-        public void move( NextInterceptor next, MoveOperationContext moveContext ) throws
LdapException
+        public void move( MoveOperationContext moveContext ) throws LdapException
         {
             nexus.move( moveContext );
         }
@@ -559,9 +559,23 @@ public abstract class BaseInterceptor im
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
-        next.move( moveContext );
+        // Nothing to do
+    }
+
+
+    /**
+     * Calls the next interceptor for the move operation.
+     * 
+     * @param moveContext The context in which we are executing this operation
+     * @throws LdapException If something went wrong
+     */
+    protected final void next( MoveOperationContext moveContext ) throws LdapException
+    {
+        Interceptor interceptor = getNextInterceptor( moveContext );
+
+        interceptor.move( moveContext );
     }
 
 

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -191,7 +191,7 @@ public interface Interceptor
     /**
      * Filters {@link Partition#move( MoveOperationContext )} call.
      */
-    void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException;
+    void move( MoveOperationContext moveContext ) 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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -166,7 +166,7 @@ public class InterceptorChain
         }
 
 
-        public void move( NextInterceptor next, MoveOperationContext moveContext ) throws
LdapException
+        public void move( MoveOperationContext moveContext ) throws LdapException
         {
             nexus.move( moveContext );
         }
@@ -642,30 +642,6 @@ public class InterceptorChain
     }
 
 
-    public void move( MoveOperationContext moveContext ) throws LdapException
-    {
-        Element entry = getStartingEntry();
-        Interceptor head = entry.interceptor;
-        NextInterceptor next = entry.nextInterceptor;
-        Entry originalEntry = getOriginalEntry( moveContext );
-
-        moveContext.setOriginalEntry( originalEntry );
-
-        try
-        {
-            head.move( next, moveContext );
-        }
-        catch ( LdapException le )
-        {
-            throw le;
-        }
-        catch ( Throwable e )
-        {
-            throwInterceptorException( head, e );
-        }
-    }
-
-
     public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws
LdapException
     {
         Element entry = getStartingEntry();
@@ -825,28 +801,6 @@ public class InterceptorChain
                 }
 
 
-                public void move( MoveOperationContext moveContext ) throws LdapException
-                {
-                    Element next = getNextEntry();
-                    Interceptor interceptor = next.interceptor;
-
-                    try
-                    {
-                        //System.out.println( ">>> Entering into " + interceptor.getClass().getSimpleName()
+ ", moveRequest" );
-                        interceptor.move( next.nextInterceptor, moveContext );
-                        //System.out.println( "<<< Exiting from " + interceptor.getClass().getSimpleName()
+ ", moveRequest" );
-                    }
-                    catch ( LdapException le )
-                    {
-                        throw le;
-                    }
-                    catch ( Throwable e )
-                    {
-                        throwInterceptorException( interceptor, e );
-                    }
-                }
-
-
                 public void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext
) throws LdapException
                 {
                     Element next = getNextEntry();

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -24,7 +24,6 @@ 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.ModifyOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.MoveAndRenameOperationContext;
-import org.apache.directory.server.core.api.interceptor.context.MoveOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 
@@ -51,12 +50,6 @@ public interface NextInterceptor
 
 
     /**
-     * Calls the next interceptor's {@link Interceptor#move( NextInterceptor, MoveOperationContext
)}.
-     */
-    void move( MoveOperationContext moveContext ) throws LdapException;
-
-
-    /**
      * Calls the next interceptor's {@link Interceptor#moveAndRename( NextInterceptor, MoveAndRenameOperationContext
)}.
      */
     void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) 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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.api.interceptor.context;
 
@@ -49,13 +49,13 @@ public abstract class AbstractOperationC
 
     /** The Dn associated with the context */
     protected Dn dn;
-    
+
     /** The entry associated with the target entry of this OperationContext */
     protected Entry entry;
 
     /** The original Entry */
     protected Entry originalEntry;
-    
+
     /** The associated request's controls */
     protected Map<String, Control> requestControls = new HashMap<String, Control>(4);
 
@@ -64,26 +64,26 @@ public abstract class AbstractOperationC
 
     /** the Interceptors bypassed by this operation */
     protected Collection<String> byPassed;
-    
+
     /** The interceptors to call for this operation */
     protected List<String> interceptors;
-    
+
     /** The current interceptor position */
     protected int currentInterceptor;
-    
-	protected LdapPrincipal authorizedPrincipal;
-    
+
+    protected LdapPrincipal authorizedPrincipal;
+
     /** The core session */
     protected CoreSession session;
-    
+
     protected OperationContext next;
-    
+
     protected OperationContext previous;
 
     /** A flag used to tell if we should consider referrals as standard entries */
     protected boolean throwReferral;
-    
-    
+
+
     /**
      * Creates a new instance of AbstractOperationContext.
      */
@@ -92,8 +92,8 @@ public abstract class AbstractOperationC
         this.session = session;
         currentInterceptor = 0;
     }
-    
-    
+
+
     /**
      * Creates a new instance of AbstractOperationContext.
      *
@@ -103,8 +103,8 @@ public abstract class AbstractOperationC
     {
         this.dn = dn;
         this.session = session;
-        
-        // The flag is set to ignore, so that the revert operation can act on 
+
+        // The flag is set to ignore, so that the revert operation can act on
         // the entries, even if they are referrals.
         ignoreReferral();
     }
@@ -114,14 +114,14 @@ public abstract class AbstractOperationC
     {
         return session;
     }
-    
-    
+
+
     public void setSession( CoreSession session )
     {
         this.session = session;
     }
-    
-    
+
+
     protected void setAuthorizedPrincipal( LdapPrincipal authorizedPrincipal )
     {
         this.authorizedPrincipal = authorizedPrincipal;
@@ -136,7 +136,7 @@ public abstract class AbstractOperationC
         return dn;
     }
 
-    
+
     /**
      * Set the context Dn
      *
@@ -147,25 +147,25 @@ public abstract class AbstractOperationC
         this.dn = dn;
     }
 
-    
+
     public void addRequestControl( Control requestControl )
     {
         requestControls.put( requestControl.getOid(), requestControl );
     }
 
-    
+
     public Control getRequestControl( String numericOid )
     {
         return requestControls.get( numericOid );
     }
 
-    
+
     public boolean hasRequestControl( String numericOid )
     {
         return requestControls.containsKey( numericOid );
     }
 
-    
+
     public boolean hasRequestControls()
     {
         return ! requestControls.isEmpty();
@@ -196,7 +196,7 @@ public abstract class AbstractOperationC
         {
             return EMPTY_CONTROLS;
         }
-        
+
         return responseControls.values().toArray( EMPTY_CONTROLS );
     }
 
@@ -221,13 +221,13 @@ public abstract class AbstractOperationC
         }
     }
 
-    
+
     public void setRequestControls( Map<String, Control> requestControls )
     {
         this.requestControls = requestControls;
     }
 
-    
+
     /**
      * @return the operation name
      */
@@ -263,35 +263,35 @@ public abstract class AbstractOperationC
         {
             return Collections.emptyList();
         }
-        
+
         return Collections.unmodifiableCollection( byPassed );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public final void setInterceptors( List<String> interceptors )
     {
-    	this.interceptors = interceptors;
+        this.interceptors = interceptors;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public final String getNextInterceptor() 
+    public final String getNextInterceptor()
     {
-    	if ( currentInterceptor == interceptors.size() )
-    	{
-    		return "FINAL";
-    	}
-    	
-		String interceptor = interceptors.get( currentInterceptor );
-		currentInterceptor++;
-		
-		return interceptor;
-	}
+        if ( currentInterceptor == interceptors.size() )
+        {
+            return "FINAL";
+        }
+
+        String interceptor = interceptors.get( currentInterceptor );
+        currentInterceptor++;
+
+        return interceptor;
+    }
 
 
     /**
@@ -304,7 +304,7 @@ public abstract class AbstractOperationC
         this.byPassed = byPassed;
     }
 
-    
+
     /**
      * Checks to see if an Interceptor is bypassed for this operation.
      *
@@ -327,15 +327,15 @@ public abstract class AbstractOperationC
         return byPassed != null && !byPassed.isEmpty();
     }
 
-    
+
     private void setup( AbstractOperationContext opContext )
     {
         opContext.setPreviousOperation( this );
         next = opContext;
         opContext.setAuthorizedPrincipal( authorizedPrincipal );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -346,8 +346,8 @@ public abstract class AbstractOperationC
         addContext.setByPassed( byPassed );
         session.getDirectoryService().getOperationManager().add( addContext );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -357,8 +357,8 @@ public abstract class AbstractOperationC
         setup( deleteContext );
         session.getDirectoryService().getOperationManager().delete( deleteContext );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -367,7 +367,7 @@ public abstract class AbstractOperationC
         EntryOperationContext hasEntryContext = new EntryOperationContext( session, dn );
         setup( hasEntryContext );
         hasEntryContext.setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.HAS_ENTRY
) );
-        
+
         return session.getDirectoryService().getOperationManager().hasEntry( hasEntryContext
);
     }
 
@@ -378,7 +378,7 @@ public abstract class AbstractOperationC
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_319 ) );
         }
-        
+
         return session.getDirectoryService().getOperationManager().lookup( lookupContext
);
     }
 
@@ -398,8 +398,8 @@ public abstract class AbstractOperationC
         lookupContext.setAttrsId( attrIds );
         return session.getDirectoryService().getOperationManager().lookup( lookupContext
);
     }
-    
-    
+
+
     public void modify( Dn dn, List<Modification> mods, Collection<String> byPassed
) throws LdapException
     {
         ModifyOperationContext modifyContext = new ModifyOperationContext( session, dn, mods
);
@@ -407,8 +407,8 @@ public abstract class AbstractOperationC
         modifyContext.setByPassed( byPassed );
         session.getDirectoryService().getOperationManager().modify( modifyContext );
     }
-    
-    
+
+
     // TODO - need synchronization here and where we update links
     public LookupOperationContext newLookupContext( Dn dn )
     {
@@ -422,62 +422,62 @@ public abstract class AbstractOperationC
         {
             return authorizedPrincipal;
         }
-        
+
         return session.getEffectivePrincipal();
     }
-    
-    
+
+
     // -----------------------------------------------------------------------
     // OperationContext Linked List Methods
     // -----------------------------------------------------------------------
-    
-    
+
+
     public boolean isFirstOperation()
     {
         return previous == null;
     }
-    
-    
+
+
     public OperationContext getFirstOperation()
     {
         if ( previous == null )
         {
             return this;
         }
-        
+
         return previous.getFirstOperation();
     }
-    
-    
+
+
     public OperationContext getLastOperation()
     {
         if ( next == null )
         {
             return this;
         }
-        
+
         return next.getLastOperation();
     }
-    
-    
+
+
     public OperationContext getNextOperation()
     {
         return next;
     }
-    
-    
+
+
     protected void setNextOperation( OperationContext next )
     {
         this.next = next;
     }
-    
-    
+
+
     public OperationContext getPreviousOperation()
     {
         return previous;
     }
-    
-    
+
+
     protected void setPreviousOperation( OperationContext previous )
     {
         this.previous = previous;
@@ -500,8 +500,8 @@ public abstract class AbstractOperationC
     {
         return entry;
     }
-    
-    
+
+
     /**
      * Set the throwReferral flag to true
      */
@@ -509,8 +509,8 @@ public abstract class AbstractOperationC
     {
         throwReferral = true;
     }
-    
-    
+
+
     /**
      * @return <code>true</code> if the referrals are thrown
      */

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java?rev=1200460&r1=1200459&r2=1200460&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/context/MoveOperationContext.java
Thu Nov 10 18:13:12 2011
@@ -6,21 +6,22 @@
  *  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. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.server.core.api.interceptor.context;
 
 
 import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.OperationEnum;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
@@ -43,13 +44,13 @@ public class MoveOperationContext extend
 
     /** The entry Rdn */
     private Rdn rdn;
-    
+
     /** The newSuperior Dn */
     private Dn newSuperior;
-    
+
     /** The New target Dn */
     private Dn newDn;
-    
+
 
     /**
      * Creates a new instance of MoveOperationContext.
@@ -57,8 +58,9 @@ public class MoveOperationContext extend
     public MoveOperationContext( CoreSession session )
     {
         super( session );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
     }
-    
+
 
     /**
      * Creates a new instance of MoveOperationContext.
@@ -68,8 +70,9 @@ public class MoveOperationContext extend
         super( session, oldDn );
         this.newSuperior = newSuperior;
         oldSuperior = oldDn.getParent();
-        rdn = (Rdn)( oldDn.getRdn().clone() );
-        
+        rdn = ( oldDn.getRdn().clone() );
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+
         try
         {
             newDn = newSuperior.add( rdn );
@@ -80,24 +83,25 @@ public class MoveOperationContext extend
         }
     }
 
-    
+
     public MoveOperationContext( CoreSession session, ModifyDnRequest modifyDnRequest )
     {
         super( session, modifyDnRequest.getName() );
         this.newSuperior = modifyDnRequest.getNewSuperior();
-        
+        setInterceptors( session.getDirectoryService().getInterceptors( OperationEnum.MOVE
) );
+
         if ( newSuperior == null )
         {
             throw new IllegalArgumentException( I18n.err( I18n.ERR_326_NEW_SUPERIROR_CANNOT_BE_NULL,
modifyDnRequest ) );
         }
-        
+
         this.requestControls = modifyDnRequest.getControls();
-        
+
         if ( modifyDnRequest.getNewRdn() != null )
         {
             throw new IllegalArgumentException( I18n.err( I18n.ERR_327_MOVE_AND_RENAME_OPERATION,
modifyDnRequest ) );
         }
-        
+
         if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
@@ -108,10 +112,10 @@ public class MoveOperationContext extend
         }
 
         oldSuperior = modifyDnRequest.getName().getParent();
-        rdn = (Rdn)(modifyDnRequest.getName().getRdn().clone());
-        
+        rdn = (modifyDnRequest.getName().getRdn().clone());
+
         try
-        { 
+        {
             newDn = newSuperior.add( rdn );
         }
         catch ( LdapInvalidDnException lide )
@@ -137,7 +141,7 @@ public class MoveOperationContext extend
     {
         return newSuperior;
     }
-    
+
 
     /**
      *  @return The Rdn
@@ -146,8 +150,8 @@ public class MoveOperationContext extend
     {
         return rdn;
     }
-    
-    
+
+
     /**
      *  @return The new Dn
      */
@@ -155,7 +159,7 @@ public class MoveOperationContext extend
     {
         return newDn;
     }
-    
+
 
     /**
      * @return the operation name
@@ -165,13 +169,13 @@ public class MoveOperationContext extend
         return MessageTypeEnum.MODIFYDN_REQUEST.name();
     }
 
-    
+
     /**
      * @see Object#toString()
      */
     public String toString()
     {
         return "ReplaceContext for old Dn '" + getDn().getName() + "'" +
-        ", newSuperior '" + newSuperior + "'";
+            ", newSuperior '" + newSuperior + "'";
     }
 }

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -173,10 +173,10 @@ public class MockInterceptor extends Bas
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move(  MoveOperationContext moveContext ) throws LdapException
     {
         interceptors.add( this );
-        next.move( moveContext );
+        next( moveContext );
     }
 
 

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -809,9 +809,14 @@ public class DefaultOperationManager imp
             // Unlock the ReferralManager
             directoryService.getReferralManager().unlock();
 
-            // Call the Add method
-            InterceptorChain interceptorChain = directoryService.getInterceptorChain();
-            interceptorChain.move( moveContext );
+            Entry originalEntry = getOriginalEntry( moveContext );
+
+            moveContext.setOriginalEntry( originalEntry );
+
+            // Call the Move method
+            Interceptor head = directoryService.getInterceptor( moveContext.getNextInterceptor()
);
+
+            head.move( moveContext );
         }
         finally
         {
@@ -1012,7 +1017,7 @@ public class DefaultOperationManager imp
             renameContext.setOriginalEntry( originalEntry );
             renameContext.setModifiedEntry( originalEntry.clone() );
 
-            // Call the Delete method
+            // Call the Rename method
             Interceptor head = directoryService.getInterceptor( renameContext.getNextInterceptor()
);
 
             head.rename( renameContext );

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -1432,7 +1432,7 @@ public class AdministrativePointIntercep
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         LOG.debug( ">>> Entering into the Administrative Interceptor, moveRequest"
);
         Entry entry = moveContext.getOriginalEntry();
@@ -1443,7 +1443,7 @@ public class AdministrativePointIntercep
         if ( adminPoint == null )
         {
             // Nope, go on.
-            next.move( moveContext );
+            next( moveContext );
 
             LOG.debug( "Exit from Administrative Interceptor" );
 

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -769,7 +769,7 @@ public class AuthenticationInterceptor e
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         if ( IS_DEBUG )
         {
@@ -778,7 +778,7 @@ public class AuthenticationInterceptor e
 
         checkAuthenticated( moveContext );
         checkPwdReset( moveContext );
-        next.move( moveContext );
+        next( moveContext );
         invalidateAuthenticatorCaches( moveContext.getDn() );
     }
 

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -1120,7 +1120,7 @@ public class AciAuthorizationInterceptor
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         Dn oriChildName = moveContext.getDn();
 
@@ -1136,7 +1136,7 @@ public class AciAuthorizationInterceptor
         // bypass authz code if we are disabled
         if ( !directoryService.isAccessControlEnabled() )
         {
-            next.move( moveContext );
+            next( moveContext );
             return;
         }
 
@@ -1145,7 +1145,7 @@ public class AciAuthorizationInterceptor
         // bypass authz code but manage caches if operation is performed by the admin
         if ( isPrincipalAnAdministrator( principalDn ) )
         {
-            next.move( moveContext );
+            next( moveContext );
             tupleCache.subentryRenamed( oriChildName, newDn );
             groupCache.groupRenamed( oriChildName, newDn );
             return;
@@ -1205,7 +1205,7 @@ public class AciAuthorizationInterceptor
 
         engine.checkPermission( aciContext );
 
-        next.move( moveContext );
+        next( moveContext );
         tupleCache.subentryRenamed( oriChildName, newDn );
         groupCache.groupRenamed( oriChildName, newDn );
     }

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -319,14 +319,14 @@ public class DefaultAuthorizationInterce
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext )
throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         if ( !moveContext.getSession().getDirectoryService().isAccessControlEnabled() )
         {
             protectDnAlterations( moveContext, moveContext.getDn() );
         }
 
-        nextInterceptor.move( moveContext );
+        next( moveContext );
     }
 
 

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -365,9 +365,9 @@ public class ChangeLogInterceptor extend
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
-        next.move( moveContext );
+        next( moveContext );
 
         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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -302,12 +302,12 @@ public class EventInterceptor extends Ba
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         Entry oriEntry = moveContext.getOriginalEntry();
         List<RegistrationEntry> selecting = getSelectingRegistrations( moveContext.getDn(),
oriEntry );
 
-        next.move( moveContext );
+        next( moveContext );
 
         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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -334,7 +334,7 @@ public class ExceptionInterceptor extend
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext )
throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         Dn oriChildName = moveContext.getDn();
 
@@ -344,7 +344,7 @@ public class ExceptionInterceptor extend
                 subschemSubentryDn, subschemSubentryDn ) );
         }
 
-        nextInterceptor.move( moveContext );
+        next( moveContext );
 
         // Remove the original entry from the NotAlias cache, if needed
         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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -330,7 +330,7 @@ public class JournalInterceptor extends 
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         long opRevision = 0;
 
@@ -349,7 +349,7 @@ public class JournalInterceptor extends 
 
         try
         {
-            next.move( moveContext );
+            next( moveContext );
 
             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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -430,10 +430,10 @@ public class TimerInterceptor extends Ba
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         long t0 = System.nanoTime();
-        next.move( moveContext );
+        next( moveContext );
         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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -182,7 +182,7 @@ public class NormalizationInterceptor ex
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext )
throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         if ( !moveContext.getDn().isSchemaAware() )
         {
@@ -209,7 +209,7 @@ public class NormalizationInterceptor ex
             moveContext.getRdn().apply( schemaManager );
         }
 
-        nextInterceptor.move( moveContext );
+        next( moveContext );
     }
 
 

Modified: directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=1200460&r1=1200459&r2=1200460&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/operational/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
Thu Nov 10 18:13:12 2011
@@ -363,7 +363,7 @@ public class OperationalAttributeInterce
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor nextInterceptor, MoveOperationContext moveContext )
throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         Entry modifiedEntry = moveContext.getOriginalEntry().clone();
         modifiedEntry.put( SchemaConstants.MODIFIERS_NAME_AT, getPrincipal( moveContext ).getName()
);
@@ -371,7 +371,7 @@ public class OperationalAttributeInterce
         modifiedEntry.setDn( moveContext.getNewDn() );
         moveContext.setModifiedEntry( modifiedEntry );
 
-        nextInterceptor.move( moveContext );
+        next( moveContext );
     }
 
 

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -285,14 +285,14 @@ public class ReferralInterceptor extends
     /**
      * {@inheritDoc}
      **/
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         Dn newDn = moveContext.getNewDn();
 
         // Check if the entry is a referral itself
         boolean isReferral = isReferral( moveContext.getOriginalEntry() );
 
-        next.move( moveContext );
+        next( moveContext );
 
         if ( isReferral )
         {

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -1223,7 +1223,7 @@ public class SubentryInterceptor extends
      * @param moveContext The context containing all the needed informations to proceed
      * @throws LdapException If the move failed
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         Dn oldDn = moveContext.getDn();
         Dn newSuperiorDn = moveContext.getNewSuperior();
@@ -1252,7 +1252,7 @@ public class SubentryInterceptor extends
 
             directoryService.getSubentryCache().addSubentry( newName, subentry );
 
-            next.move( moveContext );
+            next( moveContext );
 
             subentry = directoryService.getSubentryCache().getSubentry( newName );
 
@@ -1316,7 +1316,7 @@ public class SubentryInterceptor extends
             }
 
             // Move the entry
-            next.move( moveContext );
+            next( moveContext );
 
             // calculate the new Dn now for use below to modify subentry operational
             // attributes contained within this regular entry with name changes

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=1200460&r1=1200459&r2=1200460&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
Thu Nov 10 18:13:12 2011
@@ -482,12 +482,12 @@ public class TriggerInterceptor extends 
     /**
      * {@inheritDoc}
      */
-    public void move( NextInterceptor next, MoveOperationContext moveContext ) throws LdapException
+    public void move( MoveOperationContext moveContext ) throws LdapException
     {
         // Bypass trigger handling if the service is disabled.
         if ( !enabled )
         {
-            next.move( moveContext );
+            next( moveContext );
             return;
         }
 
@@ -543,7 +543,7 @@ public class TriggerInterceptor extends 
         Map<ActionTime, List<TriggerSpecification>> importTriggerMap = getActionTimeMappedTriggerSpecsForOperation(
             importTriggerSpecs, LdapOperation.MODIFYDN_IMPORT );
 
-        next.move( moveContext );
+        next( moveContext );
         triggerSpecCache.subentryRenamed( dn, newDn );
 
         // Fire AFTER Triggers.



Mime
View raw message