You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/09/24 04:17:20 UTC

svn commit: r1389184 [13/13] - in /directory/apacheds/trunk: core-annotations/src/main/java/org/apache/directory/server/core/factory/ core-api/src/main/java/org/apache/directory/server/core/api/ core-api/src/main/java/org/apache/directory/server/core/a...

Modified: directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java?rev=1389184&r1=1389183&r2=1389184&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/SubstringTest.java Mon Sep 24 02:17:13 2012
@@ -30,13 +30,14 @@ import java.io.File;
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
-import org.apache.directory.server.xdbm.ForwardIndexEntry;
+import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.Store;
 import org.apache.directory.server.xdbm.StoreUtils;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
+import org.apache.directory.server.xdbm.search.cursor.SubstringCursor;
+import org.apache.directory.server.xdbm.search.evaluator.SubstringEvaluator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.SubstringNode;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -44,6 +45,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
+import org.apache.directory.shared.util.Strings;
 import org.apache.directory.shared.util.exception.Exceptions;
 import org.junit.After;
 import org.junit.Before;
@@ -63,7 +65,7 @@ public class SubstringTest
     private static final Logger LOG = LoggerFactory.getLogger( SubstringTest.class.getSimpleName() );
 
     File wkdir;
-    Store<Entry, Long> store;
+    Store store;
     static SchemaManager schemaManager = null;
 
 
@@ -153,8 +155,8 @@ public class SubstringTest
     public void testIndexedCnStartsWithJ() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -162,29 +164,29 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -196,33 +198,33 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -231,35 +233,35 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -268,33 +270,33 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
-        assertEquals( 11, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 11 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "johnny walker", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 8, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 8 ), cursor.get().getId() );
         assertEquals( "jack daniels", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -307,8 +309,8 @@ public class SubstringTest
     public void testIndexedCnStartsWithJim() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "jim", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -316,15 +318,15 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -333,19 +335,19 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -354,21 +356,21 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -377,19 +379,19 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -402,8 +404,8 @@ public class SubstringTest
     public void testIndexedCnEndsWithBean() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), null, "bean" );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -411,37 +413,37 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
         assertFalse( cursor.available() );
-        
+
         cursor.close();
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -450,21 +452,21 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -473,19 +475,19 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
-        assertEquals( 10, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 10 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 9, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 9 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "jim bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -498,8 +500,8 @@ public class SubstringTest
     public void testNonIndexedSnStartsWithB() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "b", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -507,7 +509,7 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -516,11 +518,11 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -529,13 +531,13 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -544,12 +546,12 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
         assertTrue( cursor.available() );
-        assertEquals( 6, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 6 ), cursor.get().getId() );
         assertEquals( "bean", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -562,8 +564,8 @@ public class SubstringTest
     public void testIndexedSnEndsWithEr() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), null, "er" );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        SubstringCursor<Long> cursor = new SubstringCursor<Long>( store, evaluator );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        SubstringCursor cursor = new SubstringCursor( store, evaluator );
 
         assertEquals( node, evaluator.getExpression() );
 
@@ -571,7 +573,7 @@ public class SubstringTest
 
         assertTrue( cursor.next() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -580,11 +582,11 @@ public class SubstringTest
 
         // ---------- test first ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.first();
 
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.next() );
@@ -593,13 +595,13 @@ public class SubstringTest
 
         // ---------- test afterLast ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.afterLast();
         assertFalse( cursor.available() );
 
         assertTrue( cursor.previous() );
         assertTrue( cursor.available() );
-        assertEquals( 5, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5 ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -608,12 +610,12 @@ public class SubstringTest
 
         // ---------- test last ----------
 
-        cursor = new SubstringCursor<Long>( store, evaluator );
+        cursor = new SubstringCursor( store, evaluator );
         cursor.last();
         assertTrue( cursor.available() );
 
         assertTrue( cursor.available() );
-        assertEquals( 5L, ( long ) cursor.get().getId() );
+        assertEquals( Strings.getUUID( 5L ), cursor.get().getId() );
         assertEquals( "walker", cursor.get().getKey() );
 
         assertFalse( cursor.previous() );
@@ -626,50 +628,50 @@ public class SubstringTest
     public void testNonIndexedAttributes() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "walk", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        ForwardIndexEntry<String, Long> indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 5L );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 5L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 3L );
+        indexEntry.setId( Strings.getUUID( 3L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 6L );
+        indexEntry.setId( Strings.getUUID( 6L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "wa", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 5L );
-        indexEntry.setEntry( store.lookup( 5L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 5L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 5L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "searchGuide" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "st" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "name" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "name" ), "s", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
     }
 
@@ -678,26 +680,26 @@ public class SubstringTest
     public void testEvaluatorIndexed() throws Exception
     {
         SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "jim", null );
-        SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        ForwardIndexEntry<String, Long> indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
+        SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+        IndexEntry<String, String> indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
-        indexEntry.setId( 3L );
+        indexEntry.setId( Strings.getUUID( 3L ) );
         indexEntry.setEntry( null );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
         node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "s", null );
-        evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-        indexEntry = new ForwardIndexEntry<String, Long>();
-        indexEntry.setId( 6L );
-        indexEntry.setEntry( store.lookup( 6L ) );
+        evaluator = new SubstringEvaluator( node, store, schemaManager );
+        indexEntry = new IndexEntry<String, String>();
+        indexEntry.setId( Strings.getUUID( 6L ) );
+        indexEntry.setEntry( store.lookup( Strings.getUUID( 6L ) ) );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
 
@@ -711,13 +713,13 @@ public class SubstringTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-    
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "b", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
             cursor.get();
         }
         finally
@@ -730,13 +732,13 @@ public class SubstringTest
     @Test(expected = InvalidCursorPositionException.class)
     public void testInvalidCursorPositionException2() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-        
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "cn" ), "j", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
             cursor.get();
         }
         finally
@@ -749,16 +751,16 @@ public class SubstringTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportBeforeWithoutIndex() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-        
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
-    
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
+
             // test before()
-            ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+            IndexEntry<String, String> entry = new IndexEntry<String, String>();
             entry.setKey( SchemaConstants.SN_AT_OID );
             cursor.before( entry );
         }
@@ -772,16 +774,16 @@ public class SubstringTest
     @Test(expected = UnsupportedOperationException.class)
     public void testUnsupportAfterWithoutIndex() throws Exception
     {
-        SubstringCursor<Long> cursor = null;
-        
+        SubstringCursor cursor = null;
+
         try
         {
             SubstringNode node = new SubstringNode( schemaManager.getAttributeType( "sn" ), "j", null );
-            SubstringEvaluator<Long> evaluator = new SubstringEvaluator<Long>( node, store, schemaManager );
-            cursor = new SubstringCursor<Long>( store, evaluator );
-    
+            SubstringEvaluator evaluator = new SubstringEvaluator( node, store, schemaManager );
+            cursor = new SubstringCursor( store, evaluator );
+
             // test before()
-            ForwardIndexEntry<String, Long> entry = new ForwardIndexEntry<String, Long>();
+            IndexEntry<String, String> entry = new IndexEntry<String, String>();
             entry.setKey( SchemaConstants.SN_AT_OID );
             cursor.after( entry );
         }

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java?rev=1389184&r1=1389183&r2=1389184&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/AttributesTableModel.java Mon Sep 24 02:17:13 2012
@@ -25,8 +25,8 @@ import java.util.ArrayList;
 import javax.swing.table.AbstractTableModel;
 
 import org.apache.directory.server.i18n.I18n;
-import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
 
 
@@ -52,7 +52,7 @@ public class AttributesTableModel extend
     private final ArrayList<Object> valList;
 
     /** the unique id of the entry  */
-    private final Long id;
+    private final String id;
 
     /** the distinguished name of the entry */
     private final String dn;
@@ -69,7 +69,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, String id, String dn, boolean isMutable )
     {
         this.dn = dn;
         this.id = id;
@@ -224,7 +224,7 @@ public class AttributesTableModel extend
      *
      * @return the unique id for the entry
      */
-    public Long getEntryId()
+    public String getEntryId()
     {
         return id;
     }

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java?rev=1389184&r1=1389183&r2=1389184&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java Mon Sep 24 02:17:13 2012
@@ -30,11 +30,10 @@ import java.util.Map;
 import javax.swing.tree.TreeNode;
 
 import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
-import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.server.xdbm.search.Evaluator;
 import org.apache.directory.server.xdbm.search.SearchEngine;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -51,16 +50,17 @@ public class EntryNode implements TreeNo
     private final EntryNode parent;
     private final Entry entry;
     private final ArrayList<TreeNode> children;
-    private final Long id;
+    private final String id;
 
 
-    public EntryNode( Long id, EntryNode parent, AbstractBTreePartition partition, Entry entry, Map<Long, EntryNode> map )
+    public EntryNode( String id, EntryNode parent, AbstractBTreePartition partition, Entry entry,
+        Map<String, 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( String id, EntryNode parent, AbstractBTreePartition db, Entry entry, Map<String, EntryNode> map,
         ExprNode exprNode, SearchEngine engine )
     {
         this.partition = db;
@@ -79,13 +79,13 @@ public class EntryNode implements TreeNo
 
         try
         {
-            List<ForwardIndexEntry> recordForwards = new ArrayList<ForwardIndexEntry>();
-            IndexCursor<Long, Entry, Long> childList = db.list( id );
+            List<IndexEntry> recordForwards = new ArrayList<IndexEntry>();
+            Cursor<IndexEntry<String, String>> childList = null; //db.list( id );
 
             while ( childList.next() )
             {
                 IndexEntry old = childList.get();
-                ForwardIndexEntry newRec = new ForwardIndexEntry();
+                IndexEntry newRec = new IndexEntry();
                 newRec.copy( old );
                 recordForwards.add( newRec );
             }
@@ -100,14 +100,14 @@ public class EntryNode implements TreeNo
 
                 if ( engine != null && exprNode != null )
                 {
-                    if ( db.getChildCount( ( Long ) rec.getId() ) == 0 )
+                    if ( db.getChildCount( ( String ) 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( ( String ) rec.getId() );
+                            EntryNode child = new EntryNode( ( String ) rec.getId(), this, db, newEntry, map, exprNode,
                                 engine );
                             children.add( child );
                         }
@@ -118,16 +118,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( ( String ) rec.getId() );
+                        EntryNode child = new EntryNode( ( String ) 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( ( String ) rec.getId() );
+                    EntryNode child = new EntryNode( ( String ) rec.getId(), this, db, newEntry, map );
                     children.add( child );
                 }
             }
@@ -155,7 +155,7 @@ public class EntryNode implements TreeNo
 
     public TreeNode getChildAt( int childIndex )
     {
-        return ( TreeNode ) children.get( childIndex );
+        return children.get( childIndex );
     }
 
 
@@ -219,7 +219,7 @@ public class EntryNode implements TreeNo
     }
 
 
-    public Long getEntryId()
+    public String getEntryId()
     {
         return id;
     }

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java?rev=1389184&r1=1389183&r2=1389184&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java Mon Sep 24 02:17:13 2012
@@ -46,7 +46,6 @@ import javax.swing.table.DefaultTableMod
 
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.directory.server.i18n.I18n;
-import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
@@ -306,7 +305,7 @@ public class IndexDialog<K, O, ID> exten
             else if ( scanType.equals( GREATER_CURSOR ) )
             {
                 list = index.forwardCursor();
-                ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
+                IndexEntry<K, ID> entry = new IndexEntry<K, ID>();
                 entry.setKey( key );
                 list.before( entry );
                 while ( list.next() )
@@ -322,7 +321,7 @@ public class IndexDialog<K, O, ID> exten
             else if ( scanType.equals( LESS_CURSOR ) )
             {
                 list = index.forwardCursor();
-                ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
+                IndexEntry<K, ID> entry = new IndexEntry<K, ID>();
                 entry.setKey( key );
                 list.after( entry );
                 while ( list.previous() )

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java?rev=1389184&r1=1389183&r2=1389184&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java Mon Sep 24 02:17:13 2012
@@ -59,11 +59,13 @@ import javax.swing.tree.TreeNode;
 import javax.swing.tree.TreePath;
 
 import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.IndexEntry;
+import org.apache.directory.server.xdbm.search.PartitionSearchResult;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -111,9 +113,9 @@ public class PartitionFrame extends JFra
     private JMenu indices = new JMenu();
 
     // Non Swing Stuff
-    private AbstractBTreePartition<Long> partition;
+    private AbstractBTreePartition partition;
     private boolean doCleanUp;
-    private Map<Long, EntryNode> nodes;
+    private Map<String, EntryNode> nodes;
     private EntryNode root;
 
     /** A handle on the global schemaManager */
@@ -126,7 +128,7 @@ public class PartitionFrame extends JFra
      * @param db the partition to view
      * @throws NamingException if there are problems accessing the partition
      */
-    public PartitionFrame( AbstractBTreePartition<Long> db, SchemaManager schemaManager ) throws Exception
+    public PartitionFrame( AbstractBTreePartition db, SchemaManager schemaManager ) throws Exception
     {
         partition = db;
         this.schemaManager = schemaManager;
@@ -649,13 +651,22 @@ public class PartitionFrame extends JFra
         }
 
         int limitMax = Integer.MAX_VALUE;
+
         if ( !limit.equals( FilterDialog.UNLIMITED ) )
         {
             limitMax = Integer.parseInt( limit );
         }
 
-        IndexCursor<Long, Entry, Long> cursor = partition.getSearchEngine().cursor( new Dn( base ),
-            AliasDerefMode.DEREF_ALWAYS, root, searchScope );
+        SearchOperationContext searchContext = new SearchOperationContext( null );
+        searchContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
+        searchContext.setDn( new Dn( base ) );
+        searchContext.setFilter( root );
+        searchContext.setScope( searchScope );
+
+        PartitionSearchResult searchResult = partition.getSearchEngine().computeResult( schemaManager, searchContext );
+
+        Cursor cursor = searchResult.getResultSet();
+
         String[] cols = new String[2];
         cols[0] = "id";
         cols[1] = "dn";
@@ -664,9 +675,9 @@ public class PartitionFrame extends JFra
         int count = 0;
         while ( cursor.next() && count < limitMax )
         {
-            IndexEntry rec = cursor.get();
+            IndexEntry rec = ( IndexEntry ) cursor.get();
             row[0] = rec.getId();
-            row[1] = partition.getEntryDn( ( Long ) row[0] ).getNormName();
+            row[1] = partition.getEntryDn( ( String ) row[0] ).getNormName();
             tableModel.addRow( row );
             count++;
         }
@@ -860,7 +871,7 @@ public class PartitionFrame extends JFra
     }
 
 
-    void displayEntry( Long id, Entry entry ) throws Exception
+    void displayEntry( String id, Entry entry ) throws Exception
     {
         String dn = partition.getEntryDn( id ).getName();
         AttributesTableModel model = new AttributesTableModel( entry, id, dn, false );
@@ -877,10 +888,10 @@ public class PartitionFrame extends JFra
     private void load() throws Exception
     {
         // boolean doFiltered = false;
-        nodes = new HashMap<Long, EntryNode>();
+        nodes = new HashMap<String, EntryNode>();
 
         Entry suffix = partition.lookup( partition.getEntryId( partition.getSuffixDn() ) );
-        Long id = partition.getEntryId( partition.getSuffixDn() );
+        String id = partition.getEntryId( partition.getSuffixDn() );
         root = new EntryNode( id, null, partition, suffix, nodes );
 
         /*

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java?rev=1389184&r1=1389183&r2=1389184&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexDialog.java Mon Sep 24 02:17:13 2012
@@ -46,7 +46,6 @@ import javax.swing.table.DefaultTableMod
 
 import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.directory.server.i18n.I18n;
-import org.apache.directory.server.xdbm.ForwardIndexEntry;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
@@ -308,7 +307,7 @@ public class IndexDialog<K, O, ID> exten
             else if ( scanType.equals( GREATER_CURSOR ) )
             {
                 list = index.forwardCursor();
-                ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
+                IndexEntry<K, ID> entry = new IndexEntry<K, ID>();
                 entry.setKey( key );
                 list.before( entry );
                 while ( list.next() )
@@ -324,7 +323,7 @@ public class IndexDialog<K, O, ID> exten
             else if ( scanType.equals( LESS_CURSOR ) )
             {
                 list = index.forwardCursor();
-                ForwardIndexEntry<K, ID> entry = new ForwardIndexEntry<K, ID>();
+                IndexEntry<K, ID> entry = new IndexEntry<K, ID>();
                 entry.setKey( key );
                 list.after( entry );
                 while ( list.previous() )

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java?rev=1389184&r1=1389183&r2=1389184&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java Mon Sep 24 02:17:13 2012
@@ -20,13 +20,13 @@
 package org.apache.directory.server.xdbm.tools;
 
 
-import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
-import org.apache.directory.shared.ldap.model.entry.Entry;
-
 import java.io.OutputStream;
 import java.io.PrintStream;
 
+import org.apache.directory.server.xdbm.Index;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
+import org.apache.directory.shared.ldap.model.entry.Entry;
+
 
 /**
  * Utility methods for Index objects.
@@ -58,7 +58,7 @@ public class IndexUtils
             out = new PrintStream( outputStream );
         }
 
-        IndexCursor<?, Entry, Long> cursor = idx.forwardCursor();
+        Cursor cursor = idx.forwardCursor();
         cursor.first();
         for ( Object entry : cursor )
         {