directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1199843 - in /directory/apacheds/branches/apacheds-txns/core-api/src: main/java/org/apache/directory/server/core/api/partition/ main/java/org/apache/directory/server/core/api/partition/index/ main/java/org/apache/directory/server/core/api/...
Date Wed, 09 Nov 2011 16:57:35 GMT
Author: saya
Date: Wed Nov  9 16:57:34 2011
New Revision: 1199843

URL: http://svn.apache.org/viewvc?rev=1199843&view=rev
Log:
Change interfaces to use uuid and got rid of some unnecessary generic types. ID is replaced with UUID. Master table does not use generics. Only value type is a generic parameter for indices and cursors.

Added:
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/UUIDComparator.java
Modified:
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/AbstractPartition.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndex.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexCursor.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexEntry.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/EmptyIndexCursor.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexComparator.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexEntry.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/GenericIndex.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/Index.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexComparator.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexCursor.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexEntry.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/MasterTable.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdn.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdnComparator.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexComparator.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexEntry.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/SingletonIndexCursor.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnLogManager.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnManager.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractDataChange.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractLogEdit.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/DataChange.java
    directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/LogEdit.java
    directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/AbstractIndexCursorTest.java
    directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/EmptyIndexCursorTest.java
    directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ForwardIndexEntryTest.java
    directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/GenericIndexTest.java
    directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ReverseIndexEntryTest.java
    directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/SingletonIndexCursorTest.java

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/AbstractPartition.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/AbstractPartition.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/AbstractPartition.java Wed Nov  9 16:57:34 2011
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.util.UUID;
 
 import javax.naming.InvalidNameException;
 
@@ -55,6 +56,12 @@ public abstract class AbstractPartition 
     /** The root Dn for this partition */
     protected Dn suffixDn;
 
+    /** root ID */
+    UUID rootID = UUID.fromString( "00000000-0000-0000-0000-000000000000" );
+    
+    /** Default ID */
+    UUID defaultID = UUID.fromString( "00000000-0000-0000-0000-000000000001" );
+    
     /**
      * {@inheritDoc}
      */
@@ -201,6 +208,24 @@ public abstract class AbstractPartition 
     {
         stream.write( Strings.getBytesUtf8( "Nothing to dump for index " + name ) );
     }
+    
+
+    /**
+     * {@inheritDoc}
+     */
+    public UUID getDefaultId()
+    {
+        return defaultID;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public UUID getRootId()
+    {
+        return rootID;
+    }
 
     
     /**

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndex.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndex.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndex.java Wed Nov  9 16:57:34 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractIndex<K, O, ID> implements Index<K, O, ID>
+public abstract class AbstractIndex<K> implements Index<K>
 {
     /** The attribute identifier for this index */ 
     protected String attributeId;

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexCursor.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexCursor.java Wed Nov  9 16:57:34 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import java.util.Iterator;
+import java.util.UUID;
 
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
@@ -32,7 +33,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractIndexCursor<V, Entry, ID> extends AbstractCursor<IndexEntry<V, ID>> implements IndexCursor<V, Entry, ID>
+public abstract class AbstractIndexCursor<V> extends AbstractCursor<IndexEntry<V>> implements IndexCursor<V>
 {
     /** Tells if there are some element available in the cursor */
     private boolean available = false;
@@ -60,7 +61,7 @@ public abstract class AbstractIndexCurso
     /**
      * {@inheritDoc}
      */
-    public void after( IndexEntry<V, ID> element ) throws Exception
+    public void after( IndexEntry<V> element ) throws Exception
     {
         throw new UnsupportedOperationException( getUnsupportedMessage() );
     }
@@ -69,7 +70,7 @@ public abstract class AbstractIndexCurso
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<V, ID> element ) throws Exception
+    public void before( IndexEntry<V> element ) throws Exception
     {
         throw new UnsupportedOperationException( getUnsupportedMessage() );
     }
@@ -78,7 +79,7 @@ public abstract class AbstractIndexCurso
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID id, V value ) throws Exception
+    public void afterValue( UUID id, V value ) throws Exception
     {
         throw new UnsupportedOperationException( getUnsupportedMessage() );
     }
@@ -87,7 +88,7 @@ public abstract class AbstractIndexCurso
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, V value ) throws Exception
+    public void beforeValue( UUID id, V value ) throws Exception
     {
         throw new UnsupportedOperationException( getUnsupportedMessage() );
     }
@@ -105,9 +106,9 @@ public abstract class AbstractIndexCurso
     /**
      * {@inheritDoc}
      */
-    public Iterator<IndexEntry<V, ID>> iterator()
+    public Iterator<IndexEntry<V>> iterator()
     {
-        return new CursorIterator<IndexEntry<V, ID>>( this );
+        return new CursorIterator<IndexEntry<V>>( this );
     }
 
 

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexEntry.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexEntry.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/AbstractIndexEntry.java Wed Nov  9 16:57:34 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.core.api.partition.index;
 
+import java.util.UUID;
+
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 
@@ -30,7 +32,7 @@ import org.apache.directory.shared.ldap.
  * @param <V> The value stored in the Tuple, associated key for the object
  * @param <ID> The ID of the object
  */
-public abstract class AbstractIndexEntry<V, ID> implements IndexEntry<V, ID>
+public abstract class AbstractIndexEntry<V> implements IndexEntry<V>
 {
     /** The referenced Entry if loaded from the store */
     private Entry entry;
@@ -61,13 +63,13 @@ public abstract class AbstractIndexEntry
     /**
      * {@inheritDoc}
      */
-    public abstract ID getId();
+    public abstract UUID getId();
 
     
     /**
      * {@inheritDoc}
      */
-    public abstract void setId( ID id );
+    public abstract void setId( UUID id );
 
     
     /**
@@ -106,7 +108,7 @@ public abstract class AbstractIndexEntry
     /**
      * {@inheritDoc}
      */
-    public void copy( IndexEntry<V, ID> entry )
+    public void copy( IndexEntry<V> entry )
     {
         this.entry = entry.getEntry();
     }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/EmptyIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/EmptyIndexCursor.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/EmptyIndexCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/EmptyIndexCursor.java Wed Nov  9 16:57:34 2011
@@ -19,6 +19,8 @@
 package org.apache.directory.server.core.api.partition.index;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 
@@ -28,12 +30,12 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EmptyIndexCursor<K, E, ID> extends AbstractIndexCursor<K, E, ID>
+public class EmptyIndexCursor<K> extends AbstractIndexCursor<K>
 {
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<K, ID> element ) throws Exception
+    public void before( IndexEntry<K> element ) throws Exception
     {
         checkNotClosed( "before()" );
     }
@@ -51,7 +53,7 @@ public class EmptyIndexCursor<K, E, ID> 
     /**
      * {@inheritDoc}
      */
-    public void after( IndexEntry<K, ID> element ) throws Exception
+    public void after( IndexEntry<K> element ) throws Exception
     {
         checkNotClosed( "after()" );
     }
@@ -97,7 +99,7 @@ public class EmptyIndexCursor<K, E, ID> 
     }
 
 
-    public IndexEntry<K, ID> get() throws Exception
+    public IndexEntry<K> get() throws Exception
     {
         checkNotClosed( "get()" );
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_703 ) );
@@ -107,7 +109,7 @@ public class EmptyIndexCursor<K, E, ID> 
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID id, K indexValue ) throws Exception
+    public void afterValue( UUID id, K indexValue ) throws Exception
     {
         checkNotClosed( "after()" );
     }
@@ -116,7 +118,7 @@ public class EmptyIndexCursor<K, E, ID> 
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, K indexValue ) throws Exception
+    public void beforeValue( UUID id, K indexValue ) throws Exception
     {
         checkNotClosed( "after()" );
     }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexComparator.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexComparator.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexComparator.java Wed Nov  9 16:57:34 2011
@@ -20,27 +20,29 @@
 package org.apache.directory.server.core.api.partition.index;
 
 import java.util.Comparator;
+import java.util.UUID;
 
-public class ForwardIndexComparator<V, ID> implements IndexComparator<V,ID>
+public class ForwardIndexComparator<V> implements IndexComparator<V>
 {
+    /** Key comparator */
     private Comparator<V> keyComparator;
-    private Comparator<ID> valueComparator;
-    
-    public ForwardIndexComparator( Comparator<V> keyComparator, Comparator<ID> valueComparator )
+
+
+    public ForwardIndexComparator( Comparator<V> keyComparator )
     {
         this.keyComparator = keyComparator;
-        this.valueComparator = valueComparator;
     }
-    
-    public int compare( IndexEntry<V, ID> entry1, IndexEntry<V, ID> entry2 )
+
+
+    public int compare( IndexEntry<V> entry1, IndexEntry<V> entry2 )
     {
         V value1 = entry1.getValue();
         V value2 = entry2.getValue();
-        ID id1 = entry1.getId();
-        ID id2 = entry2.getId();
-        
+        UUID id1 = entry1.getId();
+        UUID id2 = entry2.getId();
+
         int result = keyComparator.compare( value1, value2 );
-        
+
         if ( result == 0 )
         {
             if ( id1 == id2 )
@@ -57,21 +59,16 @@ public class ForwardIndexComparator<V, I
             }
             else
             {
-                result = valueComparator.compare( id1, id2 );
+                result = UUIDComparator.INSTANCE.compare( id1, id2 );
             }
         }
-        
+
         return result;
     }
-    
+
+
     public Comparator<V> getValueComparator()
     {
         return keyComparator;
     }
-    
-    
-    public Comparator<ID> getIDComparator()
-    {
-        return valueComparator;
-    }
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexEntry.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexEntry.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ForwardIndexEntry.java Wed Nov  9 16:57:34 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.core.api.partition.index;
 
+import java.util.UUID;
+
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 
@@ -29,12 +31,11 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @param <V> The value stored in the Tuple, associated key for the object
- * @param <ID> The ID of the object
  */
-public class ForwardIndexEntry<V, ID> extends AbstractIndexEntry<V, ID>
+public class ForwardIndexEntry<V> extends AbstractIndexEntry<V>
 {
     /** The underlying Tuple */
-    private final Tuple<V, ID> tuple = new Tuple<V, ID>();
+    private final Tuple<V, UUID> tuple = new Tuple<V, UUID>();
 
     
     /**
@@ -54,7 +55,7 @@ public class ForwardIndexEntry<V, ID> ex
      * @param tuple the tuple for the ForwardIndexEntry
      * @param entry the resuscitated Entry if any
      */
-    public void setTuple( Tuple<V, ID> tuple, Entry entry )
+    public void setTuple( Tuple<V, UUID> tuple, Entry entry )
     {
         setEntry( entry );
         this.tuple.setKey( tuple.getKey() );
@@ -65,7 +66,7 @@ public class ForwardIndexEntry<V, ID> ex
     /**
      * {@inheritDoc}
      */
-    public ID getId()
+    public UUID getId()
     {
         return tuple.getValue();
     }
@@ -83,7 +84,7 @@ public class ForwardIndexEntry<V, ID> ex
     /**
      * {@inheritDoc}
      */
-    public void setId( ID id )
+    public void setId( UUID id )
     {
         tuple.setValue( id );
     }
@@ -101,7 +102,7 @@ public class ForwardIndexEntry<V, ID> ex
     /**
      * {@inheritDoc}
      */
-    public Tuple<V, ID> getTuple()
+    public Tuple<V, UUID> getTuple()
     {
         return tuple;
     }
@@ -121,7 +122,7 @@ public class ForwardIndexEntry<V, ID> ex
     /**
      * {@inheritDoc}
      */
-    public void copy( IndexEntry<V, ID> entry )
+    public void copy( IndexEntry<V> entry )
     {
         super.copy( entry );
         tuple.setKey( entry.getValue() );

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/GenericIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/GenericIndex.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/GenericIndex.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/GenericIndex.java Wed Nov  9 16:57:34 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import java.net.URI;
+import java.util.UUID;
 
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -32,7 +33,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class GenericIndex<K, O, ID> extends AbstractIndex<K, O, ID>
+public class GenericIndex<K> extends AbstractIndex<K>
 {
     /** Index working directory */
     protected URI wkDirPath;
@@ -76,7 +77,7 @@ public class GenericIndex<K, O, ID> exte
     }
 
 
-    public void add( K attrVal, ID id ) throws Exception
+    public void add( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -100,37 +101,37 @@ public class GenericIndex<K, O, ID> exte
     }
 
 
-    public void drop( ID id ) throws Exception
+    public void drop( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void drop( K attrVal, ID id ) throws Exception
+    public void drop( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public IndexCursor<K, O, ID> forwardCursor() throws Exception
+    public IndexCursor<K> forwardCursor() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public IndexCursor<K, O, ID> forwardCursor( K key ) throws Exception
+    public IndexCursor<K> forwardCursor( K key ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public ID forwardLookup( K attrVal ) throws Exception
+    public UUID forwardLookup( K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public Cursor<ID> forwardValueCursor( K key ) throws Exception
+    public Cursor<UUID> forwardValueCursor( K key ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -142,19 +143,19 @@ public class GenericIndex<K, O, ID> exte
     }
 
 
-    public boolean forward( K attrVal, ID id ) throws Exception
+    public boolean forward( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverse( ID id ) throws Exception
+    public boolean reverse( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverse( ID id, K attrVal ) throws Exception
+    public boolean reverse( UUID id, K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -166,19 +167,19 @@ public class GenericIndex<K, O, ID> exte
     }
 
 
-    public boolean forwardGreaterOrEq( K attrVal, ID id ) throws Exception
+    public boolean forwardGreaterOrEq( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseGreaterOrEq( ID id ) throws Exception
+    public boolean reverseGreaterOrEq( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseGreaterOrEq( ID id, K attrVal ) throws Exception
+    public boolean reverseGreaterOrEq( UUID id, K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -190,19 +191,19 @@ public class GenericIndex<K, O, ID> exte
     }
 
 
-    public boolean forwardLessOrEq( K attrVal, ID id ) throws Exception
+    public boolean forwardLessOrEq( K attrVal, UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseLessOrEq( ID id ) throws Exception
+    public boolean reverseLessOrEq( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public boolean reverseLessOrEq( ID id, K attrVal ) throws Exception
+    public boolean reverseLessOrEq( UUID id, K attrVal ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -238,36 +239,36 @@ public class GenericIndex<K, O, ID> exte
     }
 
 
-    public IndexCursor<K, O, ID> reverseCursor() throws Exception
+    public IndexCursor<K> reverseCursor() throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public IndexCursor<K, O, ID> reverseCursor( ID id ) throws Exception
+    public IndexCursor<K> reverseCursor( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public K reverseLookup( ID id ) throws Exception
+    public K reverseLookup( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public Cursor<K> reverseValueCursor( ID id ) throws Exception
+    public Cursor<K> reverseValueCursor( UUID id ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public ForwardIndexComparator<K,ID> getForwardIndexEntryComparator()
+    public ForwardIndexComparator<K> getForwardIndexEntryComparator()
     {
         throw new UnsupportedOperationException();
     }
 
-    public ReverseIndexComparator<K,ID> getReverseIndexEntryComparator()
+    public ReverseIndexComparator<K> getReverseIndexEntryComparator()
     {
         throw new UnsupportedOperationException();
     }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/Index.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/Index.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/Index.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/Index.java Wed Nov  9 16:57:34 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import java.net.URI;
+import java.util.UUID;
 
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -35,10 +36,8 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @param <K> The Indexed value type, used to retrieve an element
- * @param <O> The indexed element type, when retrieved
- * @param <ID> The unique identifier type in the master table
  */
-public interface Index<K, O, ID>
+public interface Index<K>
 {
     /** The default cache size (ie, the number of elements we stored in the cache) */
     int DEFAULT_INDEX_CACHE_SIZE = 100;
@@ -148,10 +147,10 @@ public interface Index<K, O, ID>
     int lessThanCount( K attrVal ) throws Exception;
 
 
-    ID forwardLookup( K attrVal ) throws Exception;
+    UUID forwardLookup( K attrVal ) throws Exception;
 
 
-    K reverseLookup( ID id ) throws Exception;
+    K reverseLookup( UUID id ) throws Exception;
 
 
     /**
@@ -162,7 +161,7 @@ public interface Index<K, O, ID>
      * @param id The element ID pointed by the added value
      * @throws Exception If the addition can't be done
      */
-    void add( K attrVal, ID id ) throws Exception;
+    void add( K attrVal, UUID id ) throws Exception;
 
 
     /**
@@ -192,7 +191,7 @@ public interface Index<K, O, ID>
      * @param entryId The master table entry ID to remove
      * @throws Exception
      */
-    void drop( ID entryId ) throws Exception;
+    void drop( UUID entryId ) throws Exception;
 
 
     /**
@@ -202,65 +201,65 @@ public interface Index<K, O, ID>
      * @param id The associated ID
      * @throws Exception If the removal can't be done
      */
-    void drop( K attrVal, ID id ) throws Exception;
+    void drop( K attrVal, UUID id ) throws Exception;
 
 
-    IndexCursor<K, O, ID> reverseCursor() throws Exception;
+    IndexCursor<K> reverseCursor() throws Exception;
 
 
-    IndexCursor<K, O, ID> forwardCursor() throws Exception;
+    IndexCursor<K> forwardCursor() throws Exception;
 
 
-    IndexCursor<K, O, ID> reverseCursor( ID id ) throws Exception;
+    IndexCursor<K> reverseCursor( UUID id ) throws Exception;
 
 
-    IndexCursor<K, O, ID> forwardCursor( K key ) throws Exception;
+    IndexCursor<K> forwardCursor( K key ) throws Exception;
 
 
-    Cursor<K> reverseValueCursor( ID id ) throws Exception;
+    Cursor<K> reverseValueCursor( UUID id ) throws Exception;
 
 
-    Cursor<ID> forwardValueCursor( K key ) throws Exception;
+    Cursor<UUID> forwardValueCursor( K key ) throws Exception;
 
 
     boolean forward( K attrVal ) throws Exception;
 
 
-    boolean forward( K attrVal, ID id ) throws Exception;
+    boolean forward( K attrVal, UUID id ) throws Exception;
 
 
-    boolean reverse( ID id ) throws Exception;
+    boolean reverse( UUID id ) throws Exception;
 
 
-    boolean reverse( ID id, K attrVal ) throws Exception;
+    boolean reverse( UUID id, K attrVal ) throws Exception;
 
 
     boolean forwardGreaterOrEq( K attrVal ) throws Exception;
 
 
-    boolean forwardGreaterOrEq( K attrVal, ID id ) throws Exception;
+    boolean forwardGreaterOrEq( K attrVal, UUID id ) throws Exception;
 
 
-    boolean reverseGreaterOrEq( ID id ) throws Exception;
+    boolean reverseGreaterOrEq( UUID id ) throws Exception;
 
 
-    boolean reverseGreaterOrEq( ID id, K attrVal ) throws Exception;
+    boolean reverseGreaterOrEq( UUID id, K attrVal ) throws Exception;
 
 
     boolean forwardLessOrEq( K attrVal ) throws Exception;
 
 
-    boolean forwardLessOrEq( K attrVal, ID id ) throws Exception;
+    boolean forwardLessOrEq( K attrVal, UUID id ) throws Exception;
 
 
-    boolean reverseLessOrEq( ID id ) throws Exception;
+    boolean reverseLessOrEq( UUID id ) throws Exception;
 
 
-    boolean reverseLessOrEq( ID id, K attrVal ) throws Exception;
+    boolean reverseLessOrEq( UUID id, K attrVal ) throws Exception;
 
-    public ForwardIndexComparator<K,ID> getForwardIndexEntryComparator();
+    public ForwardIndexComparator<K> getForwardIndexEntryComparator();
 
-    public ReverseIndexComparator<K,ID> getReverseIndexEntryComparator();
+    public ReverseIndexComparator<K> getReverseIndexEntryComparator();
 
     void close() throws Exception;
 

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexComparator.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexComparator.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexComparator.java Wed Nov  9 16:57:34 2011
@@ -20,11 +20,9 @@
 package org.apache.directory.server.core.api.partition.index;
 
 import java.util.Comparator;
+import java.util.UUID;
 
-public interface IndexComparator<V,ID> extends Comparator<IndexEntry<V,ID>>
+public interface IndexComparator<V> extends Comparator<IndexEntry<V>>
 {
-    public Comparator<V> getValueComparator();
-    
-    
-    public Comparator<ID> getIDComparator();
+    Comparator<V> getValueComparator();
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexCursor.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexCursor.java Wed Nov  9 16:57:34 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.core.api.partition.index;
 
 
+import java.util.UUID;
+
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 
 
@@ -29,7 +31,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface IndexCursor<V, E, ID> extends Cursor<IndexEntry<V, ID>>
+public interface IndexCursor<V> extends Cursor<IndexEntry<V>>
 {
     /**
      * An alternative to calling before(IndexEntry) which often may require
@@ -41,7 +43,7 @@ public interface IndexCursor<V, E, ID> e
      * @param indexValue the value to advance just before
      * @throws Exception if there are faults performing this operation
      */
-    void beforeValue( ID id, V indexValue ) throws Exception;
+    void beforeValue( UUID id, V indexValue ) throws Exception;
 
 
     /**
@@ -54,5 +56,5 @@ public interface IndexCursor<V, E, ID> e
      * @param indexValue the value to advance just after the last value
      * @throws Exception if there are faults performing this operation
      */
-    void afterValue( ID id, V indexValue ) throws Exception;
+    void afterValue( UUID id, V indexValue ) throws Exception;
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexEntry.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexEntry.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/IndexEntry.java Wed Nov  9 16:57:34 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.core.api.partition.index;
 
+import java.util.UUID;
+
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 
@@ -30,9 +32,8 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @param <V> The value stored in the Tuple, associated key for the object
- * @param <ID> The ID of the object
  */
-public interface IndexEntry<V, ID>
+public interface IndexEntry<V>
 {
     /**
      * Gets the value referred to by this IndexEntry.
@@ -55,7 +56,7 @@ public interface IndexEntry<V, ID>
      *
      * @return the id of the indexed Entry
      */
-    ID getId();
+    UUID getId();
 
 
     /**
@@ -63,7 +64,7 @@ public interface IndexEntry<V, ID>
      *
      * @param id the id of the indexed Entry
      */
-    void setId( ID id );
+    void setId( UUID id );
 
 
     /**
@@ -101,5 +102,5 @@ public interface IndexEntry<V, ID>
      *
      * @param entry the entry to copy fields of
      */
-    void copy( IndexEntry<V, ID> entry );
+    void copy( IndexEntry<V> entry );
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/MasterTable.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/MasterTable.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/MasterTable.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/MasterTable.java Wed Nov  9 16:57:34 2011
@@ -19,13 +19,17 @@
  */
 package org.apache.directory.server.core.api.partition.index;
 
+import java.util.UUID;
+
+import org.apache.directory.shared.ldap.model.entry.Entry;
+
 
 /**
  * A master table used to store indexable entries.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface MasterTable<ID, E> extends Table<ID, E>
+public interface MasterTable extends Table<UUID, Entry>
 {
     /** the base name for the db file for this table */
     String DBF = "master";
@@ -39,10 +43,10 @@ public interface MasterTable<ID, E> exte
      * the side-effect of incrementing the sequence values permanently.
      *
      * @param entry the entry in case the id is derived from the entry.
-     * @return the current value of this MasterTable's sequence incremented by one
-     * @throws Exception on failure to update the id sequence
+     * @return ID for the entry
+     * @throws Exception on any failure
      */
-    ID getNextId( E entry ) throws Exception;
+    UUID getNextId( Entry entry ) throws Exception;
     
     
     /**

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdn.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdn.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdn.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdn.java Wed Nov  9 16:57:34 2011
@@ -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;
@@ -60,7 +61,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;
@@ -73,7 +74,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()] );
@@ -85,7 +86,7 @@ public class ParentIdAndRdn<ID extends C
      * 
      * @return the parent ID
      */
-    public ID getParentId()
+    public UUID getParentId()
     {
         return parentId;
     }
@@ -96,7 +97,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;
     }
@@ -145,12 +146,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 )
         {
@@ -181,7 +182,7 @@ public class ParentIdAndRdn<ID extends C
     /**
      * {@inheritDoc}
      */
-    public int compareTo( ParentIdAndRdn<ID> that )
+    public int compareTo( ParentIdAndRdn that )
     {
         int val = this.rdns.length - that.rdns.length;
         
@@ -221,7 +222,7 @@ public class ParentIdAndRdn<ID extends C
     @SuppressWarnings("unchecked")
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
-        parentId = ( ID ) in.readObject();
+        parentId = ( UUID ) in.readObject();
         int size = in.readInt();
         rdns = new Rdn[size];
         

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdnComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdnComparator.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdnComparator.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ParentIdAndRdnComparator.java Wed Nov  9 16:57:34 2011
@@ -28,7 +28,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 extends SerializableComparator<ParentIdAndRdn>
 {
     /** The serial version UID */
     private static final long serialVersionUID = 2L;
@@ -48,7 +48,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-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexComparator.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexComparator.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexComparator.java Wed Nov  9 16:57:34 2011
@@ -20,27 +20,29 @@
 package org.apache.directory.server.core.api.partition.index;
 
 import java.util.Comparator;
+import java.util.UUID;
 
-public class ReverseIndexComparator<V, ID> implements IndexComparator<V,ID>
+public class ReverseIndexComparator<V> implements IndexComparator<V>
 {
-    Comparator<V> keyComparator;
-    Comparator<ID> valueComparator;
-    
-    public ReverseIndexComparator( Comparator<V> keyComparator, Comparator<ID> valueComparator )
+    /** Key comparator */
+    private Comparator<V> keyComparator;
+
+
+    public ReverseIndexComparator( Comparator<V> keyComparator )
     {
         this.keyComparator = keyComparator;
-        this.valueComparator = valueComparator;
     }
-    
-    public int compare( IndexEntry<V, ID> entry1, IndexEntry<V, ID> entry2 )
+
+
+    public int compare( IndexEntry<V> entry1, IndexEntry<V> entry2 )
     {
         V value1 = entry1.getValue();
         V value2 = entry2.getValue();
-        ID id1 = entry1.getId();
-        ID id2 = entry2.getId();
-        
-        int result = valueComparator.compare( id1, id2 );
-        
+        UUID id1 = entry1.getId();
+        UUID id2 = entry2.getId();
+
+        int result = UUIDComparator.INSTANCE.compare( id1, id2 );
+
         if ( result == 0 )
         {
             if ( value1 == value2 )
@@ -60,18 +62,13 @@ public class ReverseIndexComparator<V, I
                 result = keyComparator.compare( value1, value2 );
             }
         }
-        
+
         return result;
     }
-    
+
+
     public Comparator<V> getValueComparator()
     {
         return keyComparator;
     }
-    
-    
-    public Comparator<ID> getIDComparator()
-    {
-        return valueComparator;
-    }
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexEntry.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexEntry.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/ReverseIndexEntry.java Wed Nov  9 16:57:34 2011
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.server.core.api.partition.index;
 
+import java.util.UUID;
+
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 
@@ -31,10 +33,10 @@ import org.apache.directory.shared.ldap.
  * @param <V> The value stored in the Tuple, associated key for the Entry
  * @param <ID> The ID of the Entry
  */
-public class ReverseIndexEntry<V, ID> extends AbstractIndexEntry<V, ID>
+public class ReverseIndexEntry<V> extends AbstractIndexEntry<V>
 {
     /** The underlying Tuple */
-    private final Tuple<ID, V> tuple = new Tuple<ID, V>();
+    private final Tuple<UUID, V> tuple = new Tuple<UUID, V>();
 
 
     /**
@@ -55,7 +57,7 @@ public class ReverseIndexEntry<V, ID> ex
      * @param tuple the tuple for the ReverseIndexEntry
      * @param obj the resusitated Entry that is indexed if any
      */
-    public void setTuple( Tuple<ID, V> tuple, Entry entry )
+    public void setTuple( Tuple<UUID, V> tuple, Entry entry )
     {
         setEntry( entry );
         this.tuple.setKey( tuple.getKey() );
@@ -66,7 +68,7 @@ public class ReverseIndexEntry<V, ID> ex
     /**
      * {@inheritDoc}
      */
-    public ID getId()
+    public UUID getId()
     {
         return tuple.getKey();
     }
@@ -84,7 +86,7 @@ public class ReverseIndexEntry<V, ID> ex
     /**
      * {@inheritDoc}
      */
-    public void setId( ID id )
+    public void setId( UUID id )
     {
         tuple.setKey( id );
     }
@@ -122,7 +124,7 @@ public class ReverseIndexEntry<V, ID> ex
     /**
      * {@inheritDoc}
      */
-    public void copy( IndexEntry<V, ID> entry )
+    public void copy( IndexEntry<V> entry )
     {
         setEntry( entry.getEntry() );
         tuple.setKey( entry.getId() );

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/SingletonIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/SingletonIndexCursor.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/SingletonIndexCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/SingletonIndexCursor.java Wed Nov  9 16:57:34 2011
@@ -29,15 +29,15 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SingletonIndexCursor<V, ID> extends AbstractIndexCursor<V, Entry, ID>
+public class SingletonIndexCursor<V> extends AbstractIndexCursor<V>
 {
     private boolean beforeFirst = true;
     private boolean afterLast;
     private boolean onSingleton;
-    private final IndexEntry<V, ID> singleton;
+    private final IndexEntry<V> singleton;
 
 
-    public SingletonIndexCursor( IndexEntry<V, ID> singleton )
+    public SingletonIndexCursor( IndexEntry<V> singleton )
     {
         this.singleton = singleton;
     }
@@ -172,7 +172,7 @@ public class SingletonIndexCursor<V, ID>
     }
 
 
-    public IndexEntry<V, ID> get() throws Exception
+    public IndexEntry<V> get() throws Exception
     {
         checkNotClosed( "()" );
         

Added: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/UUIDComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/UUIDComparator.java?rev=1199843&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/UUIDComparator.java (added)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/partition/index/UUIDComparator.java Wed Nov  9 16:57:34 2011
@@ -0,0 +1,55 @@
+/*
+ *  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.core.api.partition.index;
+
+import java.util.UUID;
+
+import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.schema.comparators.SerializableComparator;
+
+public class UUIDComparator extends SerializableComparator<UUID>
+{
+    /** Cached instance */
+    public static final UUIDComparator INSTANCE = new UUIDComparator();
+
+    /** The serial version UID */
+    private static final long serialVersionUID = 2L;
+
+    public UUIDComparator()
+    {
+        super( SchemaConstants.UUID_ORDERING_MATCH_MR_OID );
+    }
+
+    public int compare( UUID uuid1, UUID uuid2 )
+    {
+        if ( uuid1 == null )
+        {
+            return ( uuid2 == null ) ? 0 : -1;
+        }
+        
+        if ( uuid2 == null )
+        {
+            return 1;
+        }
+        
+        return uuid1.compareTo( uuid2 );
+    }
+}
+

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnLogManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnLogManager.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnLogManager.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnLogManager.java Wed Nov  9 16:57:34 2011
@@ -30,12 +30,13 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchScope;
 
 import java.io.IOException;
+import java.util.UUID;
 
 /**
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface TxnLogManager<ID>
+public interface TxnLogManager
 {
     /**
      * Logs the given log edit for the txn associated with the current thread
@@ -44,7 +45,7 @@ public interface TxnLogManager<ID>
      * @param sync log edit will be flushed to media if set to true
      * @throws IOException 
      */
-    void log( LogEdit<ID> logEdit, boolean sync ) throws IOException;
+    void log( LogEdit logEdit, boolean sync ) throws IOException;
     
     
     /**
@@ -66,7 +67,7 @@ public interface TxnLogManager<ID>
      * @param entry current version of the entry the txn has
      * @return
      */
-    Entry mergeUpdates(Dn partitionDN, ID entryID,  Entry entry );
+    Entry mergeUpdates(Dn partitionDN, UUID entryID,  Entry entry );
     
     /**
      * Returns a cursor which provides a transactionally consistent view of the wrapped cursor.
@@ -81,7 +82,7 @@ public interface TxnLogManager<ID>
      * @return a cursor which provides a transactionally consistent view of the wrapped cursor 
      * @throws Exception
      */
-    IndexCursor<Object, Entry, ID> wrap( Dn partitionDn, IndexCursor<Object, Entry, ID> wrappedCursor, IndexComparator<Object,ID> comparator, String attributeOid, boolean forwardIndex, Object onlyValueKey, ID onlyIDKey ) throws Exception;
+    IndexCursor<Object> wrap( Dn partitionDn, IndexCursor<Object> wrappedCursor, IndexComparator<Object> comparator, String attributeOid, boolean forwardIndex, Object onlyValueKey, UUID onlyIDKey ) throws Exception;
     
     /**
      * Adds a dn and a scope on which the current txn depens

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnManager.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnManager.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/TxnManager.java Wed Nov  9 16:57:34 2011
@@ -53,19 +53,5 @@ public interface TxnManager<ID>
      * @throws IOException
      */
     void abortTransaction() throws IOException;
-    
-    /**
-     * Returns the id comparator used by the txn manager. 
-     *
-     * @return id comparator
-     */
-    Comparator<ID> getIDComparator();
-    
-    
-    /**
-     * Returns the id serializer used by the txn manager.
-     *
-     * @return id serializer 
-     */
-    Serializer getIDSerializer();
+  
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractDataChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractDataChange.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractDataChange.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractDataChange.java Wed Nov  9 16:57:34 2011
@@ -23,7 +23,7 @@ package org.apache.directory.server.core
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractDataChange<ID> implements DataChange<ID>
+public abstract class AbstractDataChange implements DataChange
 {
 
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractLogEdit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractLogEdit.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractLogEdit.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/AbstractLogEdit.java Wed Nov  9 16:57:34 2011
@@ -25,7 +25,7 @@ import org.apache.directory.server.core.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractLogEdit<ID> implements LogEdit<ID>
+public abstract class AbstractLogEdit implements LogEdit
 {
     /** position in the wal */
     private transient LogAnchor logAnchor = new LogAnchor();

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/DataChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/DataChange.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/DataChange.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/DataChange.java Wed Nov  9 16:57:34 2011
@@ -25,7 +25,7 @@ import java.io.Externalizable;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface DataChange<ID> extends Externalizable
+public interface DataChange extends Externalizable
 {
 
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/LogEdit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/LogEdit.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/LogEdit.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/main/java/org/apache/directory/server/core/api/txn/logedit/LogEdit.java Wed Nov  9 16:57:34 2011
@@ -27,7 +27,7 @@ import java.io.Externalizable;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface LogEdit<ID> extends Externalizable 
+public interface LogEdit extends Externalizable 
 {
     /**
      * Returns the position the edit is inserted in the wal.

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/AbstractIndexCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/AbstractIndexCursorTest.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/AbstractIndexCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/AbstractIndexCursorTest.java Wed Nov  9 16:57:34 2011
@@ -44,13 +44,13 @@ import org.junit.Test;
 public class AbstractIndexCursorTest
 {
 
-    private AbstractIndexCursor<String, Entry, Long> indexCursor;
+    private AbstractIndexCursor<String> indexCursor;
 
 
     @Before
     public void setUp()
     {
-        indexCursor = new EmptyIndexCursor<String, Entry, Long>();
+        indexCursor = new EmptyIndexCursor<String>();
     }
 
 
@@ -117,7 +117,7 @@ public class AbstractIndexCursorTest
     @Test
     public void testIterator()
     {
-        Iterator<IndexEntry<String, Long>> iterator = indexCursor.iterator();
+        Iterator<IndexEntry<String>> iterator = indexCursor.iterator();
         assertNotNull( iterator );
     }
 

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/EmptyIndexCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/EmptyIndexCursorTest.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/EmptyIndexCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/EmptyIndexCursorTest.java Wed Nov  9 16:57:34 2011
@@ -22,6 +22,8 @@ package org.apache.directory.server.core
 
 import static junit.framework.Assert.assertFalse;
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.api.partition.index.EmptyIndexCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -37,20 +39,20 @@ import org.junit.Test;
 public class EmptyIndexCursorTest
 {
 
-    private EmptyIndexCursor<String, Entry, Long> indexCursor;
+    private EmptyIndexCursor<String> indexCursor;
 
 
     @Before
     public void setUp()
     {
-        indexCursor = new EmptyIndexCursor<String, Entry, Long>();
+        indexCursor = new EmptyIndexCursor<String>();
     }
 
 
     @Test
     public void testConstructor()
     {
-        new EmptyIndexCursor<String, Entry, Long>();
+        new EmptyIndexCursor<String>();
     }
 
 
@@ -170,7 +172,7 @@ public class EmptyIndexCursorTest
     @Test
     public void testBeforeValue() throws Exception
     {
-        indexCursor.beforeValue( 1L, "test" );
+        indexCursor.beforeValue( UUID.fromString( "00000000-0000-0000-0000-000000000000" ), "test" );
     }
 
 
@@ -184,7 +186,7 @@ public class EmptyIndexCursorTest
     @Test
     public void testAfterValue() throws Exception
     {
-        indexCursor.afterValue( 1L, "test" );
+        indexCursor.afterValue( UUID.fromString( "00000000-0000-0000-0000-000000000000" ), "test" );
     }
 
 

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ForwardIndexEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ForwardIndexEntryTest.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ForwardIndexEntryTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ForwardIndexEntryTest.java Wed Nov  9 16:57:34 2011
@@ -25,6 +25,8 @@ import static junit.framework.Assert.ass
 import static junit.framework.Assert.assertNull;
 import static junit.framework.Assert.assertTrue;
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
@@ -40,13 +42,13 @@ import org.junit.Test;
 public class ForwardIndexEntryTest
 {
 
-    private ForwardIndexEntry<String, Long> indexEntry;
+    private ForwardIndexEntry<String> indexEntry;
 
 
     @Before
     public void setUp()
     {
-        indexEntry = new ForwardIndexEntry<String, Long>();
+        indexEntry = new ForwardIndexEntry<String>();
     }
 
 
@@ -55,8 +57,8 @@ public class ForwardIndexEntryTest
     {
         assertNull( indexEntry.getId() );
 
-        indexEntry.setId( 1L );
-        assertEquals( Long.valueOf( 1L ), indexEntry.getId() );
+        indexEntry.setId( UUID.fromString( "00000000-0000-0000-0000-000000000001" ) );
+        assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), indexEntry.getId() );
     }
 
 
@@ -87,8 +89,8 @@ public class ForwardIndexEntryTest
         assertNull( indexEntry.getTuple().getKey() );
         assertNull( indexEntry.getTuple().getValue() );
 
-        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ), new DefaultEntry() );
-        assertEquals( new Tuple<String, Long>( "a", 1L ), indexEntry.getTuple() );
+        indexEntry.setTuple( new Tuple<String, UUID>( "a", UUID.fromString( "00000000-0000-0000-0000-000000000001" ) ), new DefaultEntry() );
+        assertEquals( new Tuple<String, UUID>( "a", UUID.fromString( "00000000-0000-0000-0000-000000000001" ) ), indexEntry.getTuple() );
         assertEquals( new DefaultEntry(), indexEntry.getEntry() );
     }
 
@@ -96,7 +98,7 @@ public class ForwardIndexEntryTest
     @Test
     public void testClear()
     {
-        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ), new DefaultEntry() );
+        indexEntry.setTuple( new Tuple<String, UUID>( "a", UUID.fromString( "00000000-0000-0000-0000-000000000001" ) ), new DefaultEntry() );
         indexEntry.clear();
 
         assertNull( indexEntry.getId() );
@@ -112,10 +114,10 @@ public class ForwardIndexEntryTest
     public void testCopy()
     {
         // prepare index entry
-        indexEntry.setTuple( new Tuple<String, Long>( "a", 1L ), new DefaultEntry() );
+        indexEntry.setTuple( new Tuple<String, UUID>( "a", UUID.fromString( "00000000-0000-0000-0000-000000000001" ) ), new DefaultEntry() );
 
         // create empty index entry and assert empty values
-        ForwardIndexEntry<String, Long> indexEntry2 = new ForwardIndexEntry<String, Long>();
+        ForwardIndexEntry<String> indexEntry2 = new ForwardIndexEntry<String>();
         assertNull( indexEntry2.getId() );
         assertNull( indexEntry2.getValue() );
         assertNull( indexEntry2.getEntry() );
@@ -125,19 +127,19 @@ public class ForwardIndexEntryTest
 
         // copy values and assert non-empty values
         indexEntry2.copy( indexEntry );
-        assertEquals( Long.valueOf( 1L ), indexEntry2.getId() );
+        assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), indexEntry2.getId() );
         assertEquals( "a", indexEntry2.getValue() );
         assertEquals( new DefaultEntry(), indexEntry2.getEntry() );
-        assertEquals( new Tuple<String, Long>( "a", 1L ), indexEntry2.getTuple() );
+        assertEquals( new Tuple<String, UUID>( "a", UUID.fromString( "00000000-0000-0000-0000-000000000001" ) ), indexEntry2.getTuple() );
     }
 
 
     @Test
     public void testToString()
     {
-        indexEntry.setTuple( new Tuple<String, Long>( "asdfghjkl", 1234567890L ), new DefaultEntry() );
+        indexEntry.setTuple( new Tuple<String, UUID>( "asdfghjkl", UUID.fromString( "00000000-0000-0000-0000-000000054321" ) ), new DefaultEntry() );
         assertTrue( indexEntry.toString().contains( "asdfghjkl" ) );
-        assertTrue( indexEntry.toString().contains( "1234567890" ) );
+        assertTrue( indexEntry.toString().contains( "54321" ) );
     }
 
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/GenericIndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/GenericIndexTest.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/GenericIndexTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/GenericIndexTest.java Wed Nov  9 16:57:34 2011
@@ -26,6 +26,7 @@ import static junit.framework.Assert.ass
 import static org.junit.Assert.assertFalse;
 
 import java.io.File;
+import java.util.UUID;
 
 import org.apache.directory.server.core.api.partition.index.GenericIndex;
 import org.junit.Before;
@@ -40,21 +41,21 @@ import org.junit.Test;
 public class GenericIndexTest
 {
 
-    GenericIndex<String, Long, Long> index;
+    GenericIndex<String> index;
 
 
     @Before
     public void setUp()
     {
         String tmpDir = System.getProperty( "java.io.tmpdir" );
-        index = new GenericIndex<String, Long, Long>( "cn", 42, new File( tmpDir ).toURI() );
+        index = new GenericIndex<String>( "cn", 42, new File( tmpDir ).toURI() );
     }
 
 
     @Test
     public void testConstructor1()
     {
-        index = new GenericIndex<String, Long, Long>( "cn" );
+        index = new GenericIndex<String>( "cn" );
         assertEquals( "cn", index.getAttributeId() );
         assertEquals( GenericIndex.DEFAULT_INDEX_CACHE_SIZE, index.getCacheSize() );
         assertNull( index.getWkDirPath() );
@@ -64,7 +65,7 @@ public class GenericIndexTest
     @Test
     public void testConstructor2()
     {
-        index = new GenericIndex<String, Long, Long>( "cn", 42 );
+        index = new GenericIndex<String>( "cn", 42 );
         assertEquals( "cn", index.getAttributeId() );
         assertEquals( 42, index.getCacheSize() );
         assertNull( index.getWkDirPath() );
@@ -76,7 +77,7 @@ public class GenericIndexTest
     {
         File tmpDir = new File(System.getProperty( "java.io.tmpdir" ));
 
-        index = new GenericIndex<String, Long, Long>( "cn", 42, tmpDir.toURI() );
+        index = new GenericIndex<String>( "cn", 42, tmpDir.toURI() );
         assertEquals( "cn", index.getAttributeId() );
         assertEquals( 42, index.getCacheSize() );
         assertNotNull( index.getWkDirPath() );
@@ -123,7 +124,7 @@ public class GenericIndexTest
     @Test(expected = UnsupportedOperationException.class)
     public void testAdd() throws Exception
     {
-        index.add( "test", 5L );
+        index.add( "test", UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
@@ -151,14 +152,14 @@ public class GenericIndexTest
     @Test(expected = UnsupportedOperationException.class)
     public void testDropID() throws Exception
     {
-        index.drop( 5L );
+        index.drop( UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testDropKID() throws Exception
     {
-        index.drop( "test", 5L );
+        index.drop( "test", UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
@@ -200,21 +201,21 @@ public class GenericIndexTest
     @Test(expected = UnsupportedOperationException.class)
     public void testForwardKID() throws Exception
     {
-        index.forward( "test", 5L );
+        index.forward( "test", UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseID() throws Exception
     {
-        index.reverse( 5L );
+        index.reverse( UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseIDK() throws Exception
     {
-        index.reverse( 5L, "test" );
+        index.reverse( UUID.fromString( "00000000-0000-0000-0000-000000000005" ), "test" );
     }
 
 
@@ -228,21 +229,21 @@ public class GenericIndexTest
     @Test(expected = UnsupportedOperationException.class)
     public void testForwardGreaterOrEqKID() throws Exception
     {
-        index.forwardGreaterOrEq( "test", 5L );
+        index.forwardGreaterOrEq( "test", UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseGreaterOrEqID() throws Exception
     {
-        index.reverseGreaterOrEq( 5L );
+        index.reverseGreaterOrEq( UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseGreaterOrEqIDK() throws Exception
     {
-        index.reverseGreaterOrEq( 5L, "test" );
+        index.reverseGreaterOrEq( UUID.fromString( "00000000-0000-0000-0000-000000000005" ), "test" );
     }
 
 
@@ -256,21 +257,21 @@ public class GenericIndexTest
     @Test(expected = UnsupportedOperationException.class)
     public void testForwardLessOrEqKID() throws Exception
     {
-        index.forwardLessOrEq( "test", 5L );
+        index.forwardLessOrEq( "test", UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseLessOrEqID() throws Exception
     {
-        index.reverseLessOrEq( 5L );
+        index.reverseLessOrEq( UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseLessOrEqIDK() throws Exception
     {
-        index.reverseLessOrEq( 5L, "test" );
+        index.reverseLessOrEq( UUID.fromString( "00000000-0000-0000-0000-000000000005" ), "test" );
     }
 
 
@@ -312,21 +313,21 @@ public class GenericIndexTest
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseCursorID() throws Exception
     {
-        index.reverseCursor( 5L );
+        index.reverseCursor( UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseLookup() throws Exception
     {
-        index.reverseLookup( 5L );
+        index.reverseLookup( UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 
     @Test(expected = UnsupportedOperationException.class)
     public void testReverseValueCursor() throws Exception
     {
-        index.reverseValueCursor( 5L );
+        index.reverseValueCursor( UUID.fromString( "00000000-0000-0000-0000-000000000005" ) );
     }
 
 

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ReverseIndexEntryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ReverseIndexEntryTest.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ReverseIndexEntryTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/ReverseIndexEntryTest.java Wed Nov  9 16:57:34 2011
@@ -25,6 +25,8 @@ import static junit.framework.Assert.ass
 import static junit.framework.Assert.assertNull;
 import static junit.framework.Assert.assertTrue;
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.api.partition.index.ReverseIndexEntry;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
@@ -40,13 +42,13 @@ import org.junit.Test;
 public class ReverseIndexEntryTest
 {
 
-    private ReverseIndexEntry<String, Long> indexEntry;
+    private ReverseIndexEntry<String> indexEntry;
 
 
     @Before
     public void setUp()
     {
-        indexEntry = new ReverseIndexEntry<String, Long>();
+        indexEntry = new ReverseIndexEntry<String>();
     }
 
 
@@ -55,8 +57,8 @@ public class ReverseIndexEntryTest
     {
         assertNull( indexEntry.getId() );
 
-        indexEntry.setId( 1L );
-        assertEquals( Long.valueOf( 1L ), indexEntry.getId() );
+        indexEntry.setId( UUID.fromString( "00000000-0000-0000-0000-000000000001" ) );
+        assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), indexEntry.getId() );
     }
 
 
@@ -87,8 +89,8 @@ public class ReverseIndexEntryTest
         assertNull( indexEntry.getTuple().getKey() );
         assertNull( indexEntry.getTuple().getValue() );
 
-        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ), new DefaultEntry() );
-        assertEquals( new Tuple<Long, String>( 1L, "a" ), indexEntry.getTuple() );
+        indexEntry.setTuple( new Tuple<UUID, String>( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), "a" ), new DefaultEntry() );
+        assertEquals( new Tuple<UUID, String>( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), "a" ), indexEntry.getTuple() );
         assertEquals( new DefaultEntry(), indexEntry.getEntry() );
     }
 
@@ -96,7 +98,7 @@ public class ReverseIndexEntryTest
     @Test
     public void testClear()
     {
-        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ), new DefaultEntry() );
+        indexEntry.setTuple( new Tuple<UUID, String>( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), "a" ), new DefaultEntry() );
         indexEntry.clear();
 
         assertNull( indexEntry.getId() );
@@ -112,10 +114,10 @@ public class ReverseIndexEntryTest
     public void testCopy()
     {
         // prepare index entry
-        indexEntry.setTuple( new Tuple<Long, String>( 1L, "a" ), new DefaultEntry() );
+        indexEntry.setTuple( new Tuple<UUID, String>( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), "a" ), new DefaultEntry() );
 
         // create empty index entry and assert empty values
-        ReverseIndexEntry<String, Long> indexEntry2 = new ReverseIndexEntry<String, Long>();
+        ReverseIndexEntry<String> indexEntry2 = new ReverseIndexEntry<String>();
         assertNull( indexEntry2.getId() );
         assertNull( indexEntry2.getValue() );
         assertNull( indexEntry2.getEntry() );
@@ -125,19 +127,19 @@ public class ReverseIndexEntryTest
 
         // copy values and assert non-empty values
         indexEntry2.copy( indexEntry );
-        assertEquals( Long.valueOf( 1L ), indexEntry2.getId() );
+        assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), indexEntry2.getId() );
         assertEquals( "a", indexEntry2.getValue() );
         assertEquals( new DefaultEntry(), indexEntry2.getEntry() );
-        assertEquals( new Tuple<Long, String>( 1L, "a" ), indexEntry2.getTuple() );
+        assertEquals( new Tuple<UUID, String>( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), "a" ), indexEntry2.getTuple() );
     }
 
 
     @Test
     public void testToString()
     {
-        indexEntry.setTuple( new Tuple<Long, String>( 1234567890L, "asdfghjkl" ), new DefaultEntry() );
+        indexEntry.setTuple( new Tuple<UUID, String>( UUID.fromString( "00000000-0000-0000-0000-000000054321" ), "asdfghjkl" ), new DefaultEntry() );
         assertTrue( indexEntry.toString().contains( "asdfghjkl" ) );
-        assertTrue( indexEntry.toString().contains( "1234567890" ) );
+        assertTrue( indexEntry.toString().contains( "54321" ) );
     }
 
 }

Modified: directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/SingletonIndexCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/SingletonIndexCursorTest.java?rev=1199843&r1=1199842&r2=1199843&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/SingletonIndexCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-api/src/test/java/org/apache/directory/server/core/partition/index/SingletonIndexCursorTest.java Wed Nov  9 16:57:34 2011
@@ -24,6 +24,8 @@ import static junit.framework.Assert.ass
 import static junit.framework.Assert.assertNotNull;
 import static junit.framework.Assert.assertTrue;
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
 import org.apache.directory.server.core.api.partition.index.SingletonIndexCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -40,25 +42,25 @@ import org.junit.Test;
 public class SingletonIndexCursorTest
 {
 
-    private ForwardIndexEntry<String, Long> indexEntry;
-    private SingletonIndexCursor<String, Long> indexCursor;
+    private ForwardIndexEntry<String> indexEntry;
+    private SingletonIndexCursor<String> indexCursor;
 
 
     @Before
     public void setUp()
     {
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 1L );
+        indexEntry = new ForwardIndexEntry<String>();
+        indexEntry.setId( UUID.fromString( "00000000-0000-0000-0000-000000000001" ) );
         indexEntry.setEntry( new DefaultEntry() );
         indexEntry.setValue( "test" );
-        indexCursor = new SingletonIndexCursor<String, Long>( indexEntry );
+        indexCursor = new SingletonIndexCursor<String>( indexEntry );
     }
 
 
     @Test
     public void testConstructor()
     {
-        new SingletonIndexCursor<String, Long>( indexEntry );
+        new SingletonIndexCursor<String>( indexEntry );
     }
 
 
@@ -234,7 +236,7 @@ public class SingletonIndexCursorTest
     @Test(expected = UnsupportedOperationException.class)
     public void testBeforeValue() throws Exception
     {
-        indexCursor.beforeValue( 1L, "test" );
+        indexCursor.beforeValue( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), "test" );
     }
 
 
@@ -248,7 +250,7 @@ public class SingletonIndexCursorTest
     @Test(expected = UnsupportedOperationException.class)
     public void testAfterValue() throws Exception
     {
-        indexCursor.afterValue( 1L, "test" );
+        indexCursor.afterValue( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), "test" );
     }
 
 }



Mime
View raw message