You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/06/07 23:45:51 UTC
svn commit: r952452 - in /directory/apacheds/trunk:
jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/
xdbm-partition/src/main/java...
Author: elecharny
Date: Mon Jun 7 21:45:51 2010
New Revision: 952452
URL: http://svn.apache.org/viewvc?rev=952452&view=rev
Log:
Added a rename() method which take no entry parameter
Modified:
directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/xdbm/AbstractXdbmPartition.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=952452&r1=952451&r2=952452&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Mon Jun 7 21:45:51 2010
@@ -698,7 +698,7 @@ public class JdbmStoreTest
RDN rdn = new RDN( "sn=James" );
- store.rename( dn, rdn, true, null );
+ store.rename( dn, rdn, true );
}
@@ -718,7 +718,7 @@ public class JdbmStoreTest
RDN rdn = new RDN( "sn=Ja\\+es" );
- store.rename( dn, rdn, true, null );
+ store.rename( dn, rdn, true );
DN dn2 = new DN( "sn=Ja\\+es,ou=Engineering,o=Good Times Co." );
dn2.normalize( schemaManager.getNormalizerMapping() );
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=952452&r1=952451&r2=952452&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 Mon Jun 7 21:45:51 2010
@@ -324,7 +324,7 @@ public abstract class AbstractXdbmPartit
}
else
{
- store.rename( renameContext.getDn(), renameContext.getNewRdn(), renameContext.getDelOldDn(), null );
+ store.rename( renameContext.getDn(), renameContext.getNewRdn(), renameContext.getDelOldDn() );
}
}
catch ( Exception e )
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=952452&r1=952451&r2=952452&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Mon Jun 7 21:45:51 2010
@@ -1053,20 +1053,7 @@ public abstract class AbstractStore<E, I
/**
- * Changes the relative distinguished name of an entry specified by a
- * distinguished name with the optional removal of the old RDN attribute
- * value from the entry. Name changes propagate down as dn changes to the
- * descendants of the entry where the RDN changed.
- *
- * An RDN change operation does not change parent child relationships. It
- * merely propagates a name change at a point in the DIT where the RDN is
- * changed. The change propagates down the subtree rooted at the
- * distinguished name specified.
- *
- * @param dn the normalized distinguished name of the entry to alter
- * @param newRdn the new RDN to set
- * @param deleteOldRdn whether or not to remove the old RDN attr/val
- * @throws Exception if there are any errors propagating the name changes
+ * {@inheritDoc}
*/
@SuppressWarnings("unchecked")
public synchronized void rename( DN dn, RDN newRdn, boolean deleteOldRdn, Entry entry ) throws Exception
@@ -1179,6 +1166,7 @@ public abstract class AbstractStore<E, I
}
}
+
/*
* H A N D L E D N C H A N G E
* ====================================================================
@@ -1200,10 +1188,19 @@ public abstract class AbstractStore<E, I
}
+ /**
+ * {@inheritDoc}
+ */
+ public synchronized void rename( DN dn, RDN newRdn, boolean deleteOldRdn ) throws Exception
+ {
+ rename( dn, newRdn, deleteOldRdn, null );
+ }
+
+
public synchronized void move( DN oldChildDn, DN newParentDn, RDN newRdn, boolean deleteOldRdn ) throws Exception
{
ID childId = getEntryId( oldChildDn );
- rename( oldChildDn, newRdn, deleteOldRdn, null );
+ rename( oldChildDn, newRdn, deleteOldRdn );
move( oldChildDn, childId, newParentDn, newRdn );
if ( isSyncOnWrite )
Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=952452&r1=952451&r2=952452&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java Mon Jun 7 21:45:51 2010
@@ -511,6 +511,25 @@ public interface Store<E, ID extends Com
void rename( DN dn, RDN newRdn, boolean deleteOldRdn, Entry entry ) throws Exception;
+ /**
+ * Changes the relative distinguished name of an entry specified by a
+ * distinguished name with the optional removal of the old RDN attribute
+ * value from the entry. Name changes propagate down as dn changes to the
+ * descendants of the entry where the RDN changed.
+ *
+ * An RDN change operation does not change parent child relationships. It
+ * merely propagates a name change at a point in the DIT where the RDN is
+ * changed. The change propagates down the subtree rooted at the
+ * distinguished name specified.
+ *
+ * @param dn the normalized distinguished name of the entry to alter
+ * @param newRdn the new RDN to set
+ * @param deleteOldRdn whether or not to remove the old RDN attr/val
+ * @throws Exception if there are any errors propagating the name changes
+ */
+ void rename( DN dn, RDN newRdn, boolean deleteOldRdn ) throws Exception;
+
+
void move( DN oldChildDn, DN newParentDn, RDN newRdn, boolean deleteOldRdn ) throws Exception;
Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java?rev=952452&r1=952451&r2=952452&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlStoreTest.java Mon Jun 7 21:45:51 2010
@@ -618,7 +618,7 @@ public class AvlStoreTest
RDN rdn = new RDN( "sn=James" );
- store.rename( dn, rdn, true, null );
+ store.rename( dn, rdn, true );
}
@@ -638,7 +638,7 @@ public class AvlStoreTest
RDN rdn = new RDN( "sn=Ja\\+es" );
- store.rename( dn, rdn, true, null );
+ store.rename( dn, rdn, true );
DN dn2 = new DN( "sn=Ja\\+es,ou=Engineering,o=Good Times Co." );
dn2.normalize( schemaManager.getNormalizerMapping() );