directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1378598 - in /directory/apacheds/branches/apacheds-mvbt: ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/ xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/ xdbm-partition/src/m...
Date Wed, 29 Aug 2012 15:02:48 GMT
Author: elecharny
Date: Wed Aug 29 15:02:48 2012
New Revision: 1378598

URL: http://svn.apache.org/viewvc?rev=1378598&view=rev
Log:
Removed the generic parameter from the ParentIdAndRdn, it's mplicitly an UUID

Modified:
    directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdn.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdnComparator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/OneLevelScopeEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/SubtreeScopeEvaluator.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ParentIdAndRdnTest.java
    directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java

Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Wed Aug 29 15:02:48 2012
@@ -386,13 +386,13 @@ public class LdifPartition extends Abstr
 
         UUID baseId = getEntryId( modifiedEntry.getDn() );
 
-        ParentIdAndRdn<UUID> parentIdAndRdn = getRdnIndex().reverseLookup( baseId );
+        ParentIdAndRdn parentIdAndRdn = getRdnIndex().reverseLookup( baseId );
         IndexEntry indexEntry = new ForwardIndexEntry();
 
         indexEntry.setId( baseId );
         indexEntry.setKey( parentIdAndRdn );
 
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = new SingletonIndexCursor<ParentIdAndRdn<UUID>>(
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = new SingletonIndexCursor<ParentIdAndRdn>(
             indexEntry );
         UUID parentId = parentIdAndRdn.getParentId();
 

Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java Wed Aug 29 15:02:48 2012
@@ -299,7 +299,7 @@ public class SingleFileLdifPartition ext
                     return;
                 }
 
-                ParentIdAndRdn<UUID> suffixEntry = rdnIdx.reverseLookup( suffixId );
+                ParentIdAndRdn suffixEntry = rdnIdx.reverseLookup( suffixId );
 
                 if ( suffixEntry != null )
                 {
@@ -328,16 +328,16 @@ public class SingleFileLdifPartition ext
     private void appendRecursive( UUID id, int nbSibbling ) throws Exception
     {
         // Start with the root
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = rdnIdx.forwardCursor();
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = rdnIdx.forwardCursor();
 
-        IndexEntry<ParentIdAndRdn<UUID>, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<UUID>, UUID>();
-        startingPos.setKey( new ParentIdAndRdn<UUID>( id, ( Rdn[] ) null ) );
+        IndexEntry<ParentIdAndRdn, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn, UUID>();
+        startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
         cursor.before( startingPos );
         int countChildren = 0;
 
         while ( cursor.next() && ( countChildren < nbSibbling ) )
         {
-            IndexEntry<ParentIdAndRdn<UUID>, UUID> element = cursor.get();
+            IndexEntry<ParentIdAndRdn, UUID> element = cursor.get();
             UUID childId = element.getId();
             Entry entry = lookup( childId );
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Wed Aug 29 15:02:48 2012
@@ -140,7 +140,7 @@ public abstract class AbstractBTreeParti
     protected Map<String, Index<?, Entry, UUID>> systemIndices = new HashMap<String, Index<?, Entry, UUID>>();
 
     /** the relative distinguished name index */
-    protected Index<ParentIdAndRdn<UUID>, Entry, UUID> rdnIdx;
+    protected Index<ParentIdAndRdn, Entry, UUID> rdnIdx;
 
     /** a system index on objectClass attribute*/
     protected Index<String, Entry, UUID> objectClassIdx;
@@ -292,7 +292,7 @@ public abstract class AbstractBTreeParti
 
         if ( getRdnIndex() == null )
         {
-            Index<ParentIdAndRdn<UUID>, Entry, UUID> index = createSystemIndex(
+            Index<ParentIdAndRdn, Entry, UUID> index = createSystemIndex(
                 ApacheSchemaConstants.APACHE_RDN_AT_OID,
                 partitionPath, WITH_REVERSE );
             addIndex( index );
@@ -349,7 +349,7 @@ public abstract class AbstractBTreeParti
         }
 
         // set index shortcuts
-        rdnIdx = ( Index<ParentIdAndRdn<UUID>, Entry, UUID> ) systemIndices
+        rdnIdx = ( Index<ParentIdAndRdn, Entry, UUID> ) systemIndices
             .get( ApacheSchemaConstants.APACHE_RDN_AT_OID );
         presenceIdx = ( Index<String, Entry, UUID> ) systemIndices.get( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID );
         aliasIdx = ( Index<String, Entry, UUID> ) systemIndices.get( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
@@ -537,15 +537,15 @@ public abstract class AbstractBTreeParti
     public void dumpRdnIdx( UUID id, String tabs ) throws Exception
     {
         // Start with the root
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = rdnIdx.forwardCursor();
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = rdnIdx.forwardCursor();
 
-        IndexEntry<ParentIdAndRdn<UUID>, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<UUID>, UUID>();
+        IndexEntry<ParentIdAndRdn, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn, UUID>();
         startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
         cursor.before( startingPos );
 
         while ( cursor.next() )
         {
-            IndexEntry<ParentIdAndRdn<UUID>, UUID> entry = cursor.get();
+            IndexEntry<ParentIdAndRdn, UUID> entry = cursor.get();
             System.out.println( tabs + entry );
         }
 
@@ -556,16 +556,16 @@ public abstract class AbstractBTreeParti
     private void dumpRdnIdx( UUID id, int nbSibbling, String tabs ) throws Exception
     {
         // Start with the root
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = rdnIdx.forwardCursor();
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = rdnIdx.forwardCursor();
 
-        IndexEntry<ParentIdAndRdn<UUID>, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<UUID>, UUID>();
+        IndexEntry<ParentIdAndRdn, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn, UUID>();
         startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
         cursor.before( startingPos );
         int countChildren = 0;
 
         while ( cursor.next() && ( countChildren < nbSibbling ) )
         {
-            IndexEntry<ParentIdAndRdn<UUID>, UUID> entry = cursor.get();
+            IndexEntry<ParentIdAndRdn, UUID> entry = cursor.get();
             System.out.println( tabs + entry );
             countChildren++;
 
@@ -611,19 +611,19 @@ public abstract class AbstractBTreeParti
             // entry sequences start at 1.
             //
             Dn parentDn = null;
-            ParentIdAndRdn<UUID> key = null;
+            ParentIdAndRdn key = null;
 
             if ( entryDn.equals( suffixDn ) )
             {
                 parentId = Partition.ROOT_ID;
-                key = new ParentIdAndRdn<UUID>( parentId, suffixDn.getRdns() );
+                key = new ParentIdAndRdn( parentId, suffixDn.getRdns() );
             }
             else
             {
                 parentDn = entryDn.getParent();
                 parentId = getEntryId( parentDn );
 
-                key = new ParentIdAndRdn<UUID>( parentId, entryDn.getRdn() );
+                key = new ParentIdAndRdn( parentId, entryDn.getRdn() );
             }
 
             // don't keep going if we cannot find the parent Id
@@ -792,7 +792,7 @@ public abstract class AbstractBTreeParti
             return;
         }
 
-        ParentIdAndRdn<UUID> parent = rdnIdx.reverseLookup( parentId );
+        ParentIdAndRdn parent = rdnIdx.reverseLookup( parentId );
 
         while ( parent != null )
         {
@@ -862,7 +862,7 @@ public abstract class AbstractBTreeParti
             }
 
             // Update the parent's nbChildren and nbDescendants values
-            ParentIdAndRdn<UUID> parent = rdnIdx.reverseLookup( id );
+            ParentIdAndRdn parent = rdnIdx.reverseLookup( id );
             updateRdnIdx( parent.getParentId(), REMOVE_CHILD, 0 );
 
             // Update the rdn, oneLevel, subLevel, entryCsn and entryUuid indexes
@@ -931,9 +931,9 @@ public abstract class AbstractBTreeParti
         {
             // We use the OneLevel index to get all the entries from a starting point
             // and below up to the number of children
-            Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = rdnIdx.forwardCursor();
+            Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = rdnIdx.forwardCursor();
 
-            IndexEntry<ParentIdAndRdn<UUID>, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<UUID>, UUID>();
+            IndexEntry<ParentIdAndRdn, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn, UUID>();
             startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
             cursor.before( startingPos );
 
@@ -1552,7 +1552,7 @@ public abstract class AbstractBTreeParti
 
         // Update the Rdn index
         // First drop the old entry
-        ParentIdAndRdn<UUID> movedEntry = rdnIdx.reverseLookup( entryId );
+        ParentIdAndRdn movedEntry = rdnIdx.reverseLookup( entryId );
 
         updateRdnIdx( oldParentId, REMOVE_CHILD, movedEntry.getNbDescendants() );
 
@@ -1732,7 +1732,7 @@ public abstract class AbstractBTreeParti
          * Update the Rdn index
          */
         // First drop the old entry
-        ParentIdAndRdn<UUID> movedEntry = rdnIdx.reverseLookup( entryId );
+        ParentIdAndRdn movedEntry = rdnIdx.reverseLookup( entryId );
 
         updateRdnIdx( oldParentId, REMOVE_CHILD, movedEntry.getNbDescendants() );
 
@@ -1924,7 +1924,7 @@ public abstract class AbstractBTreeParti
         UUID parentId = getParentId( oldId );
 
         // Get the old parentIdAndRdn to get the nb of children and descendant
-        ParentIdAndRdn<UUID> parentIdAndRdn = rdnIdx.reverseLookup( oldId );
+        ParentIdAndRdn parentIdAndRdn = rdnIdx.reverseLookup( oldId );
 
         // Now we can drop it
         rdnIdx.drop( oldId );
@@ -2015,7 +2015,7 @@ public abstract class AbstractBTreeParti
 
         do
         {
-            ParentIdAndRdn<UUID> cur = rdnIdx.reverseLookup( parentId );
+            ParentIdAndRdn cur = rdnIdx.reverseLookup( parentId );
             Rdn[] rdns = cur.getRdns();
 
             for ( Rdn rdn : rdns )
@@ -2057,7 +2057,7 @@ public abstract class AbstractBTreeParti
     {
         try
         {
-            ParentIdAndRdn<UUID> parentIdAndRdn = rdnIdx.reverseLookup( id );
+            ParentIdAndRdn parentIdAndRdn = rdnIdx.reverseLookup( id );
 
             return parentIdAndRdn.getNbChildren();
         }
@@ -2089,7 +2089,7 @@ public abstract class AbstractBTreeParti
                 return Partition.ROOT_ID;
             }
 
-            ParentIdAndRdn<UUID> suffixKey = new ParentIdAndRdn<UUID>( Partition.ROOT_ID, suffixDn.getRdns() );
+            ParentIdAndRdn suffixKey = new ParentIdAndRdn( Partition.ROOT_ID, suffixDn.getRdns() );
 
             // Check into the Rdn index, starting with the partition Suffix
             UUID currentId = rdnIdx.forwardLookup( suffixKey );
@@ -2097,7 +2097,7 @@ public abstract class AbstractBTreeParti
             for ( int i = dn.size() - suffixDn.size(); i > 0; i-- )
             {
                 Rdn rdn = dn.getRdn( i - 1 );
-                ParentIdAndRdn<UUID> currentRdn = new ParentIdAndRdn<UUID>( currentId, rdn );
+                ParentIdAndRdn currentRdn = new ParentIdAndRdn( currentId, rdn );
                 currentId = rdnIdx.forwardLookup( currentRdn );
 
                 if ( currentId == null )
@@ -2120,7 +2120,7 @@ public abstract class AbstractBTreeParti
      */
     public UUID getParentId( UUID childId ) throws Exception
     {
-        ParentIdAndRdn<UUID> key = rdnIdx.reverseLookup( childId );
+        ParentIdAndRdn key = rdnIdx.reverseLookup( childId );
 
         if ( key == null )
         {
@@ -2138,7 +2138,7 @@ public abstract class AbstractBTreeParti
     {
         if ( suffixId == null )
         {
-            ParentIdAndRdn<UUID> key = new ParentIdAndRdn<UUID>( Partition.ROOT_ID, suffixDn.getRdns() );
+            ParentIdAndRdn key = new ParentIdAndRdn( Partition.ROOT_ID, suffixDn.getRdns() );
 
             suffixId = rdnIdx.forwardLookup( key );
         }
@@ -2371,9 +2371,9 @@ public abstract class AbstractBTreeParti
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public Index<ParentIdAndRdn<UUID>, Entry, UUID> getRdnIndex()
+    public Index<ParentIdAndRdn, Entry, UUID> getRdnIndex()
     {
-        return ( Index<ParentIdAndRdn<UUID>, Entry, UUID> ) systemIndices.get( ApacheSchemaConstants.APACHE_RDN_AT_OID );
+        return ( Index<ParentIdAndRdn, Entry, UUID> ) systemIndices.get( ApacheSchemaConstants.APACHE_RDN_AT_OID );
     }
 
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdn.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdn.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdn.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdn.java Wed Aug 29 15:02:48 2012
@@ -26,6 +26,7 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.Arrays;
 import java.util.List;
+import java.util.UUID;
 
 import org.apache.directory.shared.ldap.model.name.Rdn;
 
@@ -37,10 +38,10 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ParentIdAndRdn<ID extends Comparable<ID>> implements Externalizable, Comparable<ParentIdAndRdn<ID>>
+public class ParentIdAndRdn implements Externalizable, Comparable<ParentIdAndRdn>
 {
     /** The entry ID */
-    protected ID parentId;
+    protected UUID parentId;
 
     /** The list of Rdn for this instance */
     protected Rdn[] rdns;
@@ -51,6 +52,7 @@ public class ParentIdAndRdn<ID extends C
     /** Number of global descendant */
     protected int nbDescendants;
 
+
     /**
      * Serializable constructor.
      */
@@ -65,7 +67,7 @@ public class ParentIdAndRdn<ID extends C
      * @param parentId the parent ID
      * @param rdns the RDNs
      */
-    public ParentIdAndRdn( ID parentId, Rdn... rdns )
+    public ParentIdAndRdn( UUID parentId, Rdn... rdns )
     {
         this.parentId = parentId;
         this.rdns = rdns;
@@ -78,7 +80,7 @@ public class ParentIdAndRdn<ID extends C
      * @param parentId the parent ID
      * @param rdns the RDNs
      */
-    public ParentIdAndRdn( ID parentId, List<Rdn> rdns )
+    public ParentIdAndRdn( UUID parentId, List<Rdn> rdns )
     {
         this.parentId = parentId;
         this.rdns = rdns.toArray( new Rdn[rdns.size()] );
@@ -92,7 +94,7 @@ public class ParentIdAndRdn<ID extends C
      * 
      * @return the parent ID
      */
-    public ID getParentId()
+    public UUID getParentId()
     {
         return parentId;
     }
@@ -103,7 +105,7 @@ public class ParentIdAndRdn<ID extends C
      * 
      * @param parentId the new parent ID
      */
-    public void setParentId( ID parentId )
+    public void setParentId( UUID parentId )
     {
         this.parentId = parentId;
     }
@@ -152,12 +154,12 @@ public class ParentIdAndRdn<ID extends C
             return true;
         }
 
-        if ( !( obj instanceof ParentIdAndRdn<?> ) )
+        if ( !( obj instanceof ParentIdAndRdn ) )
         {
             return false;
         }
 
-        ParentIdAndRdn<ID> that = ( ParentIdAndRdn<ID> ) obj;
+        ParentIdAndRdn that = ( ParentIdAndRdn ) obj;
 
         if ( rdns == null )
         {
@@ -183,18 +185,18 @@ public class ParentIdAndRdn<ID extends C
 
         return true;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public int compareTo( ParentIdAndRdn<ID> that )
+    public int compareTo( ParentIdAndRdn that )
     {
         // Special case when that.rdns = null : we are searching for oneLevel or subLevel scope
         if ( that.rdns == null )
         {
             int val = parentId.compareTo( that.parentId );
-            
+
             if ( val != 0 )
             {
                 return val;
@@ -209,7 +211,7 @@ public class ParentIdAndRdn<ID extends C
         if ( rdns == null )
         {
             int res = parentId.compareTo( that.parentId );
-            
+
             if ( res == 0 )
             {
                 return -1;
@@ -219,14 +221,14 @@ public class ParentIdAndRdn<ID extends C
                 return res;
             }
         }
-        
+
         int val = parentId.compareTo( that.getParentId() );
 
         if ( val != 0 )
         {
             return val;
         }
-        
+
         // The ID is the same, check the RDNs now
 
         val = rdns.length - that.rdns.length;
@@ -235,12 +237,12 @@ public class ParentIdAndRdn<ID extends C
         {
             return val;
         }
-        
+
         if ( rdns.length == 1 )
         {
             // Special case : we only have one rdn.
             val = rdns[0].getNormName().compareTo( that.rdns[0].getNormName() );
-            
+
             return val;
         }
         else
@@ -248,13 +250,13 @@ public class ParentIdAndRdn<ID extends C
             for ( int i = 0; i < rdns.length; i++ )
             {
                 val = rdns[i].getNormName().compareTo( that.rdns[i].getNormName() );
-            
+
                 if ( val != 0 )
                 {
                     return val;
                 }
             }
-            
+
             return 0;
         }
     }
@@ -262,7 +264,8 @@ public class ParentIdAndRdn<ID extends C
 
     public void writeExternal( ObjectOutput out ) throws IOException
     {
-        out.writeObject( parentId );
+        out.writeLong( parentId.getMostSignificantBits() );
+        out.writeLong( parentId.getLeastSignificantBits() );
         out.writeInt( nbChildren );
         out.writeInt( nbDescendants );
         out.writeInt( rdns.length );
@@ -277,7 +280,9 @@ public class ParentIdAndRdn<ID extends C
     @SuppressWarnings("unchecked")
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
-        parentId = ( ID ) in.readObject();
+        long uuidMsb = in.readLong();
+        long uuidLsb = in.readLong();
+        parentId = new UUID( uuidMsb, uuidLsb );
         nbChildren = in.readInt();
         nbDescendants = in.readInt();
         int size = in.readInt();
@@ -330,8 +335,6 @@ public class ParentIdAndRdn<ID extends C
     }
 
 
-
-
     /**
      * {@inheritDoc}
      */
@@ -349,7 +352,7 @@ public class ParentIdAndRdn<ID extends C
         else
         {
             boolean isFirst = true;
-    
+
             for ( Rdn rdn : rdns )
             {
                 if ( isFirst )
@@ -360,16 +363,15 @@ public class ParentIdAndRdn<ID extends C
                 {
                     sb.append( "," );
                 }
-    
+
                 sb.append( rdn );
             }
 
             sb.append( "'>" );
-            
+
             sb.append( "[nbC:" ).append( nbChildren ).append( ", nbD:" ).append( nbDescendants ).append( "]" );
         }
 
-
         return sb.toString();
     }
 }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdnComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdnComparator.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdnComparator.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/ParentIdAndRdnComparator.java Wed Aug 29 15:02:48 2012
@@ -29,7 +29,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ParentIdAndRdnComparator<ID extends Comparable<ID>> extends SerializableComparator<ParentIdAndRdn<ID>>
+public class ParentIdAndRdnComparator<ID extends Comparable<ID>> extends SerializableComparator<ParentIdAndRdn>
 {
     /** The serial version UID */
     private static final long serialVersionUID = 2L;
@@ -50,7 +50,7 @@ public class ParentIdAndRdnComparator<ID
      * {@inheritDoc}
      */
     @Override
-    public int compare( ParentIdAndRdn<ID> rdn1, ParentIdAndRdn<ID> rdn2 )
+    public int compare( ParentIdAndRdn rdn1, ParentIdAndRdn rdn2 )
     {
         return rdn1.compareTo( rdn2 );
     }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java Wed Aug 29 15:02:48 2012
@@ -192,7 +192,7 @@ public interface Store<E>
     /**
      * @return The Rdn system index
      */
-    Index<ParentIdAndRdn<UUID>, E, UUID> getRdnIndex();
+    Index<ParentIdAndRdn, E, UUID> getRdnIndex();
 
 
     /**

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndex.java Wed Aug 29 15:02:48 2012
@@ -38,7 +38,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AvlRdnIndex extends AvlIndex<ParentIdAndRdn<UUID>, Entry>
+public class AvlRdnIndex extends AvlIndex<ParentIdAndRdn, Entry>
 {
     public AvlRdnIndex()
     {
@@ -84,9 +84,9 @@ public class AvlRdnIndex extends AvlInde
          * primary keys.  A value for an attribute can occur several times in
          * different entries so the forward map can have more than one value.
          */
-        forward = new AvlTable<ParentIdAndRdn<UUID>, UUID>( attributeType.getName(), comp, UuidComparator.INSTANCE,
+        forward = new AvlTable<ParentIdAndRdn, UUID>( attributeType.getName(), comp, UuidComparator.INSTANCE,
             false );
-        reverse = new AvlTable<UUID, ParentIdAndRdn<UUID>>( attributeType.getName(), UuidComparator.INSTANCE, comp,
+        reverse = new AvlTable<UUID, ParentIdAndRdn>( attributeType.getName(), UuidComparator.INSTANCE, comp,
             false );
     }
 }

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java Wed Aug 29 15:02:48 2012
@@ -49,7 +49,7 @@ public class ChildrenCursor extends Abst
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 );
 
     /** A Cursor over the entries in the scope of the search base */
-    private final Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor;
+    private final Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor;
 
     /** The Parent ID */
     private UUID parentId;
@@ -65,7 +65,7 @@ public class ChildrenCursor extends Abst
      * @param evaluator an IndexEntry (candidate) evaluator
      * @throws Exception on db access failures
      */
-    public ChildrenCursor( Store<Entry> db, UUID parentId, Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor )
+    public ChildrenCursor( Store<Entry> db, UUID parentId, Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor )
         throws Exception
     {
         LOG_CURSOR.debug( "Creating ChildrenCursor {}", this );
@@ -120,7 +120,7 @@ public class ChildrenCursor extends Abst
         {
             IndexEntry entry = cursor.get();
 
-            if ( ( ( ParentIdAndRdn<UUID> ) entry.getTuple().getKey() ).getParentId().equals( parentId ) )
+            if ( ( ( ParentIdAndRdn ) entry.getTuple().getKey() ).getParentId().equals( parentId ) )
             {
                 prefetched = entry;
                 return true;
@@ -145,7 +145,7 @@ public class ChildrenCursor extends Abst
             IndexEntry cursorEntry = cursor.get();
             IndexEntry<UUID, UUID> entry = new ForwardIndexEntry();
             entry.setId( ( UUID ) cursorEntry.getId() );
-            entry.setKey( ( ( ParentIdAndRdn<UUID> ) cursorEntry.getTuple().getKey() ).getParentId() );
+            entry.setKey( ( ( ParentIdAndRdn ) cursorEntry.getTuple().getKey() ).getParentId() );
 
             if ( entry.getKey().equals( parentId ) )
             {

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java Wed Aug 29 15:02:48 2012
@@ -58,7 +58,7 @@ public class DescendantCursor extends Ab
     private IndexEntry prefetched;
 
     /** The current Cursor over the entries in the scope of the search base */
-    private Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> currentCursor;
+    private Cursor<IndexEntry<ParentIdAndRdn, UUID>> currentCursor;
 
     /** The current Parent ID */
     private UUID currentParentId;
@@ -87,7 +87,7 @@ public class DescendantCursor extends Ab
      * @throws Exception on db access failures
      */
     public DescendantCursor( Store<Entry> db, UUID baseId, UUID parentId,
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor )
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor )
         throws Exception
     {
         this( db, baseId, parentId, cursor, TOP_LEVEL );
@@ -102,7 +102,7 @@ public class DescendantCursor extends Ab
      * @throws Exception on db access failures
      */
     public DescendantCursor( Store<Entry> db, UUID baseId, UUID parentId,
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor,
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor,
         boolean topLevel )
         throws Exception
     {
@@ -163,7 +163,7 @@ public class DescendantCursor extends Ab
         {
             IndexEntry entry = currentCursor.get();
 
-            if ( ( ( ParentIdAndRdn<UUID> ) entry.getTuple().getKey() ).getParentId().equals( currentParentId ) )
+            if ( ( ( ParentIdAndRdn ) entry.getTuple().getKey() ).getParentId().equals( currentParentId ) )
             {
                 prefetched = entry;
                 return true;
@@ -193,7 +193,7 @@ public class DescendantCursor extends Ab
             if ( hasNext )
             {
                 IndexEntry cursorEntry = currentCursor.get();
-                ParentIdAndRdn<UUID> parentIdAndRdn = ( ( ParentIdAndRdn<UUID> ) ( cursorEntry.getKey() ) );
+                ParentIdAndRdn parentIdAndRdn = ( ( ParentIdAndRdn ) ( cursorEntry.getKey() ) );
 
                 // Check that we aren't out of the cursor's limit
                 if ( !parentIdAndRdn.getParentId().equals( currentParentId ) )
@@ -204,7 +204,7 @@ public class DescendantCursor extends Ab
                     if ( !finished )
                     {
                         currentCursor.close();
-                        currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> ) cursorStack.pop();
+                        currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn, UUID>> ) cursorStack.pop();
                         currentParentId = ( UUID ) parentIdStack.pop();
                     }
 
@@ -230,9 +230,9 @@ public class DescendantCursor extends Ab
                         UUID newParentId = ( UUID ) cursorEntry.getId();
 
                         // Yes, then create a new cursor and go down one level
-                        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = db.getRdnIndex().forwardCursor();
+                        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = db.getRdnIndex().forwardCursor();
 
-                        IndexEntry<ParentIdAndRdn<UUID>, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<UUID>, UUID>();
+                        IndexEntry<ParentIdAndRdn, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn, UUID>();
                         startingPos.setKey( new ParentIdAndRdn( newParentId, ( Rdn[] ) null ) );
                         cursor.before( startingPos );
 
@@ -254,7 +254,7 @@ public class DescendantCursor extends Ab
                 if ( !finished )
                 {
                     currentCursor.close();
-                    currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> ) cursorStack.pop();
+                    currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn, UUID>> ) cursorStack.pop();
                     currentParentId = ( UUID ) parentIdStack.pop();
                 }
                 // and continue...

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java Wed Aug 29 15:02:48 2012
@@ -85,9 +85,9 @@ public class OneLevelScopeCursor extends
 
         // We use the RdnIndex to get all the entries from a starting point
         // and below up to the number of children
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = db.getRdnIndex().forwardCursor();
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = db.getRdnIndex().forwardCursor();
 
-        IndexEntry<ParentIdAndRdn<UUID>, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<UUID>, UUID>();
+        IndexEntry<ParentIdAndRdn, UUID> startingPos = new ForwardIndexEntry<ParentIdAndRdn, UUID>();
         startingPos.setKey( new ParentIdAndRdn( evaluator.getBaseId(), ( Rdn[] ) null ) );
         cursor.before( startingPos );
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java Wed Aug 29 15:02:48 2012
@@ -92,13 +92,13 @@ public class SubtreeScopeCursor extends 
             // We use the RdnIndex to get all the entries from a starting point
             // and below up to the number of children
             UUID baseId = evaluator.getBaseId();
-            ParentIdAndRdn<UUID> parentIdAndRdn = db.getRdnIndex().reverseLookup( baseId );
+            ParentIdAndRdn parentIdAndRdn = db.getRdnIndex().reverseLookup( baseId );
             IndexEntry indexEntry = new ForwardIndexEntry();
 
             indexEntry.setId( baseId );
             indexEntry.setKey( parentIdAndRdn );
 
-            Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = new SingletonIndexCursor<ParentIdAndRdn<UUID>>(
+            Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = new SingletonIndexCursor<ParentIdAndRdn>(
                 indexEntry );
             UUID parentId = parentIdAndRdn.getParentId();
 

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/OneLevelScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/OneLevelScopeEvaluator.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/OneLevelScopeEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/OneLevelScopeEvaluator.java Wed Aug 29 15:02:48 2012
@@ -100,7 +100,7 @@ public class OneLevelScopeEvaluator<E> i
      */
     public boolean evaluate( IndexEntry<?, UUID> candidate ) throws Exception
     {
-        ParentIdAndRdn<UUID> parent = db.getRdnIndex().reverseLookup( candidate.getId() );
+        ParentIdAndRdn parent = db.getRdnIndex().reverseLookup( candidate.getId() );
         boolean isChild = parent.getParentId().equals( baseId );
 
         /*

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/SubtreeScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/SubtreeScopeEvaluator.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/SubtreeScopeEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/evaluator/SubtreeScopeEvaluator.java Wed Aug 29 15:02:48 2012
@@ -127,7 +127,7 @@ public class SubtreeScopeEvaluator<E> im
 
         while ( true )
         {
-            ParentIdAndRdn<UUID> parentIdAndRdn = db.getRdnIndex().reverseLookup( tmp );
+            ParentIdAndRdn parentIdAndRdn = db.getRdnIndex().reverseLookup( tmp );
 
             if ( parentIdAndRdn == null )
             {

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ParentIdAndRdnTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ParentIdAndRdnTest.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ParentIdAndRdnTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/ParentIdAndRdnTest.java Wed Aug 29 15:02:48 2012
@@ -20,9 +20,11 @@
 package org.apache.directory.server.xdbm;
 
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
 import java.io.File;
+
 import org.apache.directory.server.xdbm.impl.avl.AvlPartitionTest;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.name.Rdn;
@@ -31,12 +33,12 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.util.Strings;
 import org.apache.directory.shared.util.exception.Exceptions;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import static org.junit.Assert.assertEquals;
 
 
 /**
@@ -82,42 +84,43 @@ public class ParentIdAndRdnTest
     @Test
     public void testCompareEquals() throws LdapInvalidDnException
     {
-        ParentIdAndRdn<Long> rdn1 = new ParentIdAndRdn<Long>( 2L, new Rdn( schemaManager, "cn=test" ) );
-        ParentIdAndRdn<Long> rdn2 = new ParentIdAndRdn<Long>( 2L, new Rdn( schemaManager, "CN=test2" ) );
-        ParentIdAndRdn<Long> rdn3 = new ParentIdAndRdn<Long>( 2L, new Rdn( schemaManager, "ou=test" ) );
-        ParentIdAndRdn<Long> rdn4 = new ParentIdAndRdn<Long>( 2L, new Rdn( schemaManager, "2.5.4.11=test2" ) );
-        ParentIdAndRdn<Long> rdn5 = new ParentIdAndRdn<Long>( 1L, new Rdn( schemaManager, "CommonName= Test " ) );
-        ParentIdAndRdn<Long> rdn6 = new ParentIdAndRdn<Long>( 2L, new Rdn( schemaManager, "cn=test+sn=small" ) );
-        ParentIdAndRdn<Long> rdn7 = new ParentIdAndRdn<Long>( 2L, new Rdn( schemaManager, "2.5.4.4= Small + 2.5.4.3 = TEST " ) );
-        
+        ParentIdAndRdn rdn1 = new ParentIdAndRdn( Strings.getUUID( 2L ), new Rdn( schemaManager, "cn=test" ) );
+        ParentIdAndRdn rdn2 = new ParentIdAndRdn( Strings.getUUID( 2L ), new Rdn( schemaManager, "CN=test2" ) );
+        ParentIdAndRdn rdn3 = new ParentIdAndRdn( Strings.getUUID( 2L ), new Rdn( schemaManager, "ou=test" ) );
+        ParentIdAndRdn rdn4 = new ParentIdAndRdn( Strings.getUUID( 2L ), new Rdn( schemaManager, "2.5.4.11=test2" ) );
+        ParentIdAndRdn rdn5 = new ParentIdAndRdn( Strings.getUUID( 1L ), new Rdn( schemaManager, "CommonName= Test " ) );
+        ParentIdAndRdn rdn6 = new ParentIdAndRdn( Strings.getUUID( 2L ), new Rdn( schemaManager, "cn=test+sn=small" ) );
+        ParentIdAndRdn rdn7 = new ParentIdAndRdn( Strings.getUUID( 2L ), new Rdn( schemaManager,
+            "2.5.4.4= Small + 2.5.4.3 = TEST " ) );
+
         // First rdn
         assertEquals( 0, rdn1.compareTo( rdn1 ) );
         assertEquals( -1, rdn1.compareTo( rdn2 ) );
         assertEquals( 2, rdn1.compareTo( rdn3 ) );
         assertEquals( 2, rdn1.compareTo( rdn4 ) );
         assertEquals( 1, rdn1.compareTo( rdn5 ) );
-        
+
         // Second rdn
         assertEquals( 1, rdn2.compareTo( rdn1 ) );
         assertEquals( 0, rdn2.compareTo( rdn2 ) );
         assertEquals( 2, rdn2.compareTo( rdn3 ) );
         assertEquals( 2, rdn2.compareTo( rdn4 ) );
         assertEquals( 1, rdn2.compareTo( rdn5 ) );
-        
+
         // Third rdn
         assertEquals( -2, rdn3.compareTo( rdn1 ) );
         assertEquals( -2, rdn3.compareTo( rdn2 ) );
         assertEquals( 0, rdn3.compareTo( rdn3 ) );
         assertEquals( -1, rdn3.compareTo( rdn4 ) );
         assertEquals( 1, rdn3.compareTo( rdn5 ) );
-        
+
         // Forth rdn
         assertEquals( -2, rdn4.compareTo( rdn1 ) );
         assertEquals( -2, rdn4.compareTo( rdn2 ) );
         assertEquals( 1, rdn4.compareTo( rdn3 ) );
         assertEquals( 0, rdn4.compareTo( rdn4 ) );
         assertEquals( 1, rdn4.compareTo( rdn5 ) );
-        
+
         // Fifth rdn
         assertEquals( -1, rdn5.compareTo( rdn1 ) );
         assertEquals( -1, rdn5.compareTo( rdn2 ) );

Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java?rev=1378598&r1=1378597&r2=1378598&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlRdnIndexTest.java Wed Aug 29 15:02:48 2012
@@ -58,7 +58,7 @@ import org.junit.Test;
 public class AvlRdnIndexTest
 {
     private static File dbFileDir;
-    Index<ParentIdAndRdn<UUID>, Entry, UUID> idx;
+    Index<ParentIdAndRdn, Entry, UUID> idx;
     private static SchemaManager schemaManager;
 
 
@@ -189,13 +189,13 @@ public class AvlRdnIndexTest
         initIndex();
         assertEquals( 0, idx.count() );
 
-        ParentIdAndRdn<UUID> key = new ParentIdAndRdn<UUID>( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
+        ParentIdAndRdn key = new ParentIdAndRdn( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
 
         idx.add( key, Strings.getUUID( 0L ) );
         assertEquals( 1, idx.count() );
 
         // setting a different parentId should make this key a different key
-        key = new ParentIdAndRdn<UUID>( Strings.getUUID( 1L ), new Rdn( "cn=key" ) );
+        key = new ParentIdAndRdn( Strings.getUUID( 1L ), new Rdn( "cn=key" ) );
 
         idx.add( key, Strings.getUUID( 1L ) );
         assertEquals( 2, idx.count() );
@@ -204,7 +204,7 @@ public class AvlRdnIndexTest
         idx.add( key, Strings.getUUID( 2L ) );
         assertEquals( 2, idx.count() );
 
-        key = new ParentIdAndRdn<UUID>( Strings.getUUID( 2L ), new Rdn( "cn=key" ) );
+        key = new ParentIdAndRdn( Strings.getUUID( 2L ), new Rdn( "cn=key" ) );
         idx.add( key, Strings.getUUID( 3L ) );
         assertEquals( 3, idx.count() );
     }
@@ -215,7 +215,7 @@ public class AvlRdnIndexTest
     {
         initIndex();
 
-        ParentIdAndRdn<UUID> key = new ParentIdAndRdn<UUID>( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
+        ParentIdAndRdn key = new ParentIdAndRdn( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
 
         assertEquals( 0, idx.count( key ) );
 
@@ -233,7 +233,7 @@ public class AvlRdnIndexTest
     {
         initIndex();
 
-        ParentIdAndRdn<UUID> key = new ParentIdAndRdn<UUID>( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
+        ParentIdAndRdn key = new ParentIdAndRdn( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
 
         assertNull( idx.forwardLookup( key ) );
 
@@ -248,7 +248,7 @@ public class AvlRdnIndexTest
     {
         initIndex();
 
-        ParentIdAndRdn<UUID> key = new ParentIdAndRdn<UUID>( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
+        ParentIdAndRdn key = new ParentIdAndRdn( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
 
         assertNull( idx.forwardLookup( key ) );
 
@@ -271,7 +271,7 @@ public class AvlRdnIndexTest
     {
         initIndex();
 
-        ParentIdAndRdn<UUID> key = new ParentIdAndRdn<UUID>( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
+        ParentIdAndRdn key = new ParentIdAndRdn( Strings.getUUID( 0L ), new Rdn( "cn=key" ) );
 
         assertEquals( 0, idx.count() );
 
@@ -280,7 +280,7 @@ public class AvlRdnIndexTest
 
         for ( long i = 1; i < 5; i++ )
         {
-            key = new ParentIdAndRdn<UUID>( Strings.getUUID( i ), new Rdn( "cn=key" + i ) );
+            key = new ParentIdAndRdn( Strings.getUUID( i ), new Rdn( "cn=key" + i ) );
 
             idx.add( key, Strings.getUUID( i ) );
         }
@@ -288,23 +288,23 @@ public class AvlRdnIndexTest
         assertEquals( 5, idx.count() );
 
         // use forward index's cursor
-        Cursor<IndexEntry<ParentIdAndRdn<UUID>, UUID>> cursor = idx.forwardCursor();
+        Cursor<IndexEntry<ParentIdAndRdn, UUID>> cursor = idx.forwardCursor();
         cursor.beforeFirst();
 
         cursor.next();
-        IndexEntry<ParentIdAndRdn<UUID>, UUID> e1 = cursor.get();
+        IndexEntry<ParentIdAndRdn, UUID> e1 = cursor.get();
         assertEquals( Strings.getUUID( 0L ), e1.getId() );
         assertEquals( "cn=key", e1.getKey().getRdns()[0].getName() );
         assertEquals( Strings.getUUID( 0L ), e1.getKey().getParentId() );
 
         cursor.next();
-        IndexEntry<ParentIdAndRdn<UUID>, UUID> e2 = cursor.get();
+        IndexEntry<ParentIdAndRdn, UUID> e2 = cursor.get();
         assertEquals( Strings.getUUID( 1L ), e2.getId() );
         assertEquals( "cn=key1", e2.getKey().getRdns()[0].getName() );
         assertEquals( Strings.getUUID( 1L ), e2.getKey().getParentId() );
 
         cursor.next();
-        IndexEntry<ParentIdAndRdn<UUID>, UUID> e3 = cursor.get();
+        IndexEntry<ParentIdAndRdn, UUID> e3 = cursor.get();
         assertEquals( Strings.getUUID( 2L ), e3.getId() );
         assertEquals( "cn=key2", e3.getKey().getRdns()[0].getName() );
         assertEquals( Strings.getUUID( 2L ), e3.getKey().getParentId() );



Mime
View raw message