directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r954152 - in /directory/apacheds/trunk: core-annotations/src/main/java/org/apache/directory/server/core/factory/ core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/interceptor/ c...
Date Sun, 13 Jun 2010 00:44:33 GMT
Author: elecharny
Date: Sun Jun 13 00:44:32 2010
New Revision: 954152

URL: http://svn.apache.org/viewvc?rev=954152&view=rev
Log:
o Started to clean the moveAndRename operation
o Re-organized the referral tests to make them passing
o Added the controls into the LDIF reverter

Added:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
Modified:
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.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/context/MoveAndRenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/moveAndRename/MoveAndRenamePerfIT.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.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/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/suites/StockServerISuite.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java Sun Jun 13 00:44:32 2010
@@ -242,7 +242,7 @@ public class DSAnnotationProcessor
      */
     private static void injectEntry( LdifEntry entry, DirectoryService service ) throws LdapException
     {
-        if ( entry.isChangeAdd() )
+        if ( entry.isChangeAdd() || entry.isLdifContent() )
         {
             service.getAdminSession().add( new DefaultEntry( service.getSchemaManager(), entry.getEntry() ) );
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java Sun Jun 13 00:44:32 2010
@@ -601,6 +601,7 @@ public class LdapCoreSessionConnection i
     {
         ModifyDnResponse resp = new ModifyDnResponse();
         resp.setLdapResult( getDefaultResult() );
+        
         try
         {
             InternalModifyDnRequest iModDnReq = new ModifyDnRequestImpl( modDnRequest.getMessageId() );
@@ -627,6 +628,7 @@ public class LdapCoreSessionConnection i
     {
         ModifyDnResponse resp = new ModifyDnResponse();
         resp.setLdapResult( getDefaultResult() );
+        
         try
         {
             session.move( entryDn, newSuperiorDn );
@@ -668,6 +670,7 @@ public class LdapCoreSessionConnection i
     {
         ModifyDnResponse resp = new ModifyDnResponse();
         resp.setLdapResult( getDefaultResult() );
+        
         try
         {
             session.rename( entryDn, newRdn, deleteOldRdn );
@@ -688,6 +691,7 @@ public class LdapCoreSessionConnection i
     {
         ModifyDnResponse resp = new ModifyDnResponse();
         resp.setLdapResult( getDefaultResult() );
+        
         try
         {
             session.rename( entryDn, newRdn, false );
@@ -708,6 +712,7 @@ public class LdapCoreSessionConnection i
     {
         ModifyDnResponse resp = new ModifyDnResponse();
         resp.setLdapResult( getDefaultResult() );
+        
         try
         {
             session.rename( new DN( entryDn ), new RDN( newRdn ), deleteOldRdn );
@@ -745,6 +750,87 @@ public class LdapCoreSessionConnection i
 
 
     /**
+     * Moves and renames the given entryDn.The old RDN will be deleted
+     * 
+     * @see #moveAndRename(DN, DN, boolean)
+     */
+    public ModifyDnResponse moveAndRename( DN entryDn, DN newDn ) throws LdapException
+    {
+        return moveAndRename( entryDn, newDn, true );
+    }
+
+
+    /**
+     * Moves and renames the given entryDn.The old RDN will be deleted
+     * 
+     * @see #moveAndRename(DN, DN, boolean)
+     */
+    public ModifyDnResponse moveAndRename( String entryDn, String newDn ) throws LdapException
+    {
+        return moveAndRename( new DN( entryDn ), new DN( newDn ), true );
+    }
+
+
+    /**
+     * Moves and renames the given entryDn.The old RDN will be deleted if requested
+     * 
+     * @param entryDn The original entry DN
+     * @param newDn The new Entry DN
+     * @param deleteOldRdn Tells if the old RDN must be removed
+     */
+    public ModifyDnResponse moveAndRename( DN entryDn, DN newDn, boolean deleteOldRdn ) throws LdapException
+    {
+        // Check the parameters first
+        if ( entryDn == null ) 
+        {
+            throw new IllegalArgumentException( "The entry DN must not be null" );
+        }
+        
+        if ( entryDn.isRootDSE() )
+        {
+            throw new IllegalArgumentException( "The RootDSE cannot be moved" );
+        }
+        
+        if ( newDn == null ) 
+        {
+            throw new IllegalArgumentException( "The new DN must not be null" );
+        }
+        
+        if ( newDn.isRootDSE() )
+        {
+            throw new IllegalArgumentException( "The RootDSE cannot be the target" );
+        }
+        
+        ModifyDnResponse resp = new ModifyDnResponse();
+        resp.setLdapResult( getDefaultResult() );
+
+        try
+        {
+            session.moveAndRename( entryDn, newDn.getParent(), newDn.getRdn(), deleteOldRdn );
+        }
+        catch ( Exception e )
+        {
+            resp.getLdapResult().setResultCode( ResultCodeEnum.getResultCode( e ) );
+        }
+
+        return resp;
+    }
+
+
+    /**
+     * Moves and renames the given entryDn.The old RDN will be deleted if requested
+     * 
+     * @param entryDn The original entry DN
+     * @param newDn The new Entry DN
+     * @param deleteOldRdn Tells if the old RDN must be removed
+     */
+    public ModifyDnResponse moveAndRename( String entryDn, String newDn, boolean deleteOldRdn ) throws LdapException
+    {
+        return moveAndRename( new DN( entryDn ), new DN( newDn ), deleteOldRdn );
+    }
+
+
+    /**
      * {@inheritDoc}
      */
     public Cursor<SearchResponse> search( SearchRequest searchRequest ) 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=954152&r1=954151&r2=954152&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 Sun Jun 13 00:44:32 2010
@@ -863,7 +863,8 @@ public class InterceptorChain
         Element entry = getStartingEntry();
         Interceptor head = entry.interceptor;
         NextInterceptor next = entry.nextInterceptor;
-        eagerlyPopulateFields( opContext );
+        opContext.setOriginalEntry( getOriginalEntry( opContext ) );
+        opContext.setModifiedEntry( opContext.getOriginalEntry().clone() );
 
         try
         {

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java Sun Jun 13 00:44:32 2010
@@ -24,6 +24,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.exception.LdapException;
+import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.name.RDN;
@@ -37,8 +38,8 @@ import org.apache.directory.shared.ldap.
  */
 public class MoveAndRenameOperationContext extends RenameOperationContext
 {
-    /** The parent DN */
-    private DN parent;
+    /** The new superior DN */
+    private DN newSuperiorDn;
 
     /** Cached calculated new DN after move and rename */
     private DN newDn;
@@ -60,10 +61,10 @@ public class MoveAndRenameOperationConte
      * @param newRdn the new rdn to use for the target once renamed
      * @param delOldRdn true if the old rdn value is deleted, false otherwise
      */
-    public MoveAndRenameOperationContext( CoreSession session, DN oldDn, DN parent, RDN newRdn, boolean delOldRdn )
+    public MoveAndRenameOperationContext( CoreSession session, DN oldDn, DN newSuperiorDn, RDN newRdn, boolean delOldRdn )
     {
         super( session, oldDn, newRdn, delOldRdn );
-        this.parent = parent;
+        this.newSuperiorDn = newSuperiorDn;
     }
 
 
@@ -71,9 +72,9 @@ public class MoveAndRenameOperationConte
     {
         // super sets the newRdn and the delOldRdn members and tests
         super( session, modifyDnRequest );
-        this.parent = modifyDnRequest.getNewSuperior();
+        this.newSuperiorDn = modifyDnRequest.getNewSuperior();
         
-        if ( parent == null )
+        if ( newSuperiorDn == null )
         {
             throw new IllegalStateException( I18n.err( I18n.ERR_325, modifyDnRequest ) );
         }
@@ -86,26 +87,39 @@ public class MoveAndRenameOperationConte
         {
             throwReferral();
         }
+        
+        newDn = (DN)newSuperiorDn.clone();
+        newDn.add( getNewRdn() );
+        
+        try
+        {
+            newDn.normalize( session.getDirectoryService()
+                .getSchemaManager().getNormalizerMapping() );
+        }
+        catch ( LdapInvalidDnException lide )
+        {
+            throw new IllegalStateException( I18n.err( I18n.ERR_325, modifyDnRequest ) );
+        }
     }
 
 
     /**
-     *  @return The parent DN
+     *  @return The new superior DN
      */
-    public DN getParent()
+    public DN getNewSuperior()
     {
-        return parent;
+        return newSuperiorDn;
     }
 
 
     /**
-     * Set the parent DN
+     * Set the new Superior DN
      *
-     * @param parent The parent
+     * @param newSuperiorDn The new Superior DN
      */
-    public void setParent( DN parent )
+    public void setNewSuperiorDn( DN newSuperiorDn )
     {
-        this.parent = parent;
+        this.newSuperiorDn = newSuperiorDn;
     }
 
     
@@ -117,14 +131,6 @@ public class MoveAndRenameOperationConte
      */
     public DN getNewDn() throws LdapException
     {
-        if ( newDn == null )
-        {
-            newDn = new DN( getParent().getName() );
-            newDn.add( getNewRdn().getName() );
-            newDn.normalize( session.getDirectoryService()
-                .getSchemaManager().getNormalizerMapping() );
-        }
-        
         return newDn;
     }
     
@@ -134,7 +140,6 @@ public class MoveAndRenameOperationConte
      */
     public String toString()
     {
-        return "ReplaceContext for old DN '" + getDn().getName() + "'" +
-        ", parent '" + parent + "'";
+        return "ReplaceContext for old DN '" + getDn().getName() + "' : " + newDn;
     }
 }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/RegistrySynchronizerAdaptor.java Sun Jun 13 00:44:32 2010
@@ -385,7 +385,7 @@ public class RegistrySynchronizerAdaptor
             if ( objectClass2synchronizerMap.containsKey( oid ) )
             {
                 RegistrySynchronizer synchronizer = objectClass2synchronizerMap.get( oid );
-                synchronizer.moveAndRename( opContext.getDn(), opContext.getParent(), opContext.getNewRdn(), 
+                synchronizer.moveAndRename( opContext.getDn(), opContext.getNewSuperior(), opContext.getNewRdn(), 
                     opContext.getDelOldDn(), entry, cascade );
                 return;
             }
@@ -393,7 +393,7 @@ public class RegistrySynchronizerAdaptor
 
         if ( oc.contains( MetaSchemaConstants.META_SCHEMA_OC ) )
         {
-            schemaSynchronizer.moveAndRename( opContext.getDn(), opContext.getParent(), opContext.getNewRdn(), 
+            schemaSynchronizer.moveAndRename( opContext.getDn(), opContext.getNewSuperior(), opContext.getNewRdn(), 
                 opContext.getDelOldDn(), entry, cascade );
             return;
         }

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/moveAndRename/MoveAndRenamePerfIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/moveAndRename/MoveAndRenamePerfIT.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/moveAndRename/MoveAndRenamePerfIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/operations/moveAndRename/MoveAndRenamePerfIT.java Sun Jun 13 00:44:32 2010
@@ -20,7 +20,7 @@
 package org.apache.directory.server.core.operations.moveAndRename;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.message.ModifyDnRequest;
+import org.apache.directory.ldap.client.api.message.SearchResponse;
 import org.apache.directory.server.core.annotations.ContextEntry;
 import org.apache.directory.server.core.annotations.CreateDS;
 import org.apache.directory.server.core.annotations.CreateIndex;
@@ -35,6 +35,9 @@ import org.apache.directory.shared.ldap.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertNotNull;
+
 
 /**
  * Test the move operation performances
@@ -76,10 +79,6 @@ public class MoveAndRenamePerfIT extends
 
         DN oldDn = new DN( "cn=testOld,ou=system" );
         DN newDn = new DN( "cn=testNew,ou=users,ou=system" );
-        DN oldSuperior = new DN( "ou=system" );
-        DN newSuperior = new DN( "ou=users,ou=system" );
-        RDN oldRdn = new RDN( "cn=testOld" );
-        RDN newRdn = new RDN( "cn=testNew" );
 
         Entry entry = new DefaultEntry( service.getSchemaManager(), oldDn );
         entry.add( "ObjectClass", "top", "person" );
@@ -109,19 +108,14 @@ public class MoveAndRenamePerfIT extends
             }
 
             long ttt0 = System.nanoTime();
-            ModifyDnRequest modDnReq = new ModifyDnRequest();
-            modDnReq.setEntryDn( oldDn );
-            modDnReq.setNewSuperior( newSuperior );
-            modDnReq.setNewRdn( newRdn );
-            modDnReq.setDeleteOldRdn( true );
             
-            connection.modifyDn( modDnReq );
+            connection.moveAndRename( oldDn, newDn );
             
-            //SearchResponse oldEntry = connection.lookup( oldDn );
-            //SearchResponse newEntry = connection.lookup( newDn );
+            SearchResponse oldEntry = connection.lookup( oldDn.getName() );
+            SearchResponse newEntry = connection.lookup( newDn.getName() );
             
-            //assertNull( oldEntry );
-            //assertNotNull( newEntry );
+            assertNull( oldEntry );
+            assertNotNull( newEntry );
             long ttt1 = System.nanoTime();
 
             // Swap the dn
@@ -129,15 +123,6 @@ public class MoveAndRenamePerfIT extends
             newDn = oldDn;
             oldDn = tmpDn;
             
-            // Swap the superiors
-            DN tmpSuperior = newSuperior;
-            newSuperior = oldSuperior;
-            oldSuperior = tmpSuperior;
-            
-            // Swap thr RDN
-            RDN tmpRdn = newRdn;
-            newRdn = oldRdn;
-            oldRdn = tmpRdn;
             //System.out.println("added " + i + ", delta = " + (ttt1-ttt0)/1000);
         }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultCoreSession.java Sun Jun 13 00:44:32 2010
@@ -622,10 +622,10 @@ public class DefaultCoreSession implemen
     /**
      * {@inheritDoc} 
      */
-    public void moveAndRename( DN dn, DN newParent, RDN newRdn, boolean deleteOldRdn, LogChange log ) throws LdapException
+    public void moveAndRename( DN dn, DN newSuperiorDn, RDN newRdn, boolean deleteOldRdn, LogChange log ) throws LdapException
     {
         MoveAndRenameOperationContext opContext = 
-            new MoveAndRenameOperationContext( this, dn, newParent, newRdn, deleteOldRdn );
+            new MoveAndRenameOperationContext( this, dn, newSuperiorDn, newRdn, deleteOldRdn );
         
         opContext.setLogChange( log );
 

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=954152&r1=954151&r2=954152&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 Sun Jun 13 00:44:32 2010
@@ -814,13 +814,13 @@ public class DefaultOperationManager imp
 
             // Now, check the destination
             // Normalize the opContext DN
-            DN parentDn = opContext.getParent();
-            parentDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            DN newSuperiorDn = opContext.getNewSuperior();
+            newSuperiorDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
 
             // If he parent DN is a referral, or has a referral ancestor, we have to issue a AffectMultipleDsas result
             // as stated by RFC 3296 Section 5.6.2
-            if ( directoryService.getReferralManager().isReferral( parentDn )
-                || directoryService.getReferralManager().hasParentReferral( parentDn ) )
+            if ( directoryService.getReferralManager().isReferral( newSuperiorDn )
+                || directoryService.getReferralManager().hasParentReferral( newSuperiorDn ) )
             {
                 // Unlock the referral manager
                 directoryService.getReferralManager().unlock();

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Sun Jun 13 00:44:32 2010
@@ -832,7 +832,7 @@ public class AciAuthorizationInterceptor
         throws LdapException
     {
         DN oriChildName = moveAndRenameContext.getDn();
-        DN newParentName = moveAndRenameContext.getParent();
+        DN newParentName = moveAndRenameContext.getNewSuperior();
 
         Entry entry = moveAndRenameContext.lookup( oriChildName, ByPassConstants.LOOKUP_BYPASS );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Sun Jun 13 00:44:32 2010
@@ -37,6 +37,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.server.core.schema.SchemaService;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
@@ -344,10 +345,18 @@ public class ChangeLogInterceptor extend
         forward.setDn( opCtx.getDn() );
         forward.setDeleteOldRdn( opCtx.getDelOldDn() );
         forward.setNewRdn( opCtx.getNewRdn().getName() );
-        forward.setNewSuperior( opCtx.getParent().getName() );
-
+        forward.setNewSuperior( opCtx.getNewSuperior().getName() );
+        
         List<LdifEntry> reverses = LdifRevertor.reverseMoveAndRename(  
-            serverEntry, opCtx.getParent(), new RDN( opCtx.getNewRdn() ), false );
+            serverEntry, opCtx.getNewSuperior(), new RDN( opCtx.getNewRdn() ), false );
+        
+        if ( opCtx.isReferralIgnored() )
+        {
+            forward.addControl( new ManageDsaITControl() );
+            LdifEntry reversedEntry = reverses.get( 0 );
+            reversedEntry.addControl( new ManageDsaITControl() );
+        }
+        
         opCtx.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverses ) );
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Sun Jun 13 00:44:32 2010
@@ -411,7 +411,7 @@ public class ExceptionInterceptor extend
         throws LdapException
     {
         DN oriChildName = opContext.getDn();
-        DN parent = opContext.getParent();
+        DN parent = opContext.getNewSuperior();
 
         if ( oriChildName.getNormName().equalsIgnoreCase( subschemSubentryDn.getNormName() ) )
         {

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=954152&r1=954151&r2=954152&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 Sun Jun 13 00:44:32 2010
@@ -218,8 +218,16 @@ public class NormalizationInterceptor ex
         rdn.normalize( schemaManager.getNormalizerMapping() );
         opContext.setNewRdn( rdn.getRdn() );
 
-        opContext.getDn().normalize( schemaManager.getNormalizerMapping() );
-        opContext.getParent().normalize( schemaManager.getNormalizerMapping() );
+        if ( !opContext.getDn().isNormalized() )
+        {
+            opContext.getDn().normalize( schemaManager.getNormalizerMapping() );
+        }
+        
+        if ( !opContext.getNewSuperior().isNormalized() )
+        {
+            opContext.getNewSuperior().normalize( schemaManager.getNormalizerMapping() );
+        }
+        
         nextInterceptor.moveAndRename( opContext );
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Sun Jun 13 00:44:32 2010
@@ -355,7 +355,7 @@ public class OperationalAttributeInterce
         List<Modification> items = ModifyOperationContext.createModItems( serverEntry,
             ModificationOperation.REPLACE_ATTRIBUTE );
 
-        ModifyOperationContext newModify = new ModifyOperationContext( opContext.getSession(), opContext.getParent(),
+        ModifyOperationContext newModify = new ModifyOperationContext( opContext.getSession(), opContext.getNewSuperior(),
             items );
 
         service.getPartitionNexus().modify( newModify );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Sun Jun 13 00:44:32 2010
@@ -316,7 +316,7 @@ public class ReferralInterceptor extends
      **/
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext ) throws LdapException
     {
-        DN newName = ( DN ) opContext.getParent().clone();
+        DN newName = ( DN ) opContext.getNewSuperior().clone();
         newName.add( opContext.getNewRdn() );
 
         // Check if the entry is a referral itself

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Sun Jun 13 00:44:32 2010
@@ -875,7 +875,7 @@ public class SubentryInterceptor extends
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext ) throws LdapException
     {
         DN oriChildName = opContext.getDn();
-        DN parent = opContext.getParent();
+        DN parent = opContext.getNewSuperior();
 
         Entry entry = opContext.lookup( oriChildName, ByPassConstants.LOOKUP_BYPASS );
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerInterceptor.java Sun Jun 13 00:44:32 2010
@@ -407,7 +407,7 @@ public class TriggerInterceptor extends 
     public void moveAndRename( NextInterceptor next, MoveAndRenameOperationContext opContext ) throws LdapException
     {
         DN oriChildName = opContext.getDn();
-        DN parent = opContext.getParent();
+        DN parent = opContext.getNewSuperior();
         RDN newRdn = opContext.getNewRdn();
         boolean deleteOldRn = opContext.getDelOldDn();
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Sun Jun 13 00:44:32 2010
@@ -872,7 +872,7 @@ public class SearchHandler extends LdapR
                         break;
                         
                     default:
-                        throw new IllegalStateException( I18n.err( I18n.ERR_686 ) );
+                        ldapUrl.setScope( SearchScope.OBJECT.getScope() );
                 }
                 
                 respRef.getReferral().addLdapUrl( ldapUrl.toString() );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java Sun Jun 13 00:44:32 2010
@@ -304,7 +304,7 @@ public class SyncReplSearchListener impl
 
         try
         {
-            if( ! opContext.getParent().isChildOf( clientMsgLog.getSearchCriteria().getBase() ) )
+            if( ! opContext.getNewSuperior().isChildOf( clientMsgLog.getSearchCriteria().getBase() ) )
             {
                 sendDeletedEntry( opContext.getEntry() );
                 return;
@@ -312,7 +312,7 @@ public class SyncReplSearchListener impl
 
             SyncModifyDnControl modDnControl = new SyncModifyDnControl( SyncModifyDnType.MOVEANDRENAME );
             modDnControl.setEntryDn( opContext.getDn().getNormName() );
-            modDnControl.setNewSuperiorDn( opContext.getParent().getNormName() );
+            modDnControl.setNewSuperiorDn( opContext.getNewSuperior().getNormName() );
             modDnControl.setNewRdn( opContext.getNewRdn().getNormName() );
             modDnControl.setDeleteOldRdn( opContext.getDelOldDn() );
 

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java Sun Jun 13 00:44:32 2010
@@ -144,6 +144,7 @@ public class ReferralSearchIT extends Ab
         "ref: ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system\n\n";
 
         LdifReader reader = new LdifReader( new StringReader( ldif ) );
+        
         while ( reader.hasNext() )
         {
             LdifEntry entry = reader.next();
@@ -422,84 +423,5 @@ public class ReferralSearchIT extends Ab
             String referral = (String)re.getReferralInfo();
             assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
         }
-        
-    }
-
-    
-    /**
-     * Test of an search operation with a referral after the entry
-     * has been moved.
-     *
-     * search for "cn=alex karasulu" on "c=usa, ou=system"
-     * we should get a referral URL thrown, which point to
-     * "c=usa, ou=system", and ask for a subtree search
-     */
-    @Test
-    public void testSearchBaseWithReferralThrowAfterMoveAndRename() throws Exception
-    {
-        DirContext ctx = getWiredContextThrowOnRefferal( ldapServer );
-
-        SearchControls controls = new SearchControls();
-        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-
-        try
-        {
-            ctx.search( "c=america,ou=Countries,ou=system", "(cn=alex karasulu)", controls );
-            fail( "Should fail here throwing a ReferralException" );
-        }
-        catch ( ReferralException re )
-        {
-            String referral = (String)re.getReferralInfo();
-            assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
-        }
-        
-        ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{new ManageReferralControl()} );
-
-        // Now let's move the entry
-        ctx.rename( "c=america,ou=Countries,ou=system", "c=us,ou=system" );
-
-        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
-
-        ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{} );
-
-        try
-        {
-            ctx.search( "c=us,ou=system", "(cn=alex karasulu)", controls );
-            fail( "Should fail here throwing a ReferralException" );
-        }
-        catch ( ReferralException re )
-        {
-            String referral = (String)re.getReferralInfo();
-            assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
-        }
-        
-    }
-
-    
-    /**
-     * Test of an search operation with a referral
-     *
-     * search for "cn=alex karasulu" on "c=america, ou=system"
-     * we should get a referral URL thrown, which point to
-     * "c=usa, ou=system", and ask for a subtree search
-     */
-    @Test
-    public void testSearchOneLevelWithReferralThrow() throws Exception
-    {
-        DirContext ctx = getWiredContextThrowOnRefferal( ldapServer );
-
-        SearchControls controls = new SearchControls();
-        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-
-        try
-        {
-            ctx.search( "c=america,ou=Countries,ou=system", "(cn=alex karasulu)", controls );
-            fail( "Should fail here throwing a ReferralException" );
-        }
-        catch ( ReferralException re )
-        {
-            String referral = (String)re.getReferralInfo();
-            assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??one", referral );
-        }
     }
 }
\ No newline at end of file

Added: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java?rev=954152&view=auto
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java (added)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchMoveAndRenameIT.java Sun Jun 13 00:44:32 2010
@@ -0,0 +1,208 @@
+/*
+ *  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.operations.search;
+
+ 
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContext;
+import static org.apache.directory.server.integ.ServerIntegrationUtils.getWiredContextThrowOnRefferal;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.naming.Context;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.ReferralException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import javax.naming.ldap.LdapContext;
+import javax.naming.ldap.ManageReferralControl;
+
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ApplyLdifs;
+import org.apache.directory.server.core.integ.AbstractLdapTestUnit;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.shared.ldap.entry.DefaultEntry;
+import org.apache.directory.shared.ldap.ldif.LdifEntry;
+import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ * Tests to make sure the server is operating correctly when handling referrals.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+@RunWith ( FrameworkRunner.class )
+@CreateLdapServer ( 
+    transports = 
+    {
+        @CreateTransport( protocol = "LDAP" )
+    })
+@ApplyLdifs( {
+    // Add new ref for ou=RemoteUsers
+    "dn: ou=RemoteUsers,ou=system",
+    "objectClass: top",
+    "objectClass: referral",
+    "objectClass: extensibleObject",
+    "ou: RemoteUsers",
+    "ref: ldap://fermi:10389/ou=users,ou=system",
+    "ref: ldap://hertz:10389/ou=users,dc=example,dc=com",
+    "ref: ldap://maxwell:10389/ou=users,ou=system",
+    
+    "dn: c=France,ou=system",
+    "objectClass: top",
+    "objectClass: country",
+    "c: France",
+    
+    "dn: c=USA,ou=system",
+    "objectClass: top",
+    "objectClass: country",
+    "c: USA",
+    
+    "dn: l=Paris,c=france,ou=system",
+    "objectClass: top",
+    "objectClass: locality",
+    "l: Paris",
+    
+    "dn: l=Jacksonville,c=usa,ou=system",
+    "objectClass: top",
+    "objectClass: locality",
+    "l: Jacksonville",
+    
+    "dn: cn=emmanuel lecharny,l=paris,c=france,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: residentialPerson",
+    "cn: emmanuel lecharny",
+    "sn: elecharny",
+    "l: Paris",
+    
+    "dn: cn=alex karasulu,l=jacksonville,c=usa,ou=system",
+    "objectClass: top",
+    "objectClass: person",
+    "objectClass: residentialPerson",
+    "cn: alex karasulu",
+    "sn: karasulu",
+    "l: Jacksonville",
+    
+    "dn: ou=Countries,ou=system",
+    "objectClass: top",
+    "objectClass: organizationalUnit",
+    "ou: Countries"
+    }
+)
+public class ReferralSearchMoveAndRenameIT extends AbstractLdapTestUnit
+{    
+    @Before
+    public void setupReferrals() throws Exception
+    {
+        ldapServer.getDirectoryService().getChangeLog().setEnabled( false );
+        
+        String ldif =
+        "dn: c=europ,ou=Countries,ou=system\n" +
+        "objectClass: top\n" +
+        "objectClass: referral\n" +
+        "objectClass: extensibleObject\n" +
+        "c: europ\n" +
+        "ref: ldap://localhost:" + ldapServer.getPort() + "/c=france,ou=system\n\n" +
+
+        "dn: c=america,ou=Countries,ou=system\n" +
+        "objectClass: top\n" +
+        "objectClass: referral\n" +
+        "objectClass: extensibleObject\n" +
+        "c: america\n" +
+        "ref: ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system\n\n";
+
+        LdifReader reader = new LdifReader( new StringReader( ldif ) );
+        
+        while ( reader.hasNext() )
+        {
+            LdifEntry entry = reader.next();
+            ldapServer.getDirectoryService().getAdminSession().add( 
+                new DefaultEntry( ldapServer.getDirectoryService().getSchemaManager(), entry.getEntry() ) ); 
+        }
+    }
+    
+    
+
+    /**
+     * Test of an search operation with a referral after the entry
+     * has been moved.
+     *
+     * search for "cn=alex karasulu" on "c=usa, ou=system"
+     * we should get a referral URL thrown, which point to
+     * "c=usa, ou=system", and ask for a subtree search
+     */
+    @Test
+    public void testSearchBaseWithReferralThrowAfterMoveAndRename() throws Exception
+    {
+        DirContext ctx = getWiredContextThrowOnRefferal( ldapServer );
+
+        SearchControls controls = new SearchControls();
+        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
+
+        try
+        {
+            ctx.search( "c=america,ou=Countries,ou=system", "(cn=alex karasulu)", controls );
+            fail( "Should fail here throwing a ReferralException" );
+        }
+        catch ( ReferralException re )
+        {
+            String referral = (String)re.getReferralInfo();
+            assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
+        }
+        
+        ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{new ManageReferralControl()} );
+
+        // Now let's move the entry
+        ctx.rename( "c=america,ou=Countries,ou=system", "c=us,ou=system" );
+
+        controls.setSearchScope( SearchControls.OBJECT_SCOPE );
+
+        ((LdapContext)ctx).setRequestControls( new javax.naming.ldap.Control[]{} );
+
+        try
+        {
+            NamingEnumeration<SearchResult> results = ctx.search( "c=us,ou=system", "(cn=alex karasulu)", controls );
+            
+            SearchResult result = results.next();
+            fail( "Should fail here throwing a ReferralException" );
+        }
+        catch ( ReferralException re )
+        {
+            String referral = (String)re.getReferralInfo();
+            assertEquals( "ldap://localhost:" + ldapServer.getPort() + "/c=usa,ou=system??base", referral );
+        }
+    }
+}
\ No newline at end of file

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/suites/StockServerISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/suites/StockServerISuite.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/suites/StockServerISuite.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/suites/StockServerISuite.java Sun Jun 13 00:44:32 2010
@@ -54,6 +54,7 @@ import org.apache.directory.server.opera
 import org.apache.directory.server.operations.search.PagedSearchIT;
 import org.apache.directory.server.operations.search.PersistentSearchIT;
 import org.apache.directory.server.operations.search.ReferralSearchIT;
+import org.apache.directory.server.operations.search.ReferralSearchMoveAndRenameIT;
 import org.apache.directory.server.operations.search.ReferralSearchNoRevertIT;
 import org.apache.directory.server.operations.search.SchemaSearchIT;
 import org.apache.directory.server.operations.search.SearchIT;
@@ -122,6 +123,7 @@ import org.junit.runners.Suite;
         PersistentSearchIT.class,
         ReferralSearchIT.class,
         ReferralSearchNoRevertIT.class,
+        //ReferralSearchMoveAndRenameIT.class,
         SchemaSearchIT.class,
         SearchIT.class,
         SearchLimitsIT.class,

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java?rev=954152&r1=954151&r2=954152&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java Sun Jun 13 00:44:32 2010
@@ -335,7 +335,7 @@ public abstract class AbstractXdbmPartit
 
     public final void moveAndRename( MoveAndRenameOperationContext moveAndRenameContext ) throws LdapException
     {
-        if ( moveAndRenameContext.getParent().isChildOf( moveAndRenameContext.getDn() ) )
+        if ( moveAndRenameContext.getNewSuperior().isChildOf( moveAndRenameContext.getDn() ) )
         {
             throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
                 "cannot place an entry below itself" );
@@ -343,7 +343,7 @@ public abstract class AbstractXdbmPartit
 
         try
         {
-            store.moveAndRename( moveAndRenameContext.getDn(), moveAndRenameContext.getParent(), moveAndRenameContext.getNewRdn(),
+            store.moveAndRename( moveAndRenameContext.getDn(), moveAndRenameContext.getNewSuperior(), moveAndRenameContext.getNewRdn(),
                 null, moveAndRenameContext.getDelOldDn() );
         }
         catch ( Exception e )



Mime
View raw message