directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1199875 [2/3] - in /directory/apacheds/branches/apacheds-txns: core-annotations/src/main/java/org/apache/directory/server/core/factory/ core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ core-shared/src/main/java/org/ap...
Date Wed, 09 Nov 2011 17:18:54 GMT
Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnIndexCursor.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnIndexCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnIndexCursor.java Wed Nov  9 17:18:53 2011
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
 import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
 import org.apache.directory.server.core.api.partition.index.IndexComparator;
 import org.apache.directory.server.core.api.partition.index.IndexEntry;
+import org.apache.directory.server.core.api.partition.index.UUIDComparator;
 
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
 import org.apache.directory.server.i18n.I18n;
@@ -31,6 +32,7 @@ import org.apache.directory.shared.ldap.
 
 import java.util.Iterator;
 import java.util.NavigableSet;
+import java.util.UUID;
 
 
 /**
@@ -38,10 +40,10 @@ import java.util.NavigableSet;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class TxnIndexCursor<ID> extends AbstractIndexCursor<Object, Entry, ID>
+public class TxnIndexCursor extends AbstractIndexCursor<Object>
 {
     /** list of changed index entries */
-    private NavigableSet<IndexEntry<Object, ID>> changedEntries;
+    private NavigableSet<IndexEntry<Object>> changedEntries;
 
     /** forward or reverse index */
     private boolean forwardIndex;
@@ -53,10 +55,10 @@ public class TxnIndexCursor<ID> extends 
     private boolean movingNext = true;
 
     /** Iterator to move over the set */
-    private Iterator<IndexEntry<Object, ID>> it;
+    private Iterator<IndexEntry<Object>> it;
 
     /** currently available value */
-    private IndexEntry<Object, ID> availableValue;
+    private IndexEntry<Object> availableValue;
 
     /** unsupported operation message */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_722 );
@@ -71,18 +73,18 @@ public class TxnIndexCursor<ID> extends 
     private Object onlyValueKey;
 
     /** Lock down key in case of reverse index */
-    private ID onlyIDKey;
+    private UUID onlyIDKey;
 
     /** index entry comparator */
-    private IndexComparator<Object, ID> comparator;
+    private IndexComparator<Object> comparator;
 
 
-    public TxnIndexCursor( NavigableSet<IndexEntry<Object, ID>> changedEntries, boolean forwardIndex,
-        Object onlyValueKey, ID onlyIDKey, IndexComparator<?, ID> comparator )
+    public TxnIndexCursor( NavigableSet<IndexEntry<Object>> changedEntries, boolean forwardIndex,
+        Object onlyValueKey, UUID onlyIDKey, IndexComparator<Object> comparator )
     {
         this.changedEntries = changedEntries;
         this.forwardIndex = forwardIndex;
-        this.comparator = ( IndexComparator<Object, ID> ) comparator;
+        this.comparator = comparator;
 
         if ( onlyValueKey != null )
         {
@@ -100,7 +102,7 @@ public class TxnIndexCursor<ID> extends 
     /**
      * {@inheritDoc}
      */
-    public void after( IndexEntry<Object, ID> element ) throws Exception
+    public void after( IndexEntry<Object> element ) throws Exception
     {
         availableValue = null;
 
@@ -116,7 +118,7 @@ public class TxnIndexCursor<ID> extends 
             }
             else
             {
-                if ( comparator.getIDComparator().compare( element.getId(), onlyIDKey ) != 0 )
+                if ( UUIDComparator.INSTANCE.compare( element.getId(), onlyIDKey ) != 0 )
                 {
                     throw new UnsupportedOperationException( I18n.err( I18n.ERR_446 ) );
                 }
@@ -157,7 +159,7 @@ public class TxnIndexCursor<ID> extends 
             it = changedEntries.tailSet( element, false ).iterator();
 
             boolean useLastEntry = false;
-            IndexEntry<Object, ID> indexEntry = null;
+            IndexEntry<Object> indexEntry = null;
 
             while ( it.hasNext() )
             {
@@ -173,7 +175,7 @@ public class TxnIndexCursor<ID> extends 
                 }
                 else
                 {
-                    if ( comparator.getIDComparator().compare( indexEntry.getId(), element.getId() ) != 0 )
+                    if ( UUIDComparator.INSTANCE.compare( indexEntry.getId(), element.getId() ) != 0 )
                     {
                         useLastEntry = true;
                         break;
@@ -204,7 +206,7 @@ public class TxnIndexCursor<ID> extends 
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<Object, ID> element ) throws Exception
+    public void before( IndexEntry<Object> element ) throws Exception
     {
         availableValue = null;
 
@@ -220,7 +222,7 @@ public class TxnIndexCursor<ID> extends 
             }
             else
             {
-                if ( comparator.getIDComparator().compare( element.getId(), onlyIDKey ) != 0 )
+                if ( UUIDComparator.INSTANCE.compare( element.getId(), onlyIDKey ) != 0 )
                 {
                     throw new UnsupportedOperationException( I18n.err( I18n.ERR_446 ) );
                 }
@@ -243,9 +245,9 @@ public class TxnIndexCursor<ID> extends 
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID id, Object value ) throws Exception
+    public void afterValue( UUID id, Object value ) throws Exception
     {
-        ForwardIndexEntry<Object, ID> indexEntry = new ForwardIndexEntry<Object, ID>();
+        ForwardIndexEntry<Object> indexEntry = new ForwardIndexEntry<Object>();
         indexEntry.setId( id );
         indexEntry.setValue( value );
         after( indexEntry );
@@ -255,9 +257,9 @@ public class TxnIndexCursor<ID> extends 
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, Object value ) throws Exception
+    public void beforeValue( UUID id, Object value ) throws Exception
     {
-        ForwardIndexEntry<Object, ID> indexEntry = new ForwardIndexEntry<Object, ID>();
+        ForwardIndexEntry<Object> indexEntry = new ForwardIndexEntry<Object>();
         indexEntry.setId( id );
         indexEntry.setValue( value );
         before( indexEntry );
@@ -277,7 +279,7 @@ public class TxnIndexCursor<ID> extends 
         if ( onlyKey )
         {
             // If locked down by a key, position the iterator on the first value for the given key. 
-            ForwardIndexEntry<Object, ID> indexEntry = new ForwardIndexEntry<Object, ID>();
+            ForwardIndexEntry<Object> indexEntry = new ForwardIndexEntry<Object>();
 
             if ( forwardIndex )
             {
@@ -314,7 +316,7 @@ public class TxnIndexCursor<ID> extends 
              * If we are locked down by only key, then position the iterator right past the key.
              */
 
-            IndexEntry<Object, ID> indexEntry = new ForwardIndexEntry<Object, ID>();
+            IndexEntry<Object> indexEntry = new ForwardIndexEntry<Object>();
 
             if ( forwardIndex )
             {
@@ -343,7 +345,7 @@ public class TxnIndexCursor<ID> extends 
                 }
                 else
                 {
-                    if ( comparator.getIDComparator().compare( indexEntry.getId(), onlyIDKey ) != 0 )
+                    if ( UUIDComparator.INSTANCE.compare( indexEntry.getId(), onlyIDKey ) != 0 )
                     {
                         useLastEntry = true;
                         break;
@@ -452,7 +454,7 @@ public class TxnIndexCursor<ID> extends 
                 }
                 else
                 {
-                    if ( comparator.getIDComparator().compare( availableValue.getId(), onlyIDKey ) != 0 )
+                    if ( UUIDComparator.INSTANCE.compare( availableValue.getId(), onlyIDKey ) != 0 )
                     {
                         pastOnlyKey = true;
 
@@ -535,7 +537,7 @@ public class TxnIndexCursor<ID> extends 
                 }
                 else
                 {
-                    if ( comparator.getIDComparator().compare( availableValue.getId(), onlyIDKey ) != 0 )
+                    if ( UUIDComparator.INSTANCE.compare( availableValue.getId(), onlyIDKey ) != 0 )
                     {
                         pastOnlyKey = true;
 
@@ -558,7 +560,7 @@ public class TxnIndexCursor<ID> extends 
     /**
      * {@inheritDoc}
      */
-    public IndexEntry<Object, ID> get() throws Exception
+    public IndexEntry<Object> get() throws Exception
     {
         if ( availableValue != null && !pastOnlyKey )
         {

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java Wed Nov  9 17:18:53 2011
@@ -38,10 +38,10 @@ import java.io.IOException;
 public class TxnManagerFactory
 {
     /** The only txn manager */
-    private static TxnManagerInternal<?> txnManager;
+    private static TxnManagerInternal txnManager;
 
     /** The only txn log manager */
-    private static TxnLogManager<?> txnLogManager;
+    private static TxnLogManager txnLogManager;
 
     /** log suffix */
     private static String LOG_SUFFIX = "log";
@@ -51,15 +51,12 @@ public class TxnManagerFactory
      * 
      * Initializes the txn managemenet layer. It creates the only instances of txn manager and txn log manager. 
      *
-     * @param idComparator comparator for the ID type.
-     * @param idSerializer seriazlier for the ID type.
      * @param logFolderPath log folder path for the log manager.
      * @param logBufferSize in memory buffer size for the log manager.
      * @param logFileSize max targer log file size for the log manager.
      * @throws IOException thrown if initialization fails.
      */
-    @SuppressWarnings("unchecked")
-    public static <ID> void init( Comparator<ID> idComparator, Serializer idSerializer, String logFolderPath,
+    public static void init( String logFolderPath,
         int logBufferSize, long logFileSize ) throws IOException
     {
         Log log = new DefaultLog();
@@ -73,37 +70,30 @@ public class TxnManagerFactory
             throw new IOException( e );
         }
 
-        DefaultTxnManager<ID> dTxnManager;
-        dTxnManager = new DefaultTxnManager<ID>();
-        txnManager = dTxnManager;
-
-        DefaultTxnLogManager<ID> dTxnLogManager;
-        dTxnLogManager = new DefaultTxnLogManager<ID>();
-        txnLogManager = dTxnLogManager;
-        dTxnLogManager.init( log, ( TxnManagerInternal<ID> ) txnManager );
+        txnManager = new DefaultTxnManager();
 
-        dTxnManager.init( dTxnLogManager, idComparator, idSerializer );
-
-    }
+        txnLogManager = new DefaultTxnLogManager();
+        ( ( DefaultTxnLogManager )txnLogManager ).init( log, ( TxnManagerInternal ) txnManager );
 
+        ( ( DefaultTxnManager ) txnManager ).init( txnLogManager );
 
-    @SuppressWarnings("unchecked")
-    public static <ID> TxnManager<ID> txnManagerInstance()
+    }
+    
+    
+    public static TxnManager txnManagerInstance()
     {
-        return ( ( TxnManager<ID> ) txnManager );
+        return txnManager;
     }
 
 
-    @SuppressWarnings("unchecked")
-    public static <ID> TxnLogManager<ID> txnLogManagerInstance()
+    public static TxnLogManager txnLogManagerInstance()
     {
-        return ( ( TxnLogManager<ID> ) txnLogManager );
+        return txnLogManager;
     }
 
 
-    @SuppressWarnings("unchecked")
-    static <ID> TxnManagerInternal<ID> txnManagerInternalInstance()
+    static TxnManagerInternal txnManagerInternalInstance()
     {
-        return ( ( TxnManagerInternal<ID> ) txnManager );
+        return txnManager;
     }
 }

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerInternal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerInternal.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerInternal.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerInternal.java Wed Nov  9 17:18:53 2011
@@ -25,12 +25,12 @@ import org.apache.directory.server.core.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-/** Package protected */ interface TxnManagerInternal<ID> extends TxnManager<ID>
+/** Package protected */ interface TxnManagerInternal extends TxnManager
 {
     /**
      * Returns the current txn associated with the current thread.
      *
      * @return current txn
      */
-    Transaction<ID> getCurTxn();
+    Transaction getCurTxn();
 }

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java Wed Nov  9 17:18:53 2011
@@ -27,6 +27,7 @@ import java.io.ObjectOutput;
 import java.util.List;
 import java.util.LinkedList;
 import java.util.Iterator;
+import java.util.UUID;
 
 import org.apache.directory.shared.ldap.model.name.Dn;
 
@@ -44,10 +45,10 @@ import org.apache.directory.server.core.
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DataChangeContainer<ID> extends AbstractLogEdit<ID>
+public class DataChangeContainer extends AbstractLogEdit
 {
     /** id of the entry if the container contains a change for an entry */
-    private ID entryID;
+    private UUID entryID;
 
     /** Transaction under which the change is done */
     private long txnID;
@@ -56,7 +57,7 @@ public class DataChangeContainer<ID> ext
     private Dn partitionDn;
 
     /** List of data changes */
-    private List<DataChange<ID>> changes = new LinkedList<DataChange<ID>>();
+    private List<DataChange> changes = new LinkedList<DataChange>();
 
 
     //For externalizable
@@ -90,19 +91,19 @@ public class DataChangeContainer<ID> ext
     }
 
 
-    public ID getEntryID()
+    public UUID getEntryID()
     {
         return entryID;
     }
 
 
-    public void setEntryID( ID id )
+    public void setEntryID( UUID id )
     {
         entryID = id;
     }
 
 
-    public List<DataChange<ID>> getChanges()
+    public List<DataChange> getChanges()
     {
         return changes;
     }
@@ -111,31 +112,29 @@ public class DataChangeContainer<ID> ext
     @Override
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
-        Serializer idSerializer = TxnManagerFactory.txnManagerInstance().getIDSerializer();
-        int len = in.readInt();
-
-        if ( len < 0 )
+        
+        boolean hasID = in.readBoolean();
+        
+        if ( hasID )
         {
-            entryID = null;
+            entryID = UUID.fromString( in.readUTF() );
         }
         else
         {
-            byte[] buf = new byte[len];
-            in.readFully( buf );
-            entryID = ( ID ) idSerializer.deserialize( buf );
+            entryID = null;
         }
-
+        
         txnID = in.readLong();
 
         partitionDn = new Dn();
         partitionDn.readExternal( in );
 
-        DataChange<ID> change;
+        DataChange change;
         int numChanges = in.readInt();
 
         for ( int idx = 0; idx < numChanges; idx++ )
         {
-            change = ( DataChange<ID> ) in.readObject();
+            change = ( DataChange ) in.readObject();
             changes.add( change );
         }
     }
@@ -144,27 +143,25 @@ public class DataChangeContainer<ID> ext
     @Override
     public void writeExternal( ObjectOutput out ) throws IOException
     {
-        Serializer idSerializer = TxnManagerFactory.txnManagerInstance().getIDSerializer();
-        DataChange<ID> change;
+        DataChange change;
         
-        if ( entryID == null )
+        if ( entryID != null )
         {
-            out.writeInt( -1 );
+            out.writeBoolean( true );
+            out.writeUTF( entryID.toString() );
         }
         else
         {
-            byte[] buf = idSerializer.serialize( entryID );
-            out.writeInt( buf.length );
-            out.write( buf );
+            out.writeBoolean( false );
         }
-
+        
         out.writeLong( txnID );
 
         partitionDn.writeExternal( out );
 
         out.writeInt( changes.size() );
 
-        Iterator<DataChange<ID>> it = changes.iterator();
+        Iterator<DataChange> it = changes.iterator();
 
         while ( it.hasNext() )
         {

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java Wed Nov  9 17:18:53 2011
@@ -31,7 +31,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EntryAddDelete<ID> extends AbstractDataChange<ID>
+public class EntryAddDelete extends AbstractDataChange
 {
     /** Added or deleted entry */
     private Entry entry;

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryChange.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryChange.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryChange.java Wed Nov  9 17:18:53 2011
@@ -31,7 +31,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EntryChange<ID> extends AbstractDataChange<ID>
+public class EntryChange extends AbstractDataChange
 {
     /** redo change */
     private Modification redoChange;
@@ -67,11 +67,9 @@ public class EntryChange<ID> extends Abs
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
         redoChange = new DefaultModification();
-        
         redoChange.readExternal( in );
         
         undoChange = new DefaultModification();
-        
         undoChange.readExternal( in );
         
     }

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/IndexChange.java Wed Nov  9 17:18:53 2011
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import java.util.UUID;
 
 import org.apache.directory.server.core.api.partition.index.Index;
 import org.apache.directory.server.core.api.partition.index.Serializer;
@@ -36,10 +37,10 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class IndexChange<ID> extends AbstractDataChange<ID>
+public class IndexChange extends AbstractDataChange
 {
     /** Index this change is done on */
-    private transient Index<?, ?, ID> index;
+    private transient Index<?> index;
 
     /** oid of the attribute the index is on */
     private String oid;
@@ -47,8 +48,8 @@ public class IndexChange<ID> extends Abs
     /** key of the forward index */
     private Object key;
 
-    /** if for the index */
-    private ID id;
+    /** id for the index */
+    private UUID id;
 
     /** Change type */
     Type type;
@@ -60,7 +61,7 @@ public class IndexChange<ID> extends Abs
     }
 
 
-    public IndexChange( Index<?, ?, ID> index, String oid, Object key, ID id, Type type )
+    public IndexChange( Index<?> index, String oid, Object key, UUID id, Type type )
     {
         this.index = index;
         this.oid = oid;
@@ -76,7 +77,7 @@ public class IndexChange<ID> extends Abs
     }
 
 
-    public Index<?, ?, ID> getIndex()
+    public Index<?> getIndex()
     {
         return index;
     }
@@ -88,7 +89,7 @@ public class IndexChange<ID> extends Abs
     }
 
 
-    public ID getID()
+    public UUID getID()
     {
         return id;
     }
@@ -104,16 +105,9 @@ public class IndexChange<ID> extends Abs
     @SuppressWarnings("unchecked")
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
-        Serializer idSerializer = TxnManagerFactory.txnManagerInstance().getIDSerializer();
-
         oid = in.readUTF();
-        key = ( Value<?> ) in.readObject();
-
-        int len = in.readInt();
-        byte[] buf = new byte[len];
-        in.readFully( buf );
-        id = ( ID ) idSerializer.deserialize( buf );
-
+        key = in.readObject();
+        id = UUID.fromString( in.readUTF() );
         type = Type.values()[in.readInt()];
     }
 
@@ -121,15 +115,9 @@ public class IndexChange<ID> extends Abs
     @Override
     public void writeExternal( ObjectOutput out ) throws IOException
     {
-        Serializer idSerializer = TxnManagerFactory.txnManagerInstance().getIDSerializer();
-
         out.writeUTF( oid );
         out.writeObject( key );
-
-        byte[] buf = idSerializer.serialize( id );
-        out.writeInt( buf.length );
-        out.write( buf );
-
+        out.writeUTF( id.toString() );
         out.writeInt( type.ordinal() );
     }
 

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/TxnStateChange.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/TxnStateChange.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/TxnStateChange.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/TxnStateChange.java Wed Nov  9 17:18:53 2011
@@ -29,7 +29,7 @@ import org.apache.directory.server.core.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class TxnStateChange<ID> extends AbstractLogEdit<ID>
+public class TxnStateChange extends AbstractLogEdit
 {
     /** ID of the txn associated with this change */
     long txnID;

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/DefaultTxnManagerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/DefaultTxnManagerTest.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/DefaultTxnManagerTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/DefaultTxnManagerTest.java Wed Nov  9 17:18:53 2011
@@ -49,7 +49,7 @@ public class DefaultTxnManagerTest
     private static String LOG_SUFFIX = "log";
 
     /** Txn manager */
-    private TxnManagerInternal<Long> txnManager;
+    private TxnManagerInternal txnManager;
 
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
@@ -71,9 +71,8 @@ public class DefaultTxnManagerTest
     {
         try
         {
-            TxnManagerFactory.<Long> init( LongComparator.INSTANCE, LongSerializer.INSTANCE, getLogFolder(),
-                logBufferSize, logFileSize );
-            txnManager = TxnManagerFactory.<Long> txnManagerInternalInstance();
+            TxnManagerFactory.init( getLogFolder(), logBufferSize, logFileSize );
+            txnManager = TxnManagerFactory.txnManagerInternalInstance();
         }
         catch ( IOException e )
         {
@@ -182,20 +181,20 @@ public class DefaultTxnManagerTest
     @Test
     public void testDependencyList()
     {
-        List<ReadWriteTxn<Long>> dependentTxns;
+        List<ReadWriteTxn> dependentTxns;
         try
         {
-            Transaction<Long> txn1 = null;
+            Transaction txn1 = null;
             txnManager.beginTransaction( false );
             txn1 = txnManager.getCurTxn();
             txnManager.commitTransaction();
 
-            Transaction<Long> txn2 = null;
+            Transaction txn2 = null;
             txnManager.beginTransaction( false );
             txn2 = txnManager.getCurTxn();
             txnManager.commitTransaction();
 
-            Transaction<Long> txn3 = null;
+            Transaction txn3 = null;
             txnManager.beginTransaction( true );
             txn3 = txnManager.getCurTxn();
 
@@ -206,7 +205,7 @@ public class DefaultTxnManagerTest
 
             txnManager.commitTransaction();
 
-            Transaction<Long> txn4 = null;
+            Transaction txn4 = null;
             txnManager.beginTransaction( false );
             txn4 = txnManager.getCurTxn();;
             dependentTxns = txn4.getTxnsToCheck();

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/EntryUpdateMergeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/EntryUpdateMergeTest.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/EntryUpdateMergeTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/EntryUpdateMergeTest.java Wed Nov  9 17:18:53 2011
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import java.io.IOException;
 import java.util.TreeSet;
+import java.util.UUID;
 
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -69,28 +70,28 @@ public class EntryUpdateMergeTest
     private static String LOG_SUFFIX = "log";
 
     /** Txn manager */
-    private TxnManagerInternal<Long> txnManager;
+    private TxnManagerInternal txnManager;
 
     /** Txn log manager */
-    private TxnLogManager<Long> txnLogManager;
+    private TxnLogManager txnLogManager;
 
     /** Entry to be merged */
     private Entry toUpdate;
 
     /** Entry Id */
-    private Long updatedEntryId = new Long( 0 );
+    private UUID updatedEntryId = UUID.fromString( "00000000-0000-0000-0000-000000000001" );
 
     /** Entry to be added by a txn */
     private Entry toAdd;
 
     /** Entry Id */
-    private Long addedEntryId = new Long( 1 );
+    private UUID addedEntryId = UUID.fromString( "00000000-0000-0000-0000-000000000002" );
 
     /** Entry to be added by a txn */
     private Entry toDelete;
 
     /** Entry Id */
-    private Long deletedEntryId = new Long( 2 );
+    private UUID deletedEntryId = UUID.fromString( "00000000-0000-0000-0000-000000000003" );
 
     /** Schema manager */
     private SchemaManager schemaManager;
@@ -130,17 +131,16 @@ public class EntryUpdateMergeTest
             GN_AT = schemaManager.getAttributeType( "gn" );
 
             // Init the txn manager
-            TxnManagerFactory.<Long> init( LongComparator.INSTANCE, LongSerializer.INSTANCE, getLogFolder(),
-                logBufferSize, logFileSize );
-            txnManager = TxnManagerFactory.<Long> txnManagerInternalInstance();
-            txnLogManager = TxnManagerFactory.<Long> txnLogManagerInstance();
+            TxnManagerFactory.init( getLogFolder(), logBufferSize, logFileSize );
+            txnManager = TxnManagerFactory.txnManagerInternalInstance();
+            txnLogManager = TxnManagerFactory.txnLogManagerInstance();
 
             toUpdate = createEntry( updatedEntryId );
             toAdd = createEntry( addedEntryId );
             toDelete = createEntry( deletedEntryId );
 
             // Begin a txn and do some entry changes.
-            DataChangeContainer<Long> changeContainer = new DataChangeContainer<Long>( dn );
+            DataChangeContainer changeContainer = new DataChangeContainer( dn );
             changeContainer.setEntryID( updatedEntryId );
             txnManager.beginTransaction( false );
 
@@ -149,7 +149,7 @@ public class EntryUpdateMergeTest
 
             Modification redo = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
             Modification undo = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
-            EntryChange<Long> eChange = new EntryChange<Long>( redo, undo );
+            EntryChange eChange = new EntryChange( redo, undo );
 
             changeContainer.getChanges().add( eChange );
 
@@ -158,21 +158,21 @@ public class EntryUpdateMergeTest
 
             txnManager.beginTransaction( false );
 
-            changeContainer = new DataChangeContainer<Long>( dn );
+            changeContainer = new DataChangeContainer( dn );
             changeContainer.setEntryID( updatedEntryId );
             attribute = new DefaultAttribute( "gn", GN_AT );
             attribute.add( "test3" );
 
             redo = new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, attribute );
             undo = new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, attribute );
-            eChange = new EntryChange<Long>( redo, undo );
+            eChange = new EntryChange( redo, undo );
 
             changeContainer.getChanges().add( eChange );
             txnLogManager.log( changeContainer, false );
 
-            changeContainer = new DataChangeContainer<Long>( dn );
+            changeContainer = new DataChangeContainer( dn );
             changeContainer.setEntryID( addedEntryId );
-            EntryAddDelete<Long> eAdd = new EntryAddDelete<Long>( toAdd, EntryAddDelete.Type.ADD );
+            EntryAddDelete eAdd = new EntryAddDelete( toAdd, EntryAddDelete.Type.ADD );
 
             changeContainer.getChanges().add( eAdd );
             txnLogManager.log( changeContainer, false );
@@ -181,9 +181,9 @@ public class EntryUpdateMergeTest
 
             txnManager.beginTransaction( false );
 
-            changeContainer = new DataChangeContainer<Long>( dn );
+            changeContainer = new DataChangeContainer( dn );
             changeContainer.setEntryID( deletedEntryId );
-            EntryAddDelete<Long> eDelete = new EntryAddDelete<Long>( toDelete, EntryAddDelete.Type.DELETE );
+            EntryAddDelete eDelete = new EntryAddDelete( toDelete, EntryAddDelete.Type.DELETE );
 
             changeContainer.getChanges().add( eDelete );
             txnLogManager.log( changeContainer, false );
@@ -270,7 +270,7 @@ public class EntryUpdateMergeTest
     }
 
 
-    private Entry createEntry( Long id ) throws Exception
+    private Entry createEntry( UUID id ) throws Exception
     {
         String user = id.toString();
 

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/IndexCursorWrapperTest.java Wed Nov  9 17:18:53 2011
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import java.io.IOException;
 import java.util.TreeSet;
+import java.util.UUID;
 
 import org.apache.directory.server.core.api.partition.index.ForwardIndexComparator;
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
@@ -70,27 +71,30 @@ public class IndexCursorWrapperTest
     private static String LOG_SUFFIX = "log";
 
     /** Txn manager */
-    private TxnManagerInternal<Long> txnManager;
+    private TxnManagerInternal txnManager;
 
     /** Txn log manager */
-    private TxnLogManager<Long> txnLogManager;
+    private TxnLogManager txnLogManager;
 
     /** index entry comparator */
-    private ForwardIndexComparator<?, Long> comparator = new ForwardIndexComparator<Long, Long>(
-        LongComparator.INSTANCE,
+    private ForwardIndexComparator<?> comparator = new ForwardIndexComparator<Long>(
         LongComparator.INSTANCE );
 
     /** sorted change set for the cursor */
-    private TreeSet<IndexEntry<Object, Long>> changedSet;
+    private TreeSet<IndexEntry<Object>> changedSet;
 
     /** Cursor to be wrapped*/
-    private TxnIndexCursor<Long> cursor;
+    private TxnIndexCursor cursor;
 
     /** Cursor wrapper */
-    private IndexCursor<Object, Entry, Long> cursorWrapper;
+    private IndexCursor<Object> cursorWrapper;
 
+    /** UUID string */
+    UUID baseUUID = UUID.fromString( "00000000-0000-0000-0000-000000000001" );
+    
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
+   
 
 
     /**
@@ -114,54 +118,53 @@ public class IndexCursorWrapperTest
             dn = new Dn( "cn=Test", "ou=department" );
 
             // Init the txn manager
-            TxnManagerFactory.<Long> init( LongComparator.INSTANCE, LongSerializer.INSTANCE, getLogFolder(),
-                logBufferSize, logFileSize );
-            txnManager = TxnManagerFactory.<Long> txnManagerInternalInstance();
-            txnLogManager = TxnManagerFactory.<Long> txnLogManagerInstance();
+            TxnManagerFactory.init( getLogFolder(), logBufferSize, logFileSize );
+            txnManager = TxnManagerFactory.txnManagerInternalInstance();
+            txnLogManager = TxnManagerFactory.txnLogManagerInstance();
 
             // Prepare the to be wrapped cursor
-            ForwardIndexEntry<Object, Long> idxEntry;
-            changedSet = new TreeSet<IndexEntry<Object, Long>>( ( ForwardIndexComparator<Object, Long> ) comparator );
+            ForwardIndexEntry<Object> idxEntry;
+            changedSet = new TreeSet<IndexEntry<Object>>( ( ForwardIndexComparator<Object> ) comparator );
 
             for ( int idx = 0; idx < 10; idx++ )
             {
                 if ( idx != 5 )
                 {
-                    idxEntry = new ForwardIndexEntry<Object, Long>();
+                    idxEntry = new ForwardIndexEntry<Object>();
                     idxEntry.setValue( new Long( idx ) );
-                    idxEntry.setId( new Long( idx ) );
+                    idxEntry.setId( getUUIDString( idx ) );
                     changedSet.add( idxEntry );
                 }
 
                 if ( idx != 5 && idx != 0 )
                 {
-                    idxEntry = new ForwardIndexEntry<Object, Long>();
+                    idxEntry = new ForwardIndexEntry<Object>();
                     idxEntry.setValue( new Long( idx ) );
-                    idxEntry.setId( new Long( idx + 1 ) );
+                    idxEntry.setId( getUUIDString( idx + 1 ) );
                     changedSet.add( idxEntry );
                 }
             }
 
-            cursor = new TxnIndexCursor<Long>( changedSet, true, null, null, comparator );
+            cursor = new TxnIndexCursor( changedSet, true, null, null, ( ForwardIndexComparator<Object> )comparator );
 
-            IndexChange<Long> idxChange;
+            IndexChange idxChange;
 
             // Begin a txn and do some index changes.
-            DataChangeContainer<Long> changeContainer = new DataChangeContainer<Long>( dn );
+            DataChangeContainer changeContainer = new DataChangeContainer( dn );
             txnManager.beginTransaction( false );
 
             // Add (5,5) missing in the original index 
-            idxChange = new IndexChange<Long>( mockIndex, attributeOid, new Long( 5 ), new Long( 5 ),
+            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 5 ), getUUIDString( 5 ),
                 IndexChange.Type.ADD );
             changeContainer.getChanges().add( idxChange );
 
             // Add (10,11) missing in the original index 
-            idxChange = new IndexChange<Long>( mockIndex, attributeOid, new Long( 10 ), new Long( 11 ),
+            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 10 ), getUUIDString( 11 ),
                 IndexChange.Type.ADD );
             changeContainer.getChanges().add( idxChange );
 
             // Delete (6,6) existing in the original index 
-            idxChange = new IndexChange<Long>( mockIndex, attributeOid, new Long( 6 ), new Long( 6 ),
+            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 6 ), getUUIDString( 6 ),
                 IndexChange.Type.DELETE );
             changeContainer.getChanges().add( idxChange );
 
@@ -171,21 +174,21 @@ public class IndexCursorWrapperTest
             txnManager.commitTransaction();
 
             // Begin another txn and do some more index changes
-            changeContainer = new DataChangeContainer<Long>( dn );
+            changeContainer = new DataChangeContainer( dn );
             txnManager.beginTransaction( false );
 
             // Add (4,5) already existing in the original index 
-            idxChange = new IndexChange<Long>( mockIndex, attributeOid, new Long( 4 ), new Long( 5 ),
+            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 4 ), getUUIDString( 5 ),
                 IndexChange.Type.ADD );
             changeContainer.getChanges().add( idxChange );
 
             // Re add (0,1) missing in the original index 
-            idxChange = new IndexChange<Long>( mockIndex, attributeOid, new Long( 0 ), new Long( 1 ),
+            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 0 ), getUUIDString( 1 ),
                 IndexChange.Type.ADD );
             changeContainer.getChanges().add( idxChange );
 
             // Delete (10,11) added by the previous txn 
-            idxChange = new IndexChange<Long>( mockIndex, attributeOid, new Long( 10 ), new Long( 11 ),
+            idxChange = new IndexChange( mockIndex, attributeOid, new Long( 10 ), getUUIDString( 11 ),
                 IndexChange.Type.DELETE );
             changeContainer.getChanges().add( idxChange );
 
@@ -196,7 +199,7 @@ public class IndexCursorWrapperTest
             // Begin a read only txn and prepare the cursor wrapper 
             txnManager.beginTransaction( true );
 
-            cursorWrapper = txnLogManager.wrap( dn, cursor, ( ForwardIndexComparator<Object, Long> ) comparator,
+            cursorWrapper = txnLogManager.wrap( dn, cursor, ( ForwardIndexComparator<Object> ) comparator,
                 attributeOid, true, null, null );
 
         }
@@ -233,24 +236,24 @@ public class IndexCursorWrapperTest
     {
         try
         {
-            cursorWrapper.afterValue( new Long( 0 ), new Long( 0 ) );
+            cursorWrapper.afterValue( getUUIDString( 0 ), new Long( 0 ) );
             assertTrue( cursorWrapper.next() );
 
-            IndexEntry<?, Long> next = cursorWrapper.get();
+            IndexEntry<?> next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 0 ) ) );
-            assertTrue( next.getId().equals( new Long( 1 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 1 ) ) );
 
             assertTrue( cursorWrapper.next() );
             next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 1 ) ) );
-            assertTrue( next.getId().equals( new Long( 1 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 1 ) ) );
 
-            cursorWrapper.afterValue( new Long( 5 ), new Long( 4 ) );
+            cursorWrapper.afterValue( getUUIDString( 5 ), new Long( 4 ) );
             assertTrue( cursorWrapper.next() );
 
             next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 5 ) ) );
-            assertTrue( next.getId().equals( new Long( 5 ) ) );
+            assertTrue( next.getId().equals( getUUIDString(  5 ) ) );
         }
         catch ( Exception e )
         {
@@ -265,22 +268,22 @@ public class IndexCursorWrapperTest
     {
         try
         {
-            cursorWrapper.beforeValue( new Long( 5 ), new Long( 4 ) );
+            cursorWrapper.beforeValue( getUUIDString( 5 ), new Long( 4 ) );
             assertTrue( cursorWrapper.next() );
 
-            IndexEntry<?, Long> next = cursorWrapper.get();
+            IndexEntry<?> next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 4 ) ) );
-            assertTrue( next.getId().equals( new Long( 5 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 5 ) ) );
 
             assertTrue( cursorWrapper.next() );
             next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 5 ) ) );
-            assertTrue( next.getId().equals( new Long( 5 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 5 ) ) );
 
             assertTrue( cursorWrapper.next() );
             next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 6 ) ) );
-            assertTrue( next.getId().equals( new Long( 7 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 7 ) ) );
         }
         catch ( Exception e )
         {
@@ -298,14 +301,14 @@ public class IndexCursorWrapperTest
             cursorWrapper.afterLast();
             assertTrue( cursorWrapper.previous() );
 
-            IndexEntry<?, Long> prev = cursorWrapper.get();
+            IndexEntry<?> prev = cursorWrapper.get();
             assertTrue( prev.getValue().equals( new Long( 9 ) ) );
-            assertTrue( prev.getId().equals( new Long( 10 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 10 ) ) );
 
             assertTrue( cursorWrapper.previous() );
             prev = cursorWrapper.get();
             assertTrue( prev.getValue().equals( new Long( 9 ) ) );
-            assertTrue( prev.getId().equals( new Long( 9 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 9 ) ) );
 
             assertTrue( cursorWrapper.next() );
 
@@ -327,21 +330,21 @@ public class IndexCursorWrapperTest
             cursorWrapper.beforeFirst();
             assertTrue( cursorWrapper.next() );
 
-            IndexEntry<?, Long> next = cursorWrapper.get();
+            IndexEntry<?> next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 0 ) ) );
-            assertTrue( next.getId().equals( new Long( 0 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 0 ) ) );
 
             assertTrue( cursorWrapper.previous() == false );
 
             assertTrue( cursorWrapper.next() );
             next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 0 ) ) );
-            assertTrue( next.getId().equals( new Long( 0 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 0 ) ) );
 
             assertTrue( cursorWrapper.next() );
             next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 0 ) ) );
-            assertTrue( next.getId().equals( new Long( 1 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 1 ) ) );
 
         }
         catch ( Exception e )
@@ -360,16 +363,16 @@ public class IndexCursorWrapperTest
             cursorWrapper.afterValue( null, new Long( 5 ) );
             assertTrue( cursorWrapper.next() );
 
-            IndexEntry<?, Long> next = cursorWrapper.get();
+            IndexEntry<?> next = cursorWrapper.get();
             assertTrue( next.getValue().equals( new Long( 6 ) ) );
-            assertTrue( next.getId().equals( new Long( 7 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 7 ) ) );
 
             cursorWrapper.beforeValue( null, new Long( 1 ) );
             assertTrue( cursorWrapper.previous() );
 
-            IndexEntry<?, Long> prev = cursorWrapper.get();
+            IndexEntry<?> prev = cursorWrapper.get();
             assertTrue( prev.getValue().equals( new Long( 0 ) ) );
-            assertTrue( prev.getId().equals( new Long( 1 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 1 ) ) );
         }
         catch ( Exception e )
         {
@@ -377,8 +380,17 @@ public class IndexCursorWrapperTest
             fail();
         }
     }
+    
+    private UUID getUUIDString( int idx )
+    {
+        long low = baseUUID.getLeastSignificantBits();
+        long high = baseUUID.getMostSignificantBits();
+        low = low + idx;
+        
+        return new UUID( high, low );
+    }
 
-    class MockIndex extends GenericIndex<Long, Entry, Long>
+    class MockIndex extends GenericIndex<Long>
     {
         public MockIndex()
         {
@@ -386,17 +398,15 @@ public class IndexCursorWrapperTest
         }
 
 
-        public ForwardIndexComparator<Long, Long> getForwardIndexEntryComparator()
+        public ForwardIndexComparator<Long> getForwardIndexEntryComparator()
         {
-            return new ForwardIndexComparator<Long, Long>( LongComparator.INSTANCE,
-                LongComparator.INSTANCE );
+            return new ForwardIndexComparator<Long>( LongComparator.INSTANCE );
         }
 
 
-        public ReverseIndexComparator<Long, Long> getReverseIndexEntryComparator()
+        public ReverseIndexComparator<Long > getReverseIndexEntryComparator()
         {
-            return new ReverseIndexComparator<Long, Long>( LongComparator.INSTANCE,
-                LongComparator.INSTANCE );
+            return new ReverseIndexComparator<Long>( LongComparator.INSTANCE );
         }
     }
 

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnConflicTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnConflicTest.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnConflicTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnConflicTest.java Wed Nov  9 17:18:53 2011
@@ -47,10 +47,10 @@ public class TxnConflicTest
     private static String LOG_SUFFIX = "log";
 
     /** Txn manager */
-    private TxnManagerInternal<Long> txnManager;
+    private TxnManagerInternal txnManager;
 
     /** Txn log manager */
-    private TxnLogManager<Long> txnLogManager;
+    private TxnLogManager txnLogManager;
 
     @Rule
     public TemporaryFolder folder = new TemporaryFolder();
@@ -74,10 +74,9 @@ public class TxnConflicTest
         try
         {
             // Init the txn manager
-            TxnManagerFactory.<Long> init( LongComparator.INSTANCE, LongSerializer.INSTANCE, getLogFolder(),
-                logBufferSize, logFileSize );
-            txnManager = TxnManagerFactory.<Long> txnManagerInternalInstance();
-            txnLogManager = TxnManagerFactory.<Long> txnLogManagerInstance();
+            TxnManagerFactory.init( getLogFolder(), logBufferSize, logFileSize );
+            txnManager = TxnManagerFactory.txnManagerInternalInstance();
+            txnLogManager = TxnManagerFactory.txnLogManagerInstance();
         }
         catch ( Exception e )
         {
@@ -97,17 +96,17 @@ public class TxnConflicTest
             Dn dn1 = new Dn( "cn=Test", "ou=department", "dc=example,dc=com" );
             Dn dn2 = new Dn( "gn=Test1", "cn=Test", "ou=department", "dc=example,dc=com" );
 
-            ReadWriteTxn<Long> firstTxn;
-            ReadWriteTxn<Long> checkedTxn;
+            ReadWriteTxn firstTxn;
+            ReadWriteTxn checkedTxn;
 
             txnManager.beginTransaction( false );
             txnLogManager.addWrite( dn1, SearchScope.OBJECT );
-            firstTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            firstTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
             txnManager.commitTransaction();
 
             txnManager.beginTransaction( false );
             txnLogManager.addWrite( dn1, SearchScope.OBJECT );
-            checkedTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            checkedTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
 
             conflicted = checkedTxn.hasConflict( firstTxn );
             assertTrue( conflicted == true );
@@ -115,7 +114,7 @@ public class TxnConflicTest
 
             txnManager.beginTransaction( false );
             txnLogManager.addRead( dn1, SearchScope.OBJECT );
-            checkedTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            checkedTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
 
             conflicted = checkedTxn.hasConflict( firstTxn );
             assertTrue( conflicted == true );
@@ -123,7 +122,7 @@ public class TxnConflicTest
 
             txnManager.beginTransaction( false );
             txnLogManager.addWrite( dn2, SearchScope.OBJECT );
-            checkedTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            checkedTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
 
             conflicted = checkedTxn.hasConflict( firstTxn );
             assertTrue( conflicted == false );
@@ -148,17 +147,17 @@ public class TxnConflicTest
             Dn dn2 = new Dn( "gn=Test1", "cn=Test", "ou=department", "dc=example,dc=com" );
             Dn dn3 = new Dn( "ou=department", "dc=example,dc=com" );
 
-            ReadWriteTxn<Long> firstTxn;
-            ReadWriteTxn<Long> checkedTxn;
+            ReadWriteTxn firstTxn;
+            ReadWriteTxn checkedTxn;
 
             txnManager.beginTransaction( false );
             txnLogManager.addWrite( dn1, SearchScope.SUBTREE );
-            firstTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            firstTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
             txnManager.commitTransaction();
 
             txnManager.beginTransaction( false );
             txnLogManager.addRead( dn1, SearchScope.OBJECT );
-            checkedTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            checkedTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
 
             conflicted = checkedTxn.hasConflict( firstTxn );
             assertTrue( conflicted == true );
@@ -166,7 +165,7 @@ public class TxnConflicTest
 
             txnManager.beginTransaction( false );
             txnLogManager.addWrite( dn2, SearchScope.OBJECT );
-            checkedTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            checkedTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
 
             conflicted = checkedTxn.hasConflict( firstTxn );
             assertTrue( conflicted == true );
@@ -174,7 +173,7 @@ public class TxnConflicTest
 
             txnManager.beginTransaction( false );
             txnLogManager.addRead( dn1, SearchScope.SUBTREE );
-            checkedTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            checkedTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
 
             conflicted = checkedTxn.hasConflict( firstTxn );
             assertTrue( conflicted == true );
@@ -182,7 +181,7 @@ public class TxnConflicTest
 
             txnManager.beginTransaction( false );
             txnLogManager.addWrite( dn3, SearchScope.OBJECT );
-            checkedTxn = ( ReadWriteTxn<Long> ) txnManager.getCurTxn();
+            checkedTxn = ( ReadWriteTxn ) txnManager.getCurTxn();
 
             conflicted = checkedTxn.hasConflict( firstTxn );
             assertTrue( conflicted == false );

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnIndexCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnIndexCursorTest.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnIndexCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/test/java/org/apache/directory/server/core/shared/txn/TxnIndexCursorTest.java Wed Nov  9 17:18:53 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import java.util.TreeSet;
+import java.util.UUID;
 
 import org.apache.directory.server.core.api.partition.index.IndexEntry;
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
@@ -37,45 +38,46 @@ import static org.junit.Assert.fail;
 public class TxnIndexCursorTest
 {
     /** index entry comparator */
-    private ForwardIndexComparator<?, Long> comparator = new ForwardIndexComparator<Long, Long>( LongComparator.INSTANCE,
-        LongComparator.INSTANCE );
+    private ForwardIndexComparator<?> comparator = new ForwardIndexComparator<Long>( LongComparator.INSTANCE );
 
     /** sorted change set for the cursor */
-    private TreeSet<IndexEntry<Object, Long>> changedSet;
+    private TreeSet<IndexEntry<Object>> changedSet;
 
     /** Cursor */
-    TxnIndexCursor<Long> cursor;
+    TxnIndexCursor cursor;
 
     /** Only Key Cursor */
-    TxnIndexCursor<Long> onlyKeyCursor;
+    TxnIndexCursor onlyKeyCursor;
 
+    /** UUID string */
+    UUID baseUUID = UUID.fromString( "00000000-0000-0000-0000-000000000001" );
 
     @Before
     public void setup()
     {
-        ForwardIndexEntry<Object, Long> idxEntry;
-        changedSet = new TreeSet<IndexEntry<Object, Long>>( ( ForwardIndexComparator<Object, Long> ) comparator );
+        ForwardIndexEntry<Object> idxEntry;
+        changedSet = new TreeSet<IndexEntry<Object>>( ( ForwardIndexComparator<Object> ) comparator );
 
         for ( int idx = 0; idx < 10; idx++ )
         {
             if ( idx != 5 )
             {
-                idxEntry = new ForwardIndexEntry<Object, Long>();
+                idxEntry = new ForwardIndexEntry<Object>();
                 idxEntry.setValue( new Long( idx ) );
-                idxEntry.setId( new Long( idx ) );
+                idxEntry.setId( getUUIDString( idx ) );
                 changedSet.add( idxEntry );
             }
 
             if ( idx != 5 && idx != 0 )
             {
-                idxEntry = new ForwardIndexEntry<Object, Long>();
+                idxEntry = new ForwardIndexEntry<Object>();
                 idxEntry.setValue( new Long( idx ) );
-                idxEntry.setId( new Long( idx + 1 ) );
+                idxEntry.setId( getUUIDString( idx + 1 ) );
                 changedSet.add( idxEntry );
             }
         }
 
-        cursor = new TxnIndexCursor<Long>( changedSet, true, null, null, comparator );
+        cursor = new TxnIndexCursor( changedSet, true, null, null, ( ForwardIndexComparator<Object> )comparator );
 
     }
 
@@ -103,19 +105,19 @@ public class TxnIndexCursorTest
     {
         try
         {
-            cursor.afterValue( new Long( 0 ), new Long( 0 ) );
+            cursor.afterValue( getUUIDString( 0 ), new Long( 0 ) );
             assertTrue( cursor.next() );
 
-            IndexEntry<?, Long> next = cursor.get();
+            IndexEntry<?> next = cursor.get();
             assertTrue( next.getValue().equals( new Long( 1 ) ) );
-            assertTrue( next.getId().equals( new Long( 1 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 1 ) ) );
 
-            cursor.afterValue( new Long( 5 ), new Long( 5 ) );
+            cursor.afterValue( getUUIDString( 5 ), new Long( 5 ) );
             assertTrue( cursor.previous() );
 
-            IndexEntry<?, Long> prev = cursor.get();
+            IndexEntry<?> prev = cursor.get();
             assertTrue( prev.getValue().equals( new Long( 4 ) ) );
-            assertTrue( prev.getId().equals( new Long( 5 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 5 ) ) );
         }
         catch ( Exception e )
         {
@@ -129,19 +131,19 @@ public class TxnIndexCursorTest
     {
         try
         {
-            cursor.beforeValue( new Long( 0 ), new Long( 0 ) );
+            cursor.beforeValue( getUUIDString( 0 ), new Long( 0 ) );
             assertTrue( cursor.next() );
 
-            IndexEntry<?, Long> next = cursor.get();
+            IndexEntry<?> next = cursor.get();
             assertTrue( next.getValue().equals( new Long( 0 ) ) );
-            assertTrue( next.getId().equals( new Long( 0 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 0 ) ) );
 
-            cursor.beforeValue( new Long( 5 ), new Long( 4 ) );
+            cursor.beforeValue( getUUIDString( 5 ), new Long( 4 ) );
             assertTrue( cursor.previous() );
 
-            IndexEntry<?, Long> prev = cursor.get();
+            IndexEntry<?> prev = cursor.get();
             assertTrue( prev.getValue().equals( new Long( 4 ) ) );
-            assertTrue( prev.getId().equals( new Long( 4 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 4 ) ) );
         }
         catch ( Exception e )
         {
@@ -158,9 +160,9 @@ public class TxnIndexCursorTest
             cursor.afterLast();
             assertTrue( cursor.previous() );
 
-            IndexEntry<?, Long> prev = cursor.get();
+            IndexEntry<?> prev = cursor.get();
             assertTrue( prev.getValue().equals( new Long( 9 ) ) );
-            assertTrue( prev.getId().equals( new Long( 10 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 10 ) ) );
 
             assertTrue( cursor.next() == false );
         }
@@ -179,9 +181,9 @@ public class TxnIndexCursorTest
             cursor.beforeFirst();
             assertTrue( cursor.next() );
 
-            IndexEntry<?, Long> next = cursor.get();
+            IndexEntry<?> next = cursor.get();
             assertTrue( next.getValue().equals( new Long( 0 ) ) );
-            assertTrue( next.getId().equals( new Long( 0 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 0 ) ) );
 
             assertTrue( cursor.previous() == false );
         }
@@ -200,16 +202,16 @@ public class TxnIndexCursorTest
             cursor.afterValue( null, new Long( 4 ) );
             assertTrue( cursor.next() );
 
-            IndexEntry<?, Long> next = cursor.get();
+            IndexEntry<?> next = cursor.get();
             assertTrue( next.getValue().equals( new Long( 6 ) ) );
-            assertTrue( next.getId().equals( new Long( 6 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 6 ) ) );
 
             cursor.beforeValue( null, new Long( 4 ) );
             assertTrue( cursor.next() );
 
             next = cursor.get();
             assertTrue( next.getValue().equals( new Long( 4 ) ) );
-            assertTrue( next.getId().equals( new Long( 4 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 4 ) ) );
         }
         catch ( Exception e )
         {
@@ -221,38 +223,38 @@ public class TxnIndexCursorTest
     @Test
     public void testLockDownByExistingKey()
     {
-        onlyKeyCursor = new TxnIndexCursor<Long>( changedSet, true, new Long( 7 ), null, comparator );
+        onlyKeyCursor = new TxnIndexCursor( changedSet, true, new Long( 7 ), null, ( ForwardIndexComparator<Object> )comparator );
         try
         {
             onlyKeyCursor.beforeFirst();
 
             assertTrue( onlyKeyCursor.next() );
-            IndexEntry<?, Long> next = onlyKeyCursor.get();
+            IndexEntry<?> next = onlyKeyCursor.get();
             assertTrue( next.getValue().equals( new Long( 7 ) ) );
-            assertTrue( next.getId().equals( new Long( 7 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 7 ) ) );
 
             assertTrue( onlyKeyCursor.next() );
             next = onlyKeyCursor.get();
             assertTrue( next.getValue().equals( new Long( 7 ) ) );
-            assertTrue( next.getId().equals( new Long( 8 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 8 ) ) );
 
             assertTrue( onlyKeyCursor.next() == false );
             assertTrue( onlyKeyCursor.previous() );
-            IndexEntry<?, Long> prev = onlyKeyCursor.get();
+            IndexEntry<?> prev = onlyKeyCursor.get();
             assertTrue( prev.getValue().equals( new Long( 7 ) ) );
-            assertTrue( prev.getId().equals( new Long( 8 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 8 ) ) );
 
             assertTrue( onlyKeyCursor.previous() );
             prev = onlyKeyCursor.get();
             assertTrue( prev.getValue().equals( new Long( 7 ) ) );
-            assertTrue( prev.getId().equals( new Long( 7 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 7 ) ) );
 
             assertTrue( onlyKeyCursor.previous() == false );
             assertTrue( onlyKeyCursor.previous() == false );
             assertTrue( onlyKeyCursor.next() == true );
             next = onlyKeyCursor.get();
             assertTrue( next.getValue().equals( new Long( 7 ) ) );
-            assertTrue( next.getId().equals( new Long( 7 ) ) );
+            assertTrue( next.getId().equals( getUUIDString( 7 ) ) );
 
             onlyKeyCursor.afterValue( null, new Long( 7 ) );
 
@@ -260,7 +262,7 @@ public class TxnIndexCursorTest
             assertTrue( onlyKeyCursor.previous() );
             prev = onlyKeyCursor.get();
             assertTrue( prev.getValue().equals( new Long( 7 ) ) );
-            assertTrue( prev.getId().equals( new Long( 8 ) ) );
+            assertTrue( prev.getId().equals( getUUIDString( 8 ) ) );
 
         }
         catch ( Exception e )
@@ -273,7 +275,7 @@ public class TxnIndexCursorTest
     @Test
     public void testLockDownByNonExistingKey()
     {
-        onlyKeyCursor = new TxnIndexCursor<Long>( changedSet, true, new Long( 5 ), null, comparator );
+        onlyKeyCursor = new TxnIndexCursor( changedSet, true, new Long( 5 ), null, ( ForwardIndexComparator<Object> )comparator );
         try
         {
             onlyKeyCursor.beforeFirst();
@@ -286,4 +288,13 @@ public class TxnIndexCursorTest
             fail();
         }
     }
+    
+    private UUID getUUIDString( int idx )
+    {
+        long low = baseUUID.getLeastSignificantBits();
+        long high = baseUUID.getMostSignificantBits();
+        low = low + idx;
+        
+        return new UUID( high, low );
+    }
 }

Added: directory/apacheds/branches/apacheds-txns/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UUIDSerializer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UUIDSerializer.java?rev=1199875&view=auto
==============================================================================
--- directory/apacheds/branches/apacheds-txns/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UUIDSerializer.java (added)
+++ directory/apacheds/branches/apacheds-txns/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/UUIDSerializer.java Wed Nov  9 17:18:53 2011
@@ -0,0 +1,53 @@
+/*
+ *  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.partition.impl.btree.jdbm;
+
+import java.io.IOException;
+import java.util.UUID;
+
+import jdbm.helper.Serializer;
+
+
+public class UUIDSerializer implements Serializer
+{
+    private static final long serialVersionUID = -1L;
+
+    private StringSerializer stringSerializer = new StringSerializer();
+    
+    public final static UUIDSerializer INSTANCE = new UUIDSerializer();
+
+
+    /* (non-Javadoc)
+     * @see jdbm.helper.Serializer#deserialize(byte[])
+     */
+    public Object deserialize( byte[] bites ) throws IOException
+    {
+        return UUID.fromString( (String) stringSerializer.deserialize( bites ) );
+    }
+
+
+    /* (non-Javadoc)
+     * @see jdbm.helper.Serializer#serialize(java.lang.Object)
+     */
+    public byte[] serialize( Object uuid ) throws IOException
+    {
+        return stringSerializer.serialize( ( ( UUID )uuid ).toString() );
+    }
+}

Modified: directory/apacheds/branches/apacheds-txns/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/branches/apacheds-txns/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Wed Nov  9 17:18:53 2011
@@ -33,6 +33,7 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
+import java.util.UUID;
 
 import javax.naming.directory.SearchControls;
 
@@ -74,10 +75,10 @@ public class ConfigPartitionReader
     private static final Logger LOG = LoggerFactory.getLogger( ConfigPartitionReader.class );
 
     /** the partition which holds the configuration data */
-    private AbstractBTreePartition<Long> configPartition;
+    private AbstractBTreePartition configPartition;
 
     /** the search engine of the partition */
-    private SearchEngine<Entry, Long> se;
+    private SearchEngine se;
 
     /** the schema manager set in the config partition */
     private SchemaManager schemaManager;
@@ -99,7 +100,7 @@ public class ConfigPartitionReader
      *
      * @param configPartition the non null config partition
      */
-    public ConfigPartitionReader( AbstractBTreePartition<Long> configPartition )
+    public ConfigPartitionReader( AbstractBTreePartition configPartition )
     {
         if ( configPartition == null )
         {
@@ -729,7 +730,7 @@ public class ConfigPartitionReader
         EqualityNode<?> filter = new EqualityNode( adsdAt, new StringValue( name ) );
         SearchControls controls = new SearchControls();
         controls.setSearchScope( scope.ordinal() );
-        IndexCursor<Long, Entry, Long> cursor = null;
+        IndexCursor<UUID> cursor = null;
 
         // Create a container for all the read beans
         List<AdsBaseBean> beans = new ArrayList<AdsBaseBean>();
@@ -761,7 +762,7 @@ public class ConfigPartitionReader
             // Loop on all the found elements
             do
             {
-                ForwardIndexEntry<Long, Long> forwardEntry = ( ForwardIndexEntry<Long, Long> ) cursor
+                ForwardIndexEntry<UUID> forwardEntry = ( ForwardIndexEntry<UUID> ) cursor
                     .get();
 
                 // Now, get the entry

Modified: directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java (original)
+++ directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java Wed Nov  9 17:18:53 2011
@@ -1056,14 +1056,14 @@ public class ServiceBuilder
      * @return An JdbmIndex instance
      * @throws Exception If the instance cannot be created
      */
-    public static JdbmIndex<?, Entry> createJdbmIndex( JdbmPartition partition, JdbmIndexBean<String, Entry> jdbmIndexBean, DirectoryService directoryService )
+    public static JdbmIndex<?> createJdbmIndex( JdbmPartition partition, JdbmIndexBean<String, Entry> jdbmIndexBean, DirectoryService directoryService )
     {
         if ( ( jdbmIndexBean == null ) || jdbmIndexBean.isDisabled() )
         {
             return null;
         }
         
-        JdbmIndex<String, Entry> index = new JdbmIndex<String, Entry>();
+        JdbmIndex<String> index = new JdbmIndex<String>();
         
         index.setAttributeId( jdbmIndexBean.getIndexAttributeId() );
         index.setCacheSize( jdbmIndexBean.getIndexCacheSize() );
@@ -1106,9 +1106,9 @@ public class ServiceBuilder
     /**
      * Create the list of Index from the configuration
      */
-    private static Set<Index<?, Entry, Long>> createJdbmIndexes( JdbmPartition partition, List<IndexBean> indexesBeans, DirectoryService directoryService ) //throws Exception
+    private static Set<Index<?>> createJdbmIndexes( JdbmPartition partition, List<IndexBean> indexesBeans, DirectoryService directoryService ) //throws Exception
     {
-        Set<Index<?, Entry, Long>> indexes = new HashSet<Index<?, Entry, Long>>();
+        Set<Index<?>> indexes = new HashSet<Index<?>>();
 
         for ( IndexBean indexBean : indexesBeans )
         {

Modified: directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java (original)
+++ directory/apacheds/branches/apacheds-txns/service-builder/src/main/java/org/apache/directory/server/config/builder/ServiceBuilder.java Wed Nov  9 17:18:53 2011
@@ -1058,14 +1058,14 @@ public class ServiceBuilder
      * @return An JdbmIndex instance
      * @throws Exception If the instance cannot be created
      */
-    public static JdbmIndex<?, Entry> createJdbmIndex( JdbmPartition partition, JdbmIndexBean<String, Entry> jdbmIndexBean, DirectoryService directoryService )
+    public static JdbmIndex<?> createJdbmIndex( JdbmPartition partition, JdbmIndexBean<String, Entry> jdbmIndexBean, DirectoryService directoryService )
     {
         if ( ( jdbmIndexBean == null ) || jdbmIndexBean.isDisabled() )
         {
             return null;
         }
         
-        JdbmIndex<String, Entry> index = new JdbmIndex<String, Entry>();
+        JdbmIndex<String> index = new JdbmIndex<String>();
         
         index.setAttributeId( jdbmIndexBean.getIndexAttributeId() );
         index.setCacheSize( jdbmIndexBean.getIndexCacheSize() );
@@ -1108,9 +1108,9 @@ public class ServiceBuilder
     /**
      * Create the list of Index from the configuration
      */
-    private static Set<Index<?, Entry, Long>> createJdbmIndexes( JdbmPartition partition, List<IndexBean> indexesBeans, DirectoryService directoryService ) //throws Exception
+    private static Set<Index<?>> createJdbmIndexes( JdbmPartition partition, List<IndexBean> indexesBeans, DirectoryService directoryService ) //throws Exception
     {
-        Set<Index<?, Entry, Long>> indexes = new HashSet<Index<?, Entry, Long>>();
+        Set<Index<?>> indexes = new HashSet<Index<?>>();
 
         for ( IndexBean indexBean : indexesBeans )
         {

Modified: directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java Wed Nov  9 17:18:53 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import java.util.ArrayList;
+import java.util.UUID;
 
 import javax.swing.table.AbstractTableModel;
 
@@ -52,7 +53,7 @@ public class AttributesTableModel extend
     private final ArrayList<Object> valList;
 
     /** the unique id of the entry  */
-    private final Long id;
+    private final UUID id;
     
     /** the distinguished name of the entry */
     private final String dn;
@@ -69,7 +70,7 @@ public class AttributesTableModel extend
      * @param dn the distinguished name of the entry
      * @param isMutable whether or not the model can be changed
      */
-    public AttributesTableModel( Entry entry, Long id, String dn, boolean isMutable)
+    public AttributesTableModel( Entry entry, UUID id, String dn, boolean isMutable)
     {
         this.dn = dn;
         this.id = id;
@@ -224,7 +225,7 @@ public class AttributesTableModel extend
      *
      * @return the unique id for the entry
      */
-    public Long getEntryId()
+    public UUID getEntryId()
     {
         return id;
     }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Wed Nov  9 17:18:53 2011
@@ -26,6 +26,7 @@ import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.UUID;
 
 import javax.swing.tree.TreeNode;
 
@@ -51,16 +52,16 @@ public class EntryNode implements TreeNo
     private final EntryNode parent;
     private final Entry entry;
     private final ArrayList<TreeNode> children;
-    private final Long id;
+    private final UUID id;
 
 
-    public EntryNode( Long id, EntryNode parent, AbstractBTreePartition partition, Entry entry, Map<Long, EntryNode> map )
+    public EntryNode( UUID id, EntryNode parent, AbstractBTreePartition partition, Entry entry, Map<UUID, EntryNode> map )
     {
         this( id, parent, partition, entry, map, null, null );
     }
 
 
-    public EntryNode( Long id, EntryNode parent, AbstractBTreePartition db, Entry entry, Map<Long, EntryNode> map,
+    public EntryNode( UUID id, EntryNode parent, AbstractBTreePartition db, Entry entry, Map<UUID, EntryNode> map,
         ExprNode exprNode, SearchEngine engine )
     {
         this.partition = db;
@@ -80,7 +81,7 @@ public class EntryNode implements TreeNo
         try
         {
             List<ForwardIndexEntry> recordForwards = new ArrayList<ForwardIndexEntry>();
-            IndexCursor<Long, Entry, Long> childList = db.list( id );
+            IndexCursor<UUID> childList = db.list( id );
 
             while ( childList.next() )
             {
@@ -100,14 +101,14 @@ public class EntryNode implements TreeNo
 
                 if ( engine != null && exprNode != null )
                 {
-                    if ( db.getChildCount( (Long)rec.getId() ) == 0 )
+                    if ( db.getChildCount( rec.getId() ) == 0 )
                     {
                         Evaluator evaluator = engine.evaluator( exprNode );
                         
                         if ( evaluator.evaluate( rec ) )
                         {
-                            Entry newEntry = db.lookup( (Long)rec.getId() );
-                            EntryNode child = new EntryNode( ( Long ) rec.getId(), this, db, newEntry, map, exprNode,
+                            Entry newEntry = db.lookup( rec.getId() );
+                            EntryNode child = new EntryNode( rec.getId(), this, db, newEntry, map, exprNode,
                                 engine );
                             children.add( child );
                         }
@@ -118,16 +119,16 @@ public class EntryNode implements TreeNo
                     }
                     else
                     {
-                        Entry newEntry = db.lookup( (Long)rec.getId() );
-                        EntryNode child = new EntryNode( ( Long ) rec.getId(), this, db, newEntry, map, exprNode,
+                        Entry newEntry = db.lookup( rec.getId() );
+                        EntryNode child = new EntryNode( rec.getId(), this, db, newEntry, map, exprNode,
                             engine );
                         children.add( child );
                     }
                 }
                 else
                 {
-                    Entry newEntry = db.lookup( ( Long ) rec.getId() );
-                    EntryNode child = new EntryNode( ( Long ) rec.getId(), this, db, newEntry, map );
+                    Entry newEntry = db.lookup( rec.getId() );
+                    EntryNode child = new EntryNode( rec.getId(), this, db, newEntry, map );
                     children.add( child );
                 }
             }
@@ -219,7 +220,7 @@ public class EntryNode implements TreeNo
     }
 
 
-    public Long getEntryId()
+    public UUID getEntryId()
     {
         return id;
     }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=1199875&r1=1199874&r2=1199875&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Wed Nov  9 17:18:53 2011
@@ -86,10 +86,10 @@ public class IndexDialog<K, O, ID> exten
     private JLabel jLabel2 = new JLabel();
     private JButton scanBut = new JButton();
 
-    private Index<K, O, ID> index = null;
+    private Index<K> index = null;
 
 
-    public IndexDialog( Frame parent, boolean modal, Index<K, O, ID> index )
+    public IndexDialog( Frame parent, boolean modal, Index<K> index )
     {
         super( parent, modal );
         this.index = index;
@@ -97,7 +97,7 @@ public class IndexDialog<K, O, ID> exten
     }
 
 
-    public IndexDialog( Index<K, O, ID> index )
+    public IndexDialog( Index<K> index )
     {
         super();
         this.index = index;
@@ -287,7 +287,7 @@ public class IndexDialog<K, O, ID> exten
 
         try
         {
-            Cursor<IndexEntry<K, ID>> list;
+            Cursor<IndexEntry<K>> list;
 
             if ( scanType.equals( EQUALITY_CURSOR ) )
             {
@@ -295,7 +295,7 @@ public class IndexDialog<K, O, ID> exten
                 list.beforeFirst();
                 while ( list.next() )
                 {
-                    IndexEntry<K, ID> rec = list.get();
+                    IndexEntry<K> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -306,12 +306,12 @@ public class IndexDialog<K, O, ID> exten
             else if ( scanType.equals( GREATER_CURSOR ) )
             {
                 list = index.forwardCursor();
-                ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
+                ForwardIndexEntry<K> entry = new ForwardIndexEntry<K>();
                 entry.setValue( key );
                 list.before( entry );
                 while ( list.next() )
                 {
-                    IndexEntry<K, ID> rec = list.get();
+                    IndexEntry<K> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -322,12 +322,12 @@ public class IndexDialog<K, O, ID> exten
             else if ( scanType.equals( LESS_CURSOR ) )
             {
                 list = index.forwardCursor();
-                ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
+                ForwardIndexEntry<K> entry = new ForwardIndexEntry<K>();
                 entry.setValue( key );
                 list.after( entry );
                 while ( list.previous() )
                 {
-                    IndexEntry<K, ID> rec = list.get();
+                    IndexEntry<K> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();
@@ -360,7 +360,7 @@ public class IndexDialog<K, O, ID> exten
                 list = index.forwardCursor();
                 while ( list.next() )
                 {
-                    IndexEntry<K, ID> rec = list.get();
+                    IndexEntry<K> rec = list.get();
                     row = new Object[2];
                     row[0] = rec.getValue();
                     row[1] = rec.getId();



Mime
View raw message