directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r917312 [2/5] - in /directory/apacheds/trunk: avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ avl-partition/src/test/java/org/apache/directory/server/core/partition/avl/ core-annotations/src/main/java/org/apache/...
Date Sun, 28 Feb 2010 22:55:35 GMT
Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Sun Feb 28 22:55:33 2010
@@ -89,7 +89,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class LdifPartition extends BTreePartition
+public class LdifPartition extends BTreePartition<Long>
 {
     /** A logger for this class */
     private static Logger LOG = LoggerFactory.getLogger( LdifPartition.class );
@@ -408,11 +408,11 @@
         add( modifiedEntry );
 
         // Then, if there are some children, move then to the new place
-        IndexCursor<Long, ServerEntry> cursor = getSubLevelIndex().forwardCursor( entryIdOld );
+        IndexCursor<Long, ServerEntry, Long> cursor = getSubLevelIndex().forwardCursor( entryIdOld );
 
         while ( cursor.next() )
         {
-            IndexEntry<Long, ServerEntry> entry = cursor.get();
+            IndexEntry<Long, ServerEntry, Long> entry = cursor.get();
 
             // except the parent entry add the rest of entries
             if ( entry.getId() != entryIdOld )
@@ -759,7 +759,7 @@
 
 
     @Override
-    public void addIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public void addIndexOn( Index<? extends Object, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.addIndexOn( index );
     }
@@ -780,7 +780,7 @@
 
 
     @Override
-    public Index<String, ServerEntry> getAliasIndex()
+    public Index<String, ServerEntry, Long> getAliasIndex()
     {
         return wrappedPartition.getAliasIndex();
     }
@@ -822,21 +822,21 @@
 
 
     @Override
-    public Index<String, ServerEntry> getNdnIndex()
+    public Index<String, ServerEntry, Long> getNdnIndex()
     {
         return wrappedPartition.getNdnIndex();
     }
 
 
     @Override
-    public Index<Long, ServerEntry> getOneAliasIndex()
+    public Index<Long, ServerEntry, Long> getOneAliasIndex()
     {
         return wrappedPartition.getOneAliasIndex();
     }
 
 
     @Override
-    public Index<Long, ServerEntry> getOneLevelIndex()
+    public Index<Long, ServerEntry, Long> getOneLevelIndex()
     {
         return wrappedPartition.getOneLevelIndex();
     }
@@ -857,7 +857,7 @@
 
 
     @Override
-    public Index<String, ServerEntry> getPresenceIndex()
+    public Index<String, ServerEntry, Long> getPresenceIndex()
     {
         return wrappedPartition.getPresenceIndex();
     }
@@ -871,21 +871,21 @@
 
 
     @Override
-    public Index<Long, ServerEntry> getSubAliasIndex()
+    public Index<Long, ServerEntry, Long> getSubAliasIndex()
     {
         return wrappedPartition.getSubAliasIndex();
     }
 
 
     @Override
-    public Index<Long, ServerEntry> getSubLevelIndex()
+    public Index<Long, ServerEntry, Long> getSubLevelIndex()
     {
         return wrappedPartition.getSubLevelIndex();
     }
 
 
     @Override
-    public Index<?, ServerEntry> getSystemIndex( String id ) throws Exception
+    public Index<?, ServerEntry, Long> getSystemIndex( String id ) throws Exception
     {
         return wrappedPartition.getSystemIndex( id );
     }
@@ -899,14 +899,14 @@
 
 
     @Override
-    public Index<String, ServerEntry> getUpdnIndex()
+    public Index<String, ServerEntry, Long> getUpdnIndex()
     {
         return wrappedPartition.getUpdnIndex();
     }
 
 
     @Override
-    public Index<?, ServerEntry> getUserIndex( String id ) throws Exception
+    public Index<? extends Object, ServerEntry, Long> getUserIndex( String id ) throws Exception
     {
         return wrappedPartition.getUserIndex( id );
     }
@@ -941,7 +941,7 @@
 
 
     @Override
-    public IndexCursor<Long, ServerEntry> list( Long id ) throws Exception
+    public IndexCursor<Long, ServerEntry, Long> list( Long id ) throws Exception
     {
         return wrappedPartition.list( id );
     }
@@ -955,35 +955,35 @@
 
 
     @Override
-    public void setAliasIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public void setAliasIndexOn( Index<String, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.setAliasIndexOn( index );
     }
 
 
     @Override
-    public void setNdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public void setNdnIndexOn( Index<String, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.setNdnIndexOn( index );
     }
 
 
     @Override
-    public void setOneAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public void setOneAliasIndexOn( Index<Long, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.setOneAliasIndexOn( index );
     }
 
 
     @Override
-    public void setOneLevelIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public void setOneLevelIndexOn( Index<Long, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.setOneLevelIndexOn( index );
     }
 
 
     @Override
-    public void setPresenceIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public void setPresenceIndexOn( Index<String, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.setPresenceIndexOn( index );
     }
@@ -1004,14 +1004,14 @@
 
 
     @Override
-    public void setSubAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public void setSubAliasIndexOn( Index<Long, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.setSubAliasIndexOn( index );
     }
 
 
     @Override
-    public void setUpdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public void setUpdnIndexOn( Index<String, ServerEntry, Long> index ) throws Exception
     {
         wrappedPartition.setUpdnIndexOn( index );
     }

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifStore.java Sun Feb 28 22:55:33 2010
@@ -54,7 +54,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class LdifStore<E> implements Store<E>
+public class LdifStore<E> implements Store<E, Long>
 {
 
     /** the working directory to use for files */
@@ -293,7 +293,7 @@
     }
 
 
-    public void addIndex( Index<?, E> index ) throws Exception
+    public void addIndex( Index<?, E, Long> index ) throws Exception
     {
         wrappedStore.addIndex( index );
     }
@@ -305,7 +305,7 @@
     }
 
 
-    public Index<String, E> getAliasIndex()
+    public Index<String, E, Long> getAliasIndex()
     {
         return wrappedStore.getAliasIndex();
     }
@@ -347,19 +347,19 @@
     }
 
 
-    public Index<String, E> getNdnIndex()
+    public Index<String, E, Long> getNdnIndex()
     {
         return wrappedStore.getNdnIndex();
     }
 
 
-    public Index<Long, E> getOneAliasIndex()
+    public Index<Long, E, Long> getOneAliasIndex()
     {
         return wrappedStore.getOneAliasIndex();
     }
 
 
-    public Index<Long, E> getOneLevelIndex()
+    public Index<Long, E, Long> getOneLevelIndex()
     {
         return wrappedStore.getOneLevelIndex();
     }
@@ -377,7 +377,7 @@
     }
 
 
-    public Index<String, E> getPresenceIndex()
+    public Index<String, E, Long> getPresenceIndex()
     {
         return wrappedStore.getPresenceIndex();
     }
@@ -389,37 +389,37 @@
     }
 
 
-    public Index<Long, E> getSubAliasIndex()
+    public Index<Long, E, Long> getSubAliasIndex()
     {
         return wrappedStore.getSubAliasIndex();
     }
 
 
-    public Index<Long, E> getSubLevelIndex()
+    public Index<Long, E, Long> getSubLevelIndex()
     {
         return wrappedStore.getSubLevelIndex();
     }
 
 
-    public Index<?, E> getSystemIndex( String id ) throws IndexNotFoundException
+    public Index<?, E, Long> getSystemIndex( String id ) throws IndexNotFoundException
     {
         return wrappedStore.getSystemIndex( id );
     }
 
 
-    public Index<String, E> getUpdnIndex()
+    public Index<String, E, Long> getUpdnIndex()
     {
         return wrappedStore.getUpdnIndex();
     }
 
 
-    public Index<?, E> getUserIndex( String id ) throws IndexNotFoundException
+    public Index<?, E, Long> getUserIndex( String id ) throws IndexNotFoundException
     {
         return wrappedStore.getUserIndex( id );
     }
 
 
-    public Set<Index<?, E>> getUserIndices()
+    public Set<Index<?, E, Long>> getUserIndices()
     {
         return wrappedStore.getUserIndices();
     }
@@ -443,7 +443,7 @@
     }
 
 
-    public IndexCursor<Long, E> list( Long id ) throws Exception
+    public IndexCursor<Long, E, Long> list( Long id ) throws Exception
     {
         return wrappedStore.list( id );
     }
@@ -455,7 +455,7 @@
     }
 
 
-    public void setAliasIndex( Index<String, E> index ) throws Exception
+    public void setAliasIndex( Index<String, E, Long> index ) throws Exception
     {
         wrappedStore.setAliasIndex( index );
     }
@@ -467,25 +467,25 @@
     }
 
 
-    public void setNdnIndex( Index<String, E> index ) throws Exception
+    public void setNdnIndex( Index<String, E, Long> index ) throws Exception
     {
         wrappedStore.setNdnIndex( index );
     }
 
 
-    public void setOneAliasIndex( Index<Long, E> index ) throws Exception
+    public void setOneAliasIndex( Index<Long, E, Long> index ) throws Exception
     {
         wrappedStore.setOneAliasIndex( index );
     }
 
 
-    public void setOneLevelIndex( Index<Long, E> index ) throws Exception
+    public void setOneLevelIndex( Index<Long, E, Long> index ) throws Exception
     {
         wrappedStore.setOneLevelIndex( index );
     }
 
 
-    public void setPresenceIndex( Index<String, E> index ) throws Exception
+    public void setPresenceIndex( Index<String, E, Long> index ) throws Exception
     {
         wrappedStore.setPresenceIndex( index );
     }
@@ -497,19 +497,19 @@
     }
 
 
-    public void setSubAliasIndex( Index<Long, E> index ) throws Exception
+    public void setSubAliasIndex( Index<Long, E, Long> index ) throws Exception
     {
         wrappedStore.setSubAliasIndex( index );
     }
 
 
-    public void setSubLevelIndex( Index<Long, E> index ) throws Exception
+    public void setSubLevelIndex( Index<Long, E, Long> index ) throws Exception
     {
         wrappedStore.setSubLevelIndex( index );
     }
 
 
-    public void setUpdnIndex( Index<String, E> index ) throws Exception
+    public void setUpdnIndex( Index<String, E, Long> index ) throws Exception
     {
         wrappedStore.setUpdnIndex( index );
     }
@@ -534,19 +534,19 @@
     }
 
 
-    public Index<String, E> getEntryCsnIndex()
+    public Index<String, E, Long> getEntryCsnIndex()
     {
         return wrappedStore.getEntryCsnIndex();
     }
 
 
-    public Index<String, E> getEntryUuidIndex()
+    public Index<String, E, Long> getEntryUuidIndex()
     {
         return wrappedStore.getEntryUuidIndex();
     }
 
 
-    public Index<String, E> getObjectClassIndex()
+    public Index<String, E, Long> getObjectClassIndex()
     {
         return wrappedStore.getObjectClassIndex();
     }
@@ -576,7 +576,7 @@
     }
 
 
-    public void setUserIndices( Set<Index<?, E>> userIndices )
+    public void setUserIndices( Set<Index<?, E, Long>> userIndices )
     {
         wrappedStore.setUserIndices( userIndices );
     }
@@ -588,20 +588,27 @@
     }
 
 
-    public void setEntryCsnIndex( Index<String, E> index ) throws Exception
+    public void setEntryCsnIndex( Index<String, E, Long> index ) throws Exception
     {
         wrappedStore.setEntryCsnIndex( index );
     }
 
 
-    public void setEntryUuidIndex( Index<String, E> index ) throws Exception
+    public void setEntryUuidIndex( Index<String, E, Long> index ) throws Exception
     {
         wrappedStore.setEntryUuidIndex( index );
     }
 
 
-    public void setObjectClassIndex( Index<String, E> index ) throws Exception
+    public void setObjectClassIndex( Index<String, E, Long> index ) throws Exception
     {
         wrappedStore.setObjectClassIndex( index );
     }
+
+
+    public Long getDefaultId()
+    {
+        return 1L;
+    }
+
 }

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Sun Feb 28 22:55:33 2010
@@ -63,7 +63,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public abstract class BTreePartition implements Partition
+public abstract class BTreePartition<ID> implements Partition
 {
     protected static final Set<String> SYS_INDEX_OIDS;
 
@@ -84,7 +84,7 @@
     }
 
     /** the search engine used to search the database */
-    protected SearchEngine<ServerEntry> searchEngine;
+    protected SearchEngine<ServerEntry, ID> searchEngine;
     protected Optimizer optimizer;
 
     protected SchemaManager schemaManager;
@@ -96,7 +96,7 @@
 
     /** The rootDSE context */
     protected ServerEntry contextEntry;
-    private Set<Index<?, ServerEntry>> indexedAttributes;
+    private Set<Index<? extends Object, ServerEntry, ID>> indexedAttributes;
 
 
     // ------------------------------------------------------------------------
@@ -108,7 +108,7 @@
      */
     protected BTreePartition()
     {
-        indexedAttributes = new HashSet<Index<?, ServerEntry>>();
+        indexedAttributes = new HashSet<Index<? extends Object, ServerEntry, ID>>();
     }
 
 
@@ -156,22 +156,22 @@
     }
 
 
-    public void setIndexedAttributes( Set<Index<?, ServerEntry>> indexedAttributes )
+    public void setIndexedAttributes( Set<Index<? extends Object, ServerEntry, ID>> indexedAttributes )
     {
         this.indexedAttributes = indexedAttributes;
     }
 
 
-    public void addIndexedAttributes( Index<?, ServerEntry>... indexes )
+    public void addIndexedAttributes( Index<? extends Object, ServerEntry, ID>... indexes )
     {
-        for ( Index<?, ServerEntry> index : indexes )
+        for ( Index<? extends Object, ServerEntry, ID> index : indexes )
         {
             indexedAttributes.add( index );
         }
     }
 
 
-    public Set<Index<?, ServerEntry>> getIndexedAttributes()
+    public Set<Index<? extends Object, ServerEntry, ID>> getIndexedAttributes()
     {
         return indexedAttributes;
     }
@@ -237,7 +237,7 @@
      *
      * @return the search engine
      */
-    public SearchEngine<ServerEntry> getSearchEngine()
+    public SearchEngine<ServerEntry, ID> getSearchEngine()
     {
         return searchEngine;
     }
@@ -254,7 +254,7 @@
     {
         LdapDN dn = opContext.getDn();
 
-        Long id = getEntryId( dn.getNormName() );
+        ID id = getEntryId( dn.getNormName() );
 
         // don't continue if id is null
         if ( id == null )
@@ -281,26 +281,26 @@
 
     public EntryFilteringCursor list( ListOperationContext opContext ) throws Exception
     {
-        return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor( this, list( getEntryId( opContext.getDn()
-            .getNormName() ) ) ), opContext );
+        return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor<ID>( this, list( getEntryId( opContext
+            .getDn().getNormName() ) ) ), opContext );
     }
 
 
     public EntryFilteringCursor search( SearchOperationContext opContext ) throws Exception
     {
         SearchControls searchCtls = opContext.getSearchControls();
-        IndexCursor<Long, ServerEntry> underlying;
+        IndexCursor<ID, ServerEntry, ID> underlying;
 
         underlying = searchEngine.cursor( opContext.getDn(), opContext.getAliasDerefMode(), opContext.getFilter(),
             searchCtls );
 
-        return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor( this, underlying ), opContext );
+        return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor<ID>( this, underlying ), opContext );
     }
 
 
     public ClonedServerEntry lookup( LookupOperationContext opContext ) throws Exception
     {
-        Long id = getEntryId( opContext.getDn().getNormName() );
+        ID id = getEntryId( opContext.getDn().getNormName() );
 
         if ( id == null )
         {
@@ -357,7 +357,7 @@
     // Index Operations 
     // ------------------------------------------------------------------------
 
-    public abstract void addIndexOn( Index<Long, ServerEntry> index ) throws Exception;
+    public abstract void addIndexOn( Index<? extends Object, ServerEntry, ID> index ) throws Exception;
 
 
     public abstract boolean hasUserIndexOn( String attribute ) throws Exception;
@@ -366,25 +366,25 @@
     public abstract boolean hasSystemIndexOn( String attribute ) throws Exception;
 
 
-    public abstract Index<String, ServerEntry> getPresenceIndex();
+    public abstract Index<String, ServerEntry, ID> getPresenceIndex();
 
 
     /**
-     * Gets the Index mapping the Long primary keys of parents to the 
-     * Long primary keys of their children.
+     * Gets the Index mapping the primary keys of parents to the 
+     * primary keys of their children.
      *
      * @return the one level Index
      */
-    public abstract Index<Long, ServerEntry> getOneLevelIndex();
+    public abstract Index<ID, ServerEntry, ID> getOneLevelIndex();
 
 
     /**
-     * Gets the Index mapping the Long primary keys of ancestors to the 
-     * Long primary keys of their descendants.
+     * Gets the Index mapping the primary keys of ancestors to the 
+     * primary keys of their descendants.
      *
      * @return the sub tree level Index
      */
-    public abstract Index<Long, ServerEntry> getSubLevelIndex();
+    public abstract Index<ID, ServerEntry, ID> getSubLevelIndex();
 
 
     /**
@@ -393,7 +393,7 @@
      *
      * @return the user provided distinguished name Index
      */
-    public abstract Index<String, ServerEntry> getUpdnIndex();
+    public abstract Index<String, ServerEntry, ID> getUpdnIndex();
 
 
     /**
@@ -402,7 +402,7 @@
      *
      * @return the normalized distinguished name Index
      */
-    public abstract Index<String, ServerEntry> getNdnIndex();
+    public abstract Index<String, ServerEntry, ID> getNdnIndex();
 
 
     /**
@@ -412,7 +412,7 @@
      * 
      * @return the one alias index
      */
-    public abstract Index<Long, ServerEntry> getOneAliasIndex();
+    public abstract Index<ID, ServerEntry, ID> getOneAliasIndex();
 
 
     /**
@@ -422,7 +422,7 @@
      * 
      * @return the sub alias index
      */
-    public abstract Index<Long, ServerEntry> getSubAliasIndex();
+    public abstract Index<ID, ServerEntry, ID> getSubAliasIndex();
 
 
     /**
@@ -431,7 +431,7 @@
      * 
      * @return the index on the ALIAS_ATTRIBUTE
      */
-    public abstract Index<String, ServerEntry> getAliasIndex();
+    public abstract Index<String, ServerEntry, ID> getAliasIndex();
 
 
     /**
@@ -442,7 +442,7 @@
      * @param index the index on the ALIAS_ATTRIBUTE
      * @throws Exception if there is a problem setting up the index
      */
-    public abstract void setAliasIndexOn( Index<String, ServerEntry> index ) throws Exception;
+    public abstract void setAliasIndexOn( Index<String, ServerEntry, ID> index ) throws Exception;
 
 
     /**
@@ -452,7 +452,7 @@
      * @param index the attribute existence Index
      * @throws Exception if there is a problem setting up the index
      */
-    public abstract void setPresenceIndexOn( Index<String, ServerEntry> index ) throws Exception;
+    public abstract void setPresenceIndexOn( Index<String, ServerEntry, ID> index ) throws Exception;
 
 
     /**
@@ -462,7 +462,7 @@
      * @param index the one level Index
      * @throws Exception if there is a problem setting up the index
      */
-    public abstract void setOneLevelIndexOn( Index<Long, ServerEntry> index ) throws Exception;
+    public abstract void setOneLevelIndexOn( Index<ID, ServerEntry, ID> index ) throws Exception;
 
 
     // TODO - add sub level index setter
@@ -474,7 +474,7 @@
      * @param index the updn Index
      * @throws Exception if there is a problem setting up the index
      */
-    public abstract void setUpdnIndexOn( Index<String, ServerEntry> index ) throws Exception;
+    public abstract void setUpdnIndexOn( Index<String, ServerEntry, ID> index ) throws Exception;
 
 
     /**
@@ -484,7 +484,7 @@
      * @param index the ndn Index
      * @throws Exception if there is a problem setting up the index
      */
-    public abstract void setNdnIndexOn( Index<String, ServerEntry> index ) throws Exception;
+    public abstract void setNdnIndexOn( Index<String, ServerEntry, ID> index ) throws Exception;
 
 
     /**
@@ -496,7 +496,7 @@
      * @param index a one level alias index
      * @throws Exception if there is a problem setting up the index
      */
-    public abstract void setOneAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception;
+    public abstract void setOneAliasIndexOn( Index<ID, ServerEntry, ID> index ) throws Exception;
 
 
     /**
@@ -508,7 +508,7 @@
      * @param index a subtree alias index
      * @throws Exception if there is a problem setting up the index
      */
-    public abstract void setSubAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception;
+    public abstract void setSubAliasIndexOn( Index<ID, ServerEntry, ID> index ) throws Exception;
 
 
     /**
@@ -538,22 +538,22 @@
     }
 
 
-    public abstract Index<?, ServerEntry> getUserIndex( String attribute ) throws Exception;
+    public abstract Index<? extends Object, ServerEntry, ID> getUserIndex( String attribute ) throws Exception;
 
 
-    public abstract Index<?, ServerEntry> getSystemIndex( String attribute ) throws Exception;
+    public abstract Index<? extends Object, ServerEntry, ID> getSystemIndex( String attribute ) throws Exception;
 
 
-    public abstract Long getEntryId( String dn ) throws Exception;
+    public abstract ID getEntryId( String dn ) throws Exception;
 
 
-    public abstract String getEntryDn( Long id ) throws Exception;
+    public abstract String getEntryDn( ID id ) throws Exception;
 
 
-    public abstract Long getParentId( String dn ) throws Exception;
+    public abstract ID getParentId( String dn ) throws Exception;
 
 
-    public abstract Long getParentId( Long childId ) throws Exception;
+    public abstract ID getParentId( ID childId ) throws Exception;
 
 
     /**
@@ -563,7 +563,7 @@
      * @return the user provided distinguished name
      * @throws Exception if the updn index cannot be accessed
      */
-    public abstract String getEntryUpdn( Long id ) throws Exception;
+    public abstract String getEntryUpdn( ID id ) throws Exception;
 
 
     /**
@@ -576,16 +576,16 @@
     public abstract String getEntryUpdn( String dn ) throws Exception;
 
 
-    public abstract ClonedServerEntry lookup( Long id ) throws Exception;
+    public abstract ClonedServerEntry lookup( ID id ) throws Exception;
 
 
-    public abstract void delete( Long id ) throws Exception;
+    public abstract void delete( ID id ) throws Exception;
 
 
-    public abstract IndexCursor<Long, ServerEntry> list( Long id ) throws Exception;
+    public abstract IndexCursor<ID, ServerEntry, ID> list( ID id ) throws Exception;
 
 
-    public abstract int getChildCount( Long id ) throws Exception;
+    public abstract int getChildCount( ID id ) throws Exception;
 
 
     public abstract void setProperty( String key, String value ) throws Exception;

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultTupleComparator.java Sun Feb 28 22:55:33 2010
@@ -31,6 +31,8 @@
  */
 public class DefaultTupleComparator<K, V> implements TupleComparator<K, V>
 {
+    private static final long serialVersionUID = -6639792479317762334L;
+
     SerializableComparator<K> keyComparator;
     SerializableComparator<V> valueComparator;
 

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java Sun Feb 28 22:55:33 2010
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface IndexAssertion<K, E>
+public interface IndexAssertion<K, E, ID>
 {
     /**
      * Tests to see if a perspective candidate should be returned based on 
@@ -47,5 +47,5 @@
      * @throws NamingException if their are failures while asserting the 
      * condition
      */
-    boolean assertCandidate( IndexEntry<K, E> entry ) throws Exception;
+    boolean assertCandidate( IndexEntry<K, E, ID> entry ) throws Exception;
 }

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexCursorAdaptor.java Sun Feb 28 22:55:33 2010
@@ -40,12 +40,12 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class IndexCursorAdaptor<K, O> implements IndexCursor<K, O>
+public class IndexCursorAdaptor<K, O, ID> implements IndexCursor<K, O, ID>
 {
     @SuppressWarnings("unchecked")
     final Cursor<Tuple> wrappedCursor;
-    final ForwardIndexEntry<K, O> forwardEntry;
-    final ReverseIndexEntry<K, O> reverseEntry;
+    final ForwardIndexEntry<K, O, ID> forwardEntry;
+    final ReverseIndexEntry<K, O, ID> reverseEntry;
 
 
     /**
@@ -62,13 +62,13 @@
         this.wrappedCursor = wrappedCursor;
         if ( forwardIndex )
         {
-            forwardEntry = new ForwardIndexEntry<K, O>();
+            forwardEntry = new ForwardIndexEntry<K, O, ID>();
             reverseEntry = null;
         }
         else
         {
             forwardEntry = null;
-            reverseEntry = new ReverseIndexEntry<K, O>();
+            reverseEntry = new ReverseIndexEntry<K, O, ID>();
         }
     }
 
@@ -80,7 +80,7 @@
 
 
     @SuppressWarnings("unchecked")
-    public void beforeValue( Long id, K key ) throws Exception
+    public void beforeValue( ID id, K key ) throws Exception
     {
         if ( wrappedCursor instanceof TupleCursor )
         {
@@ -90,7 +90,7 @@
 
 
     @SuppressWarnings("unchecked")
-    public void afterValue( Long id, K key ) throws Exception
+    public void afterValue( ID id, K key ) throws Exception
     {
         if ( wrappedCursor instanceof TupleCursor )
         {
@@ -99,13 +99,13 @@
     }
 
 
-    public void before( IndexEntry<K, O> element ) throws Exception
+    public void before( IndexEntry<K, O, ID> element ) throws Exception
     {
         wrappedCursor.before( element.getTuple() );
     }
 
 
-    public void after( IndexEntry<K, O> element ) throws Exception
+    public void after( IndexEntry<K, O, ID> element ) throws Exception
     {
         wrappedCursor.after( element.getTuple() );
     }
@@ -154,17 +154,17 @@
 
 
     @SuppressWarnings("unchecked")
-    public IndexEntry<K, O> get() throws Exception
+    public IndexEntry<K, O, ID> get() throws Exception
     {
         if ( forwardEntry != null )
         {
-            Tuple<K, Long> tuple = wrappedCursor.get();
+            Tuple<K, ID> tuple = wrappedCursor.get();
             forwardEntry.setTuple( tuple, null );
             return forwardEntry;
         }
         else
         {
-            Tuple<Long, K> tuple = wrappedCursor.get();
+            Tuple<ID, K> tuple = wrappedCursor.get();
             reverseEntry.setTuple( tuple, null );
             return reverseEntry;
         }
@@ -195,8 +195,8 @@
     }
 
 
-    public Iterator<IndexEntry<K, O>> iterator()
+    public Iterator<IndexEntry<K, O, ID>> iterator()
     {
-        return new CursorIterator<IndexEntry<K, O>>( this );
+        return new CursorIterator<IndexEntry<K, O, ID>>( this );
     }
 }

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ServerEntryCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ServerEntryCursorAdaptor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ServerEntryCursorAdaptor.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ServerEntryCursorAdaptor.java Sun Feb 28 22:55:33 2010
@@ -23,7 +23,6 @@
 import java.util.Iterator;
 
 import org.apache.directory.server.core.entry.ServerEntry;
-import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.xdbm.IndexCursor;
 import org.apache.directory.server.xdbm.IndexEntry;
 import org.apache.directory.shared.ldap.cursor.ClosureMonitor;
@@ -37,13 +36,13 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ServerEntryCursorAdaptor implements Cursor<ServerEntry>
+public class ServerEntryCursorAdaptor<ID> implements Cursor<ServerEntry>
 {
-    private final Partition db;
-    private final IndexCursor<Long, ServerEntry> indexCursor;
+    private final BTreePartition<ID> db;
+    private final IndexCursor<ID, ServerEntry, ID> indexCursor;
 
 
-    public ServerEntryCursorAdaptor( Partition db, IndexCursor<Long, ServerEntry> indexCursor )
+    public ServerEntryCursorAdaptor( BTreePartition<ID> db, IndexCursor<ID, ServerEntry, ID> indexCursor )
     {
         this.db = db;
         this.indexCursor = indexCursor;
@@ -133,7 +132,7 @@
      */
     public ServerEntry get() throws Exception
     {
-        IndexEntry<Long, ServerEntry> indexEntry = indexCursor.get();
+        IndexEntry<ID, ServerEntry, ID> indexEntry = indexCursor.get();
 
         if ( indexEntry.getObject() == null )
         {

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/core/partition/impl/btree/ValueArrayCursor.java Sun Feb 28 22:55:33 2010
@@ -19,15 +19,15 @@
 package org.apache.directory.server.core.partition.impl.btree;
 
 
+import java.util.Arrays;
+import java.util.List;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.xdbm.Tuple;
 import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.cursor.InvalidCursorPositionException;
 
-import java.util.Arrays;
-import java.util.List;
-
 
 /**
  * A Cursor which returns the values of a single key as Tuples.
@@ -35,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ValueArrayCursor<K, V> extends AbstractCursor<Tuple>
+public class ValueArrayCursor<K, V> extends AbstractCursor<Tuple<K, V>>
 {
     private static final int BEFORE_FIRST = -1;
 
@@ -68,13 +68,13 @@
     }
 
 
-    public void before( Tuple element ) throws Exception
+    public void before( Tuple<K, V> element ) throws Exception
     {
         throw new NotImplementedException();
     }
 
 
-    public void after( Tuple element ) throws Exception
+    public void after( Tuple<K, V> element ) throws Exception
     {
         throw new NotImplementedException();
     }
@@ -190,7 +190,7 @@
     }
 
 
-    public Tuple get() throws Exception
+    public Tuple<K, V> get() throws Exception
     {
         checkNotClosed( "get()" );
         if ( inRangeOnValue() )

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java Sun Feb 28 22:55:33 2010
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public abstract class AbstractIndexCursor<K, E> implements IndexCursor<K, E>
+public abstract class AbstractIndexCursor<K, E, ID> implements IndexCursor<K, E, ID>
 {
     private ClosureMonitor monitor = new DefaultClosureMonitor();
 
@@ -73,8 +73,8 @@
     }
 
 
-    public Iterator<IndexEntry<K, E>> iterator()
+    public Iterator<IndexEntry<K, E, ID>> iterator()
     {
-        return new CursorIterator<IndexEntry<K, E>>( this );
+        return new CursorIterator<IndexEntry<K, E, ID>>( this );
     }
 }
\ No newline at end of file

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/AbstractXdbmPartition.java Sun Feb 28 22:55:33 2010
@@ -47,16 +47,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class AbstractXdbmPartition extends BTreePartition
+public abstract class AbstractXdbmPartition<ID> extends BTreePartition<ID>
 {
 
     protected boolean optimizerEnabled = true;
 
     /** The store. */
-    protected Store<ServerEntry> store;
+    protected Store<ServerEntry, ID> store;
 
 
-    protected AbstractXdbmPartition( Store<ServerEntry> store )
+    protected AbstractXdbmPartition( Store<ServerEntry, ID> store )
     {
         this.store = store;
     }
@@ -121,13 +121,13 @@
     // I N D E X   M E T H O D S
     // ------------------------------------------------------------------------
 
-    public final void addIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public final void addIndexOn( Index<? extends Object, ServerEntry, ID> index ) throws Exception
     {
         store.addIndex( index );
     }
 
 
-    public final Index<String, ServerEntry> getExistenceIndex()
+    public final Index<String, ServerEntry, ID> getExistenceIndex()
     {
         return store.getPresenceIndex();
     }
@@ -136,13 +136,13 @@
     /**
      * @org.apache.xbean.Property hidden="true"
      */
-    public final void setPresenceIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public final void setPresenceIndexOn( Index<String, ServerEntry, ID> index ) throws Exception
     {
         store.setPresenceIndex( index );
     }
 
 
-    public final Index<Long, ServerEntry> getOneLevelIndex()
+    public final Index<ID, ServerEntry, ID> getOneLevelIndex()
     {
         return store.getOneLevelIndex();
     }
@@ -151,13 +151,13 @@
     /**
      * @org.apache.xbean.Property hidden="true"
      */
-    public final void setOneLevelIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public final void setOneLevelIndexOn( Index<ID, ServerEntry, ID> index ) throws Exception
     {
         store.setOneLevelIndex( index );
     }
 
 
-    public final Index<String, ServerEntry> getAliasIndex()
+    public final Index<String, ServerEntry, ID> getAliasIndex()
     {
         return store.getAliasIndex();
     }
@@ -166,13 +166,13 @@
     /**
      * @org.apache.xbean.Property hidden="true"
      */
-    public final void setAliasIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public final void setAliasIndexOn( Index<String, ServerEntry, ID> index ) throws Exception
     {
         store.setAliasIndex( index );
     }
 
 
-    public final Index<Long, ServerEntry> getOneAliasIndex()
+    public final Index<ID, ServerEntry, ID> getOneAliasIndex()
     {
         return store.getOneAliasIndex();
     }
@@ -181,13 +181,13 @@
     /**
      * @org.apache.xbean.Property hidden="true"
      */
-    public final void setOneAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public final void setOneAliasIndexOn( Index<ID, ServerEntry, ID> index ) throws Exception
     {
-        store.setOneAliasIndex( ( Index<Long, ServerEntry> ) index );
+        store.setOneAliasIndex( index );
     }
 
 
-    public final Index<Long, ServerEntry> getSubAliasIndex()
+    public final Index<ID, ServerEntry, ID> getSubAliasIndex()
     {
         return store.getSubAliasIndex();
     }
@@ -196,13 +196,13 @@
     /**
      * @org.apache.xbean.Property hidden="true"
      */
-    public final void setSubAliasIndexOn( Index<Long, ServerEntry> index ) throws Exception
+    public final void setSubAliasIndexOn( Index<ID, ServerEntry, ID> index ) throws Exception
     {
-        store.setSubAliasIndex( ( Index<Long, ServerEntry> ) index );
+        store.setSubAliasIndex( index );
     }
 
 
-    public final Index<String, ServerEntry> getUpdnIndex()
+    public final Index<String, ServerEntry, ID> getUpdnIndex()
     {
         return store.getUpdnIndex();
     }
@@ -211,13 +211,13 @@
     /**
      * @org.apache.xbean.Property hidden="true"
      */
-    public final void setUpdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public final void setUpdnIndexOn( Index<String, ServerEntry, ID> index ) throws Exception
     {
-        store.setUpdnIndex( ( Index<String, ServerEntry> ) index );
+        store.setUpdnIndex( index );
     }
 
 
-    public final Index<String, ServerEntry> getNdnIndex()
+    public final Index<String, ServerEntry, ID> getNdnIndex()
     {
         return store.getNdnIndex();
     }
@@ -226,9 +226,9 @@
     /**
      * @org.apache.xbean.Property hidden="true"
      */
-    public final void setNdnIndexOn( Index<String, ServerEntry> index ) throws Exception
+    public final void setNdnIndexOn( Index<String, ServerEntry, ID> index ) throws Exception
     {
-        store.setNdnIndex( ( Index<String, ServerEntry> ) index );
+        store.setNdnIndex( index );
     }
 
 
@@ -259,7 +259,7 @@
     /**
      * @see org.apache.directory.server.core.partition.impl.btree.BTreePartition#getUserIndex(String)
      */
-    public final Index<?, ServerEntry> getUserIndex( String id ) throws IndexNotFoundException
+    public final Index<? extends Object, ServerEntry, ID> getUserIndex( String id ) throws IndexNotFoundException
     {
         return store.getUserIndex( id );
     }
@@ -268,37 +268,37 @@
     /**
      * @see BTreePartition#getEntryId(String)
      */
-    public final Index<?, ServerEntry> getSystemIndex( String id ) throws IndexNotFoundException
+    public final Index<? extends Object, ServerEntry, ID> getSystemIndex( String id ) throws IndexNotFoundException
     {
         return store.getSystemIndex( id );
     }
 
 
-    public final Long getEntryId( String dn ) throws Exception
+    public final ID getEntryId( String dn ) throws Exception
     {
         return store.getEntryId( dn );
     }
 
 
-    public final String getEntryDn( Long id ) throws Exception
+    public final String getEntryDn( ID id ) throws Exception
     {
         return store.getEntryDn( id );
     }
 
 
-    public final Long getParentId( String dn ) throws Exception
+    public final ID getParentId( String dn ) throws Exception
     {
         return store.getParentId( dn );
     }
 
 
-    public final Long getParentId( Long childId ) throws Exception
+    public final ID getParentId( ID childId ) throws Exception
     {
         return store.getParentId( childId );
     }
 
 
-    public final String getEntryUpdn( Long id ) throws Exception
+    public final String getEntryUpdn( ID id ) throws Exception
     {
         return store.getEntryUpdn( id );
     }
@@ -322,25 +322,25 @@
     }
 
 
-    public final ClonedServerEntry lookup( Long id ) throws Exception
+    public final ClonedServerEntry lookup( ID id ) throws Exception
     {
         return new ClonedServerEntry( store.lookup( id ) );
     }
 
 
-    public final void delete( Long id ) throws Exception
+    public final void delete( ID id ) throws Exception
     {
         store.delete( id );
     }
 
 
-    public final IndexCursor<Long, ServerEntry> list( Long id ) throws Exception
+    public final IndexCursor<ID, ServerEntry, ID> list( ID id ) throws Exception
     {
         return store.list( id );
     }
 
 
-    public final int getChildCount( Long id ) throws Exception
+    public final int getChildCount( ID id ) throws Exception
     {
         return store.getChildCount( id );
     }
@@ -455,13 +455,13 @@
     }
 
 
-    public final Index<String, ServerEntry> getPresenceIndex()
+    public final Index<String, ServerEntry, ID> getPresenceIndex()
     {
         return store.getPresenceIndex();
     }
 
 
-    public final Index<Long, ServerEntry> getSubLevelIndex()
+    public final Index<ID, ServerEntry, ID> getSubLevelIndex()
     {
         return store.getSubLevelIndex();
     }

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/EmptyIndexCursor.java Sun Feb 28 22:55:33 2010
@@ -29,7 +29,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class EmptyIndexCursor<K, E> extends AbstractIndexCursor<K, E>
+public class EmptyIndexCursor<K, E, ID> extends AbstractIndexCursor<K, E, ID>
 {
     public boolean available()
     {
@@ -37,13 +37,13 @@
     }
 
 
-    public void before( IndexEntry<K, E> element ) throws Exception
+    public void before( IndexEntry<K, E, ID> element ) throws Exception
     {
         checkNotClosed( "before()" );
     }
 
 
-    public void after( IndexEntry<K, E> element ) throws Exception
+    public void after( IndexEntry<K, E, ID> element ) throws Exception
     {
         checkNotClosed( "after()" );
     }
@@ -89,7 +89,7 @@
     }
 
 
-    public IndexEntry<K, E> get() throws Exception
+    public IndexEntry<K, E, ID> get() throws Exception
     {
         checkNotClosed( "get()" );
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_703 ) );
@@ -102,13 +102,13 @@
     }
 
 
-    public void afterValue( Long id, K indexValue ) throws Exception
+    public void afterValue( ID id, K indexValue ) throws Exception
     {
         checkNotClosed( "after()" );
     }
 
 
-    public void beforeValue( Long id, K indexValue ) throws Exception
+    public void beforeValue( ID id, K indexValue ) throws Exception
     {
         checkNotClosed( "after()" );
     }

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ForwardIndexEntry.java Sun Feb 28 22:55:33 2010
@@ -27,10 +27,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ForwardIndexEntry<V, O> implements IndexEntry<V, O>
+public class ForwardIndexEntry<V, O, ID> implements IndexEntry<V, O, ID>
 {
     /** The underlying Tuple */
-    private final Tuple<V, Long> tuple = new Tuple<V, Long>();
+    private final Tuple<V, ID> tuple = new Tuple<V, ID>();
 
     /** The referenced obj if loaded from the store */
     private O obj;
@@ -44,7 +44,7 @@
      * @param tuple the tuple for the ForwardIndexEntry
      * @param entry the resusitated obj if any
      */
-    public void setTuple( Tuple<V, Long> tuple, O entry )
+    public void setTuple( Tuple<V, ID> tuple, O entry )
     {
         this.tuple.setKey( tuple.getKey() );
         this.tuple.setValue( tuple.getValue() );
@@ -52,7 +52,7 @@
     }
 
 
-    public Long getId()
+    public ID getId()
     {
         return tuple.getValue();
     }
@@ -64,7 +64,7 @@
     }
 
 
-    public void setId( Long id )
+    public void setId( ID id )
     {
         tuple.setValue( id );
     }
@@ -93,7 +93,7 @@
     }
 
 
-    public Tuple getTuple()
+    public Tuple<V, ID> getTuple()
     {
         return tuple;
     }
@@ -107,7 +107,7 @@
     }
 
 
-    public void copy( IndexEntry<V, O> entry )
+    public void copy( IndexEntry<V, O, ID> entry )
     {
         this.obj = entry.getObject();
         tuple.setKey( entry.getValue() );

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Index.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Index.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Index.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Index.java Sun Feb 28 22:55:33 2010
@@ -35,7 +35,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface Index<K, O>
+public interface Index<K, O, ID>
 {
     int DEFAULT_INDEX_CACHE_SIZE = 100;
 
@@ -158,13 +158,13 @@
     int lessThanCount( K attrVal ) throws Exception;
 
 
-    Long forwardLookup( K attrVal ) throws Exception;
+    ID forwardLookup( K attrVal ) throws Exception;
 
 
-    K reverseLookup( Long id ) throws Exception;
+    K reverseLookup( ID id ) throws Exception;
 
 
-    void add( K attrVal, Long id ) throws Exception;
+    void add( K attrVal, ID id ) throws Exception;
 
 
     /**
@@ -194,64 +194,64 @@
      * @param entryId The master table entry ID to remove
      * @throws Exception
      */
-    void drop( Long entryId ) throws Exception;
+    void drop( ID entryId ) throws Exception;
 
 
-    void drop( K attrVal, Long id ) throws Exception;
+    void drop( K attrVal, ID id ) throws Exception;
 
 
-    IndexCursor<K, O> reverseCursor() throws Exception;
+    IndexCursor<K, O, ID> reverseCursor() throws Exception;
 
 
-    IndexCursor<K, O> forwardCursor() throws Exception;
+    IndexCursor<K, O, ID> forwardCursor() throws Exception;
 
 
-    IndexCursor<K, O> reverseCursor( Long id ) throws Exception;
+    IndexCursor<K, O, ID> reverseCursor( ID id ) throws Exception;
 
 
-    IndexCursor<K, O> forwardCursor( K key ) throws Exception;
+    IndexCursor<K, O, ID> forwardCursor( K key ) throws Exception;
 
 
-    Cursor<K> reverseValueCursor( Long id ) throws Exception;
+    Cursor<K> reverseValueCursor( ID id ) throws Exception;
 
 
-    Cursor<Long> forwardValueCursor( K key ) throws Exception;
+    Cursor<ID> forwardValueCursor( K key ) throws Exception;
 
 
     boolean forward( K attrVal ) throws Exception;
 
 
-    boolean forward( K attrVal, Long id ) throws Exception;
+    boolean forward( K attrVal, ID id ) throws Exception;
 
 
-    boolean reverse( Long id ) throws Exception;
+    boolean reverse( ID id ) throws Exception;
 
 
-    boolean reverse( Long id, K attrVal ) throws Exception;
+    boolean reverse( ID id, K attrVal ) throws Exception;
 
 
     boolean forwardGreaterOrEq( K attrVal ) throws Exception;
 
 
-    boolean forwardGreaterOrEq( K attrVal, Long id ) throws Exception;
+    boolean forwardGreaterOrEq( K attrVal, ID id ) throws Exception;
 
 
-    boolean reverseGreaterOrEq( Long id ) throws Exception;
+    boolean reverseGreaterOrEq( ID id ) throws Exception;
 
 
-    boolean reverseGreaterOrEq( Long id, K attrVal ) throws Exception;
+    boolean reverseGreaterOrEq( ID id, K attrVal ) throws Exception;
 
 
     boolean forwardLessOrEq( K attrVal ) throws Exception;
 
 
-    boolean forwardLessOrEq( K attrVal, Long id ) throws Exception;
+    boolean forwardLessOrEq( K attrVal, ID id ) throws Exception;
 
 
-    boolean reverseLessOrEq( Long id ) throws Exception;
+    boolean reverseLessOrEq( ID id ) throws Exception;
 
 
-    boolean reverseLessOrEq( Long id, K attrVal ) throws Exception;
+    boolean reverseLessOrEq( ID id, K attrVal ) throws Exception;
 
 
     void close() throws Exception;

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexCursor.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexCursor.java Sun Feb 28 22:55:33 2010
@@ -30,7 +30,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface IndexCursor<V, E> extends Cursor<IndexEntry<V, E>>
+public interface IndexCursor<V, E, ID> extends Cursor<IndexEntry<V, E, ID>>
 {
     /**
      * An alternative to calling before(IndexEntry) which often may require
@@ -38,11 +38,11 @@
      * be an unnecessary object creation.  Some implementations may not
      * support this operation and may throw an UnsupportedOperationEception.
      *
-     * @param id the Long id for the entry
+     * @param id the id for the entry
      * @param indexValue the value to advance just before
-     * @throws Exception if there are faults peforming this operation
+     * @throws Exception if there are faults performing this operation
      */
-    void beforeValue( Long id, V indexValue ) throws Exception;
+    void beforeValue( ID id, V indexValue ) throws Exception;
 
 
     /**
@@ -51,9 +51,9 @@
      * be an unnecessary object creation.  Some implementations may not
      * support this operation and may throw an UnsupportedOperationEception.
      *
-     * @param id the Long id for the entry
+     * @param id the id for the entry
      * @param indexValue the value to advance just after the last value
-     * @throws Exception if there are faults peforming this operation
+     * @throws Exception if there are faults performing this operation
      */
-    void afterValue( Long id, V indexValue ) throws Exception;
+    void afterValue( ID id, V indexValue ) throws Exception;
 }
\ No newline at end of file

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/IndexEntry.java Sun Feb 28 22:55:33 2010
@@ -26,7 +26,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $$Rev$$
  */
-public interface IndexEntry<V, O>
+public interface IndexEntry<V, O, ID>
 {
     /**
      * Gets the value referred to by this IndexEntry.
@@ -49,7 +49,7 @@
      *
      * @return the id of the object indexed
      */
-    Long getId();
+    ID getId();
 
 
     /**
@@ -57,7 +57,7 @@
      *
      * @param id the id of the object indexed
      */
-    void setId( Long id );
+    void setId( ID id );
 
 
     /**
@@ -73,7 +73,7 @@
      *
      * @return the underlying tuple
      */
-    Tuple getTuple();
+    Tuple<?, ?> getTuple();
 
 
     /**
@@ -95,5 +95,5 @@
      *
      * @param entry the entry to copy fields of
      */
-    void copy( IndexEntry<V, O> entry );
+    void copy( IndexEntry<V, O, ID> entry );
 }

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/ReverseIndexEntry.java Sun Feb 28 22:55:33 2010
@@ -27,10 +27,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class ReverseIndexEntry<V, O> implements IndexEntry<V, O>
+public class ReverseIndexEntry<V, O, ID> implements IndexEntry<V, O, ID>
 {
     /** The underlying Tuple */
-    private final Tuple<Long, V> tuple = new Tuple<Long, V>();
+    private final Tuple<ID, V> tuple = new Tuple<ID, V>();
 
     /** The indexed object if loaded from the store */
     private O obj;
@@ -44,7 +44,7 @@
      * @param tuple the tuple for the ReverseIndexEntry
      * @param obj the resusitated object that is indexed if any
      */
-    public void setTuple( Tuple<Long, V> tuple, O obj )
+    public void setTuple( Tuple<ID, V> tuple, O obj )
     {
         this.tuple.setKey( tuple.getKey() );
         this.tuple.setValue( tuple.getValue() );
@@ -52,7 +52,7 @@
     }
 
 
-    public Long getId()
+    public ID getId()
     {
         return tuple.getKey();
     }
@@ -64,7 +64,7 @@
     }
 
 
-    public void setId( Long id )
+    public void setId( ID id )
     {
         tuple.setKey( id );
     }
@@ -93,7 +93,7 @@
     }
 
 
-    public Tuple getTuple()
+    public Tuple<ID, V> getTuple()
     {
         return tuple;
     }
@@ -107,7 +107,7 @@
     }
 
 
-    public void copy( IndexEntry<V, O> entry )
+    public void copy( IndexEntry<V, O, ID> entry )
     {
         this.obj = entry.getObject();
         tuple.setKey( entry.getId() );

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/SingletonIndexCursor.java Sun Feb 28 22:55:33 2010
@@ -29,15 +29,15 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class SingletonIndexCursor<K, E> extends AbstractIndexCursor<K, E>
+public class SingletonIndexCursor<K, E, ID> extends AbstractIndexCursor<K, E, ID>
 {
     private boolean beforeFirst = true;
     private boolean afterLast;
     private boolean onSingleton;
-    private final IndexEntry<K, E> singleton;
+    private final IndexEntry<K, E, ID> singleton;
 
 
-    public SingletonIndexCursor( IndexEntry<K, E> singleton )
+    public SingletonIndexCursor( IndexEntry<K, E, ID> singleton )
     {
         this.singleton = singleton;
     }
@@ -49,25 +49,25 @@
     }
 
 
-    public void before( IndexEntry<K, E> element ) throws Exception
+    public void before( IndexEntry<K, E, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void beforeValue( Long id, K value ) throws Exception
+    public void beforeValue( ID id, K value ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void afterValue( Long id, K value ) throws Exception
+    public void afterValue( ID id, K value ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
 
 
-    public void after( IndexEntry<K, E> element ) throws Exception
+    public void after( IndexEntry<K, E, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException();
     }
@@ -187,7 +187,7 @@
     }
 
 
-    public IndexEntry<K, E> get() throws Exception
+    public IndexEntry<K, E, ID> get() throws Exception
     {
         checkNotClosed( "()" );
         if ( onSingleton )

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/Store.java Sun Feb 28 22:55:33 2010
@@ -40,7 +40,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $$Rev$$
  */
-public interface Store<E>
+public interface Store<E, ID>
 {
     /*
      * W H Y   H A V E   A   S T O R E   I N T E R F A C E  ?
@@ -103,13 +103,13 @@
      * Stores the list of user index
      * @param userIndices The list of user index
      */
-    void setUserIndices( Set<Index<?, E>> userIndices );
+    void setUserIndices( Set<Index<?, E, ID>> userIndices );
 
 
     /**
      * @return The list of user index
      */
-    Set<Index<?, E>> getUserIndices();
+    Set<Index<?, E, ID>> getUserIndices();
 
 
     void setSuffixDn( String suffixDn );
@@ -200,7 +200,7 @@
      * @param index The index to add
      * @throws Exception If the addition failed
      */
-    void addIndex( Index<?, E> index ) throws Exception;
+    void addIndex( Index<?, E, ID> index ) throws Exception;
 
 
     //------------------------------------------------------------------------
@@ -209,7 +209,7 @@
     /**
      * @return The Presence system index
      */
-    Index<String, E> getPresenceIndex();
+    Index<String, E, ID> getPresenceIndex();
 
 
     /**
@@ -217,13 +217,13 @@
      * @param index The Presence index
      * @throws Exception If the addition failed
      */
-    void setPresenceIndex( Index<String, E> index ) throws Exception;
+    void setPresenceIndex( Index<String, E, ID> index ) throws Exception;
 
 
     /**
      * @return The OneLevel system index
      */
-    Index<Long, E> getOneLevelIndex();
+    Index<ID, E, ID> getOneLevelIndex();
 
 
     /**
@@ -231,13 +231,13 @@
      * @param index The OneLevel index
      * @throws Exception If the addition failed
      */
-    void setOneLevelIndex( Index<Long, E> index ) throws Exception;
+    void setOneLevelIndex( Index<ID, E, ID> index ) throws Exception;
 
 
     /**
      * @return The SubLevel system index
      */
-    Index<Long, E> getSubLevelIndex();
+    Index<ID, E, ID> getSubLevelIndex();
 
 
     /**
@@ -245,13 +245,13 @@
      * @param index The SubLevel index
      * @throws Exception If the addition failed
      */
-    void setSubLevelIndex( Index<Long, E> index ) throws Exception;
+    void setSubLevelIndex( Index<ID, E, ID> index ) throws Exception;
 
 
     /**
      * @return The Alias system index
      */
-    Index<String, E> getAliasIndex();
+    Index<String, E, ID> getAliasIndex();
 
 
     /**
@@ -259,13 +259,13 @@
      * @param index The Alias index
      * @throws Exception If the addition failed
      */
-    void setAliasIndex( Index<String, E> index ) throws Exception;
+    void setAliasIndex( Index<String, E, ID> index ) throws Exception;
 
 
     /**
      * @return The OneAlias system index
      */
-    Index<Long, E> getOneAliasIndex();
+    Index<ID, E, ID> getOneAliasIndex();
 
 
     /**
@@ -273,13 +273,13 @@
      * @param index The OneAlias index
      * @throws Exception If the addition failed
      */
-    void setOneAliasIndex( Index<Long, E> index ) throws Exception;
+    void setOneAliasIndex( Index<ID, E, ID> index ) throws Exception;
 
 
     /**
      * @return The SubAlias system index
      */
-    Index<Long, E> getSubAliasIndex();
+    Index<ID, E, ID> getSubAliasIndex();
 
 
     /**
@@ -287,13 +287,13 @@
      * @param index The SubAlias index
      * @throws Exception If the addition failed
      */
-    void setSubAliasIndex( Index<Long, E> index ) throws Exception;
+    void setSubAliasIndex( Index<ID, E, ID> index ) throws Exception;
 
 
     /**
      * @return The UpDN system index
      */
-    Index<String, E> getUpdnIndex();
+    Index<String, E, ID> getUpdnIndex();
 
 
     /**
@@ -301,13 +301,13 @@
      * @param index The UpDn index
      * @throws Exception If the addition failed
      */
-    void setUpdnIndex( Index<String, E> index ) throws Exception;
+    void setUpdnIndex( Index<String, E, ID> index ) throws Exception;
 
 
     /**
      * @return The Ndn system index
      */
-    Index<String, E> getNdnIndex();
+    Index<String, E, ID> getNdnIndex();
 
 
     /**
@@ -315,13 +315,13 @@
      * @param index The NDN index
      * @throws Exception If the addition failed
      */
-    void setNdnIndex( Index<String, E> index ) throws Exception;
+    void setNdnIndex( Index<String, E, ID> index ) throws Exception;
 
 
     /**
      * @return The ObjectClass system index
      */
-    Index<String, E> getObjectClassIndex();
+    Index<String, E, ID> getObjectClassIndex();
 
 
     /**
@@ -329,13 +329,13 @@
      * @param index The ObjectClass index
      * @throws Exception If the addition failed
      */
-    void setObjectClassIndex( Index<String, E> index ) throws Exception;
+    void setObjectClassIndex( Index<String, E, ID> index ) throws Exception;
 
 
     /**
      * @return The EntryUUID system index
      */
-    Index<String, E> getEntryUuidIndex();
+    Index<String, E, ID> getEntryUuidIndex();
 
 
     /**
@@ -343,13 +343,13 @@
      * @param index The EntryUUID index
      * @throws Exception If the addition failed
      */
-    void setEntryUuidIndex( Index<String, E> index ) throws Exception;
+    void setEntryUuidIndex( Index<String, E, ID> index ) throws Exception;
 
 
     /**
      * @return The EntryCSN system index
      */
-    Index<String, E> getEntryCsnIndex();
+    Index<String, E, ID> getEntryCsnIndex();
 
 
     /**
@@ -357,7 +357,7 @@
      * @param index The EntryCSN index
      * @throws Exception If the addition failed
      */
-    void setEntryCsnIndex( Index<String, E> index ) throws Exception;
+    void setEntryCsnIndex( Index<String, E, ID> index ) throws Exception;
 
 
     //------------------------------------------------------------------------
@@ -402,7 +402,7 @@
      * @return The associated user index
      * @throws IndexNotFoundException If the index does not exist
      */
-    Index<?, E> getUserIndex( String id ) throws IndexNotFoundException;
+    Index<?, E, ID> getUserIndex( String id ) throws IndexNotFoundException;
 
 
     /**
@@ -411,13 +411,13 @@
      * @return The associated user index
      * @throws IndexNotFoundException If the index does not exist
      */
-    Index<?, E> getSystemIndex( String id ) throws IndexNotFoundException;
+    Index<?, E, ID> getSystemIndex( String id ) throws IndexNotFoundException;
 
 
-    Long getEntryId( String dn ) throws Exception;
+    ID getEntryId( String dn ) throws Exception;
 
 
-    String getEntryDn( Long id ) throws Exception;
+    String getEntryDn( ID id ) throws Exception;
 
 
     /**
@@ -430,13 +430,13 @@
      * normalized suffix dn string is used
      * @throws Exception on failures to access the underlying store
      */
-    Long getParentId( String dn ) throws Exception;
+    ID getParentId( String dn ) throws Exception;
 
 
-    Long getParentId( Long childId ) throws Exception;
+    ID getParentId( ID childId ) throws Exception;
 
 
-    String getEntryUpdn( Long id ) throws Exception;
+    String getEntryUpdn( ID id ) throws Exception;
 
 
     String getEntryUpdn( String dn ) throws Exception;
@@ -455,7 +455,7 @@
     void add( ServerEntry entry ) throws Exception;
 
 
-    ServerEntry lookup( Long id ) throws Exception;
+    ServerEntry lookup( ID id ) throws Exception;
 
 
     /**
@@ -463,7 +463,7 @@
      * @param id The id of the entry to delete
      * @throws Exception If the deletion failed
      */
-    void delete( Long id ) throws Exception;
+    void delete( ID id ) throws Exception;
 
 
     /**
@@ -473,10 +473,10 @@
      * @return an IndexEntry Cursor over the child entries
      * @throws Exception on failures to access the underlying store
      */
-    IndexCursor<Long, E> list( Long id ) throws Exception;
+    IndexCursor<ID, E, ID> list( ID id ) throws Exception;
 
 
-    int getChildCount( Long id ) throws Exception;
+    int getChildCount( ID id ) throws Exception;
 
 
     LdapDN getSuffix();
@@ -520,4 +520,12 @@
 
 
     void move( LdapDN oldChildDn, LdapDN newParentDn ) throws Exception;
+
+
+    /**
+     * Gets the default ID.
+     *
+     * @return the default ID.
+     */
+    ID getDefaultId() throws Exception;
 }

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java Sun Feb 28 22:55:33 2010
@@ -49,7 +49,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface Evaluator<N extends ExprNode, E>
+public interface Evaluator<N extends ExprNode, E, ID>
 {
     /**
      * Evaluates a candidate to determine if a filter expression selects it.
@@ -63,7 +63,7 @@
      * @return true if filter selects the candidate false otherwise
      * @throws Exception if there are faults during evaluation
      */
-    boolean evaluate( IndexEntry<?, E> entry ) throws Exception;
+    boolean evaluate( IndexEntry<?, E, ID> entry ) throws Exception;
 
 
     /**
@@ -74,7 +74,7 @@
      * @return true if filter selects the candidate false otherwise
      * @throws Exception if there are faults during evaluation
      */
-    boolean evaluate( Long id ) throws Exception;
+    boolean evaluateId( ID id ) throws Exception;
 
 
     /**
@@ -85,7 +85,7 @@
      * @return true if filter selects the candidate false otherwise
      * @throws Exception if there are faults during evaluation
      */
-    boolean evaluate( E entry ) throws Exception;
+    boolean evaluateEntry( E entry ) throws Exception;
 
 
     /**

Modified: directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java (original)
+++ directory/apacheds/trunk/xdbm-base/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java Sun Feb 28 22:55:33 2010
@@ -37,7 +37,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface SearchEngine<E>
+public interface SearchEngine<E, ID>
 {
     /**
      * @todo put this in the right place
@@ -84,8 +84,8 @@
      * @return enumeration over SearchResults
      * @throws Exception if the search fails
      */
-    IndexCursor<Long, E> cursor( LdapDN base, AliasDerefMode aliasDerefMode, ExprNode filter, SearchControls searchCtls )
-        throws Exception;
+    IndexCursor<ID, E, ID> cursor( LdapDN base, AliasDerefMode aliasDerefMode, ExprNode filter,
+        SearchControls searchCtls ) throws Exception;
 
 
     /**
@@ -95,5 +95,5 @@
      * @return true if the filter passes the entry, false otherwise
      * @throws Exception if something goes wrong while accessing the db
      */
-    Evaluator<? extends ExprNode, ServerEntry> evaluator( ExprNode filter ) throws Exception;
+    Evaluator<? extends ExprNode, ServerEntry, ID> evaluator( ExprNode filter ) throws Exception;
 }
\ No newline at end of file

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java Sun Feb 28 22:55:33 2010
@@ -34,13 +34,13 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class AllEntriesCursor extends AbstractIndexCursor<Long, ServerEntry>
+public class AllEntriesCursor<ID> extends AbstractIndexCursor<ID, ServerEntry, ID>
 {
-    private IndexEntry<Long, ServerEntry> indexEntry = new ForwardIndexEntry<Long, ServerEntry>();
-    private final IndexCursor<String, ServerEntry> wrapped;
+    private IndexEntry<ID, ServerEntry, ID> indexEntry = new ForwardIndexEntry<ID, ServerEntry, ID>();
+    private final IndexCursor<String, ServerEntry, ID> wrapped;
 
 
-    public AllEntriesCursor( Store<ServerEntry> db ) throws Exception
+    public AllEntriesCursor( Store<ServerEntry, ID> db ) throws Exception
     {
         // Get a reverse cursor because we want to sort by ID
         wrapped = db.getNdnIndex().reverseCursor();
@@ -50,7 +50,7 @@
     /* 
      * @see org.apache.directory.server.xdbm.IndexCursor#afterValue(Long, Object)
      */
-    public void afterValue( Long key, Long value ) throws Exception
+    public void afterValue( ID key, ID value ) throws Exception
     {
         checkNotClosed( "afterValue()" );
         wrapped.afterValue( key, null );
@@ -60,7 +60,7 @@
     /* 
      * @see org.apache.directory.server.xdbm.IndexCursor#beforeValue(java.lang.Long, java.lang.Object)
      */
-    public void beforeValue( Long id, Long value ) throws Exception
+    public void beforeValue( ID id, ID value ) throws Exception
     {
         checkNotClosed( "beforeValue()" );
         wrapped.beforeValue( id, null );
@@ -70,7 +70,7 @@
     /* 
      * @see org.apache.directory.server.core.cursor.Cursor#after(java.lang.Object)
      */
-    public void after( IndexEntry<Long, ServerEntry> indexEntry ) throws Exception
+    public void after( IndexEntry<ID, ServerEntry, ID> indexEntry ) throws Exception
     {
         checkNotClosed( "after()" );
         wrapped.afterValue( indexEntry.getId(), null );
@@ -99,7 +99,7 @@
     /* 
      * @see org.apache.directory.server.core.cursor.Cursor#before(java.lang.Object)
      */
-    public void before( IndexEntry<Long, ServerEntry> indexEntry ) throws Exception
+    public void before( IndexEntry<ID, ServerEntry, ID> indexEntry ) throws Exception
     {
         checkNotClosed( "before()" );
         wrapped.beforeValue( indexEntry.getId(), null );
@@ -129,10 +129,10 @@
     /* 
      * @see org.apache.directory.server.core.cursor.Cursor#get()
      */
-    public IndexEntry<Long, ServerEntry> get() throws Exception
+    public IndexEntry<ID, ServerEntry, ID> get() throws Exception
     {
         checkNotClosed( "get()" );
-        IndexEntry<String, ServerEntry> wrappedEntry = wrapped.get();
+        IndexEntry<String, ServerEntry, ID> wrappedEntry = wrapped.get();
         indexEntry.setId( wrappedEntry.getId() );
         indexEntry.setValue( wrappedEntry.getId() );
         indexEntry.setObject( wrappedEntry.getObject() );

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java Sun Feb 28 22:55:33 2010
@@ -41,15 +41,16 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class AndCursor<V> extends AbstractIndexCursor<V, ServerEntry>
+public class AndCursor<V, ID> extends AbstractIndexCursor<V, ServerEntry, ID>
 {
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 );
-    private final IndexCursor<V, ServerEntry> wrapped;
-    private final List<Evaluator<? extends ExprNode, ServerEntry>> evaluators;
+    private final IndexCursor<V, ServerEntry, ID> wrapped;
+    private final List<Evaluator<? extends ExprNode, ServerEntry, ID>> evaluators;
     private boolean available = false;
 
 
-    public AndCursor( IndexCursor<V, ServerEntry> wrapped, List<Evaluator<? extends ExprNode, ServerEntry>> evaluators )
+    public AndCursor( IndexCursor<V, ServerEntry, ID> wrapped,
+        List<Evaluator<? extends ExprNode, ServerEntry, ID>> evaluators )
     {
         this.wrapped = wrapped;
         this.evaluators = optimize( evaluators );
@@ -62,25 +63,25 @@
     }
 
 
-    public void beforeValue( Long id, V value )
+    public void beforeValue( ID id, V value )
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void afterValue( Long id, V value )
+    public void afterValue( ID id, V value )
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void before( IndexEntry<V, ServerEntry> element ) throws Exception
+    public void before( IndexEntry<V, ServerEntry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
 
 
-    public void after( IndexEntry<V, ServerEntry> element ) throws Exception
+    public void after( IndexEntry<V, ServerEntry, ID> element ) throws Exception
     {
         throw new UnsupportedOperationException( UNSUPPORTED_MSG );
     }
@@ -122,7 +123,7 @@
         {
             checkNotClosed( "previous()" );
 
-            IndexEntry<?, ServerEntry> candidate = wrapped.get();
+            IndexEntry<?, ServerEntry, ID> candidate = wrapped.get();
             if ( matches( candidate ) )
             {
                 return available = true;
@@ -138,7 +139,7 @@
         while ( wrapped.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?, ServerEntry> candidate = wrapped.get();
+            IndexEntry<?, ServerEntry, ID> candidate = wrapped.get();
             if ( matches( candidate ) )
             {
                 return available = true;
@@ -149,7 +150,7 @@
     }
 
 
-    public IndexEntry<V, ServerEntry> get() throws Exception
+    public IndexEntry<V, ServerEntry, ID> get() throws Exception
     {
         checkNotClosed( "get()" );
         if ( available )
@@ -188,16 +189,16 @@
      * @param unoptimized the unoptimized list of Evaluators
      * @return optimized Evaluator list with increasing scan count ordering
      */
-    private List<Evaluator<? extends ExprNode, ServerEntry>> optimize(
-        List<Evaluator<? extends ExprNode, ServerEntry>> unoptimized )
+    private List<Evaluator<? extends ExprNode, ServerEntry, ID>> optimize(
+        List<Evaluator<? extends ExprNode, ServerEntry, ID>> unoptimized )
     {
-        List<Evaluator<? extends ExprNode, ServerEntry>> optimized = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+        List<Evaluator<? extends ExprNode, ServerEntry, ID>> optimized = new ArrayList<Evaluator<? extends ExprNode, ServerEntry, ID>>(
             unoptimized.size() );
         optimized.addAll( unoptimized );
 
-        Collections.sort( optimized, new Comparator<Evaluator<?, ServerEntry>>()
+        Collections.sort( optimized, new Comparator<Evaluator<?, ServerEntry, ID>>()
         {
-            public int compare( Evaluator<?, ServerEntry> e1, Evaluator<?, ServerEntry> e2 )
+            public int compare( Evaluator<?, ServerEntry, ID> e1, Evaluator<?, ServerEntry, ID> e2 )
             {
                 long scanCount1 = ( Long ) e1.getExpression().get( "count" );
                 long scanCount2 = ( Long ) e2.getExpression().get( "count" );
@@ -226,9 +227,9 @@
     }
 
 
-    private boolean matches( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
+    private boolean matches( IndexEntry<?, ServerEntry, ID> indexEntry ) throws Exception
     {
-        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry, ID> evaluator : evaluators )
         {
             if ( !evaluator.evaluate( indexEntry ) )
             {

Modified: directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java?rev=917312&r1=917311&r2=917312&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java (original)
+++ directory/apacheds/trunk/xdbm-search/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java Sun Feb 28 22:55:33 2010
@@ -38,14 +38,14 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $$Rev$$
  */
-public class AndEvaluator implements Evaluator<AndNode, ServerEntry>
+public class AndEvaluator<ID> implements Evaluator<AndNode, ServerEntry, ID>
 {
-    private final List<Evaluator<? extends ExprNode, ServerEntry>> evaluators;
+    private final List<Evaluator<? extends ExprNode, ServerEntry, ID>> evaluators;
 
     private final AndNode node;
 
 
-    public AndEvaluator( AndNode node, List<Evaluator<? extends ExprNode, ServerEntry>> evaluators )
+    public AndEvaluator( AndNode node, List<Evaluator<? extends ExprNode, ServerEntry, ID>> evaluators )
     {
         this.node = node;
         this.evaluators = optimize( evaluators );
@@ -63,15 +63,15 @@
      * @param unoptimized the unoptimized list of Evaluators
      * @return optimized Evaluator list with increasing scan count ordering
      */
-    private List<Evaluator<? extends ExprNode, ServerEntry>> optimize(
-        List<Evaluator<? extends ExprNode, ServerEntry>> unoptimized )
+    private List<Evaluator<? extends ExprNode, ServerEntry, ID>> optimize(
+        List<Evaluator<? extends ExprNode, ServerEntry, ID>> unoptimized )
     {
-        List<Evaluator<? extends ExprNode, ServerEntry>> optimized = new ArrayList<Evaluator<? extends ExprNode, ServerEntry>>(
+        List<Evaluator<? extends ExprNode, ServerEntry, ID>> optimized = new ArrayList<Evaluator<? extends ExprNode, ServerEntry, ID>>(
             unoptimized.size() );
         optimized.addAll( unoptimized );
-        Collections.sort( optimized, new Comparator<Evaluator<?, ServerEntry>>()
+        Collections.sort( optimized, new Comparator<Evaluator<?, ServerEntry, ID>>()
         {
-            public int compare( Evaluator<?, ServerEntry> e1, Evaluator<?, ServerEntry> e2 )
+            public int compare( Evaluator<?, ServerEntry, ID> e1, Evaluator<?, ServerEntry, ID> e2 )
             {
                 long scanCount1 = ( Long ) e1.getExpression().get( "count" );
                 long scanCount2 = ( Long ) e2.getExpression().get( "count" );
@@ -100,11 +100,11 @@
     }
 
 
-    public boolean evaluate( Long id ) throws Exception
+    public boolean evaluateId( ID id ) throws Exception
     {
-        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry, ID> evaluator : evaluators )
         {
-            if ( !evaluator.evaluate( id ) )
+            if ( !evaluator.evaluateId( id ) )
             {
                 return false;
             }
@@ -114,11 +114,11 @@
     }
 
 
-    public boolean evaluate( ServerEntry entry ) throws Exception
+    public boolean evaluateEntry( ServerEntry entry ) throws Exception
     {
-        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry, ID> evaluator : evaluators )
         {
-            if ( !evaluator.evaluate( entry ) )
+            if ( !evaluator.evaluateEntry( entry ) )
             {
                 return false;
             }
@@ -128,9 +128,9 @@
     }
 
 
-    public boolean evaluate( IndexEntry<?, ServerEntry> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?, ServerEntry, ID> indexEntry ) throws Exception
     {
-        for ( Evaluator<?, ServerEntry> evaluator : evaluators )
+        for ( Evaluator<?, ServerEntry, ID> evaluator : evaluators )
         {
             if ( !evaluator.evaluate( indexEntry ) )
             {



Mime
View raw message