directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1199849 [1/2] - in /directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search: ./ impl/
Date Wed, 09 Nov 2011 17:02:10 GMT
Author: saya
Date: Wed Nov  9 17:02:09 2011
New Revision: 1199849

URL: http://svn.apache.org/viewvc?rev=1199849&view=rev
Log:
Changed search engine to use UUID and removed some uneccecassary generic types. Changed some == to compareTo to make UUID comparison work

Modified:
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LeafEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OrEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/PresenceEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ScanCountComparator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubstringEvaluator.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java
    directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeEvaluator.java

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/Evaluator.java Wed Nov  9 17:02:09 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.xdbm
 
 
 import org.apache.directory.server.core.api.partition.index.IndexEntry;
+import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
 
 
@@ -48,7 +49,7 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface Evaluator<N extends ExprNode, E, ID>
+public interface Evaluator<N extends ExprNode>
 {
     /**
      * Evaluates a candidate to determine if a filter expression selects it.
@@ -62,7 +63,7 @@ public interface Evaluator<N extends Exp
      * @return true if filter selects the candidate false otherwise
      * @throws Exception if there are faults during evaluation
      */
-    boolean evaluate( IndexEntry<?, ID> entry ) throws Exception;
+    boolean evaluate( IndexEntry<?> entry ) throws Exception;
 
 
     /**
@@ -73,7 +74,7 @@ public interface Evaluator<N extends Exp
      * @return true if filter selects the candidate false otherwise
      * @throws Exception if there are faults during evaluation
      */
-    boolean evaluateEntry( E entry ) throws Exception;
+    boolean evaluateEntry( Entry entry ) throws Exception;
 
 
     /**

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search;
 
 
+import java.util.UUID;
+
 import org.apache.directory.shared.ldap.model.constants.JndiPropertyConstants;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -36,7 +38,7 @@ import javax.naming.directory.SearchCont
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface SearchEngine<E, ID>
+public interface SearchEngine
 {
     /**
      * @todo put this in the right place
@@ -83,7 +85,7 @@ public interface SearchEngine<E, ID>
      * @return enumeration over SearchResults
      * @throws Exception if the search fails
      */
-    IndexCursor<ID, E, ID> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
+    IndexCursor<UUID> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
         SearchControls searchCtls ) throws Exception;
 
 
@@ -94,5 +96,5 @@ public interface SearchEngine<E, ID>
      * @return true if the filter passes the entry, false otherwise
      * @throws Exception if something goes wrong while accessing the db
      */
-    Evaluator<? extends ExprNode, Entry, ID> evaluator( ExprNode filter ) throws Exception;
+    Evaluator<? extends ExprNode> evaluator( ExprNode filter ) throws Exception;
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AllEntriesCursor.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
 import org.apache.directory.server.core.api.partition.index.IndexCursor;
@@ -33,13 +35,13 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AllEntriesCursor<ID extends Comparable<ID>> extends AbstractIndexCursor<ID, Entry, ID>
+public class AllEntriesCursor extends AbstractIndexCursor<UUID>
 {
     /** The index entry we use to return entries one by one.  */
-    private IndexEntry<ID, ID> indexEntry = new ForwardIndexEntry<ID, ID>();
+    private IndexEntry<UUID> indexEntry = new ForwardIndexEntry<UUID>();
     
     /** The cursor on the EntryUUID index */
-    private final IndexCursor<String, Entry, ID> wrapped;
+    private final IndexCursor<String> wrapped;
 
 
     /**
@@ -56,7 +58,7 @@ public class AllEntriesCursor<ID extends
      * @param db
      * @throws Exception
      */
-    public AllEntriesCursor( Store<Entry, ID> db ) throws Exception
+    public AllEntriesCursor( Store db ) throws Exception
     {
         // Get a reverse cursor because we want to sort by ID
         wrapped = db.getEntryUuidIndex().reverseCursor();
@@ -66,7 +68,7 @@ public class AllEntriesCursor<ID extends
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID key, ID value ) throws Exception
+    public void afterValue( UUID key, UUID value ) throws Exception
     {
         checkNotClosed( "afterValue()" );
         
@@ -77,7 +79,7 @@ public class AllEntriesCursor<ID extends
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, ID value ) throws Exception
+    public void beforeValue( UUID id, UUID value ) throws Exception
     {
         checkNotClosed( "beforeValue()" );
         
@@ -88,7 +90,7 @@ public class AllEntriesCursor<ID extends
     /**
      * {@inheritDoc}
      */
-    public void after( IndexEntry<ID, ID> indexEntry ) throws Exception
+    public void after( IndexEntry<UUID> indexEntry ) throws Exception
     {
         checkNotClosed( "after()" );
         
@@ -119,7 +121,7 @@ public class AllEntriesCursor<ID extends
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<ID, ID> indexEntry ) throws Exception
+    public void before( IndexEntry<UUID> indexEntry ) throws Exception
     {
         checkNotClosed( "before()" );
         
@@ -152,12 +154,12 @@ public class AllEntriesCursor<ID extends
     /**
      * {@inheritDoc}
      */
-    public IndexEntry<ID, ID> get() throws Exception
+    public IndexEntry<UUID> get() throws Exception
     {
         checkNotClosed( "get()" );
         
         // Create the returned IndexEntry, copying what we get from the wrapped cursor
-        IndexEntry<String, ID> wrappedEntry = wrapped.get();
+        IndexEntry<String> wrappedEntry = wrapped.get();
         indexEntry.setId( wrappedEntry.getId() );
         indexEntry.setValue( wrappedEntry.getId() );
         indexEntry.setEntry( wrappedEntry.getEntry() );

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndCursor.java Wed Nov  9 17:02:09 2011
@@ -39,16 +39,16 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AndCursor<V, ID> extends AbstractIndexCursor<V, Entry, ID>
+public class AndCursor<V> extends AbstractIndexCursor<V>
 {
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 );
     
     /** */
-    private final IndexCursor<V, Entry, ID> wrapped;
+    private final IndexCursor<V> wrapped;
     
     /** The evaluators used for the members of the And filter */
-    private final List<Evaluator<? extends ExprNode, Entry, ID>> evaluators;
+    private final List<Evaluator<? extends ExprNode>> evaluators;
 
 
     /**
@@ -58,8 +58,8 @@ public class AndCursor<V, ID> extends Ab
      * @param wrapped The encapsulated IndexCursor
      * @param evaluators The list of evaluators associated wth the elements
      */
-    public AndCursor( IndexCursor<V, Entry, ID> wrapped,
-        List<Evaluator<? extends ExprNode, Entry, ID>> evaluators )
+    public AndCursor( IndexCursor<V> wrapped,
+        List<Evaluator<? extends ExprNode>> evaluators )
     {
         this.wrapped = wrapped;
         this.evaluators = optimize( evaluators );
@@ -128,7 +128,7 @@ public class AndCursor<V, ID> extends Ab
         {
             checkNotClosed( "previous()" );
 
-            IndexEntry<V, ID> candidate = wrapped.get();
+            IndexEntry<V> candidate = wrapped.get();
             
             if ( matches( candidate ) )
             {
@@ -148,7 +148,7 @@ public class AndCursor<V, ID> extends Ab
         while ( wrapped.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<V, ID> candidate = wrapped.get();
+            IndexEntry<V> candidate = wrapped.get();
             
             if ( matches( candidate ) )
             {
@@ -163,7 +163,7 @@ public class AndCursor<V, ID> extends Ab
     /**
      * {@inheritDoc}
      */
-    public IndexEntry<V, ID> get() throws Exception
+    public IndexEntry<V> get() throws Exception
     {
         checkNotClosed( "get()" );
         
@@ -197,14 +197,14 @@ public class AndCursor<V, ID> extends Ab
      * @param unoptimized the unoptimized list of Evaluators
      * @return optimized Evaluator list with increasing scan count ordering
      */
-    private List<Evaluator<? extends ExprNode, Entry, ID>> optimize(
-        List<Evaluator<? extends ExprNode, Entry, ID>> unoptimized )
+    private List<Evaluator<? extends ExprNode>> optimize(
+        List<Evaluator<? extends ExprNode>> unoptimized )
     {
-        List<Evaluator<? extends ExprNode, Entry, ID>> optimized = new ArrayList<Evaluator<? extends ExprNode, Entry, ID>>(
+        List<Evaluator<? extends ExprNode>> optimized = new ArrayList<Evaluator<? extends ExprNode>>(
             unoptimized.size() );
         optimized.addAll( unoptimized );
 
-        Collections.sort( optimized, new ScanCountComparator<ID>() );
+        Collections.sort( optimized, new ScanCountComparator() );
 
         return optimized;
     }
@@ -213,9 +213,9 @@ public class AndCursor<V, ID> extends Ab
     /**
      * Checks if the entry is a valid candidate by using the evaluators.
      */
-    private boolean matches( IndexEntry<V, ID> indexEntry ) throws Exception
+    private boolean matches( IndexEntry<V> indexEntry ) throws Exception
     {
-        for ( Evaluator<?, Entry, ID> evaluator : evaluators )
+        for ( Evaluator<?> evaluator : evaluators )
         {
             if ( !evaluator.evaluate( indexEntry ) )
             {

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/AndEvaluator.java Wed Nov  9 17:02:09 2011
@@ -36,10 +36,10 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AndEvaluator<ID> implements Evaluator<AndNode, Entry, ID>
+public class AndEvaluator implements Evaluator<AndNode>
 {
     /** The list of evaluators associated with each of the children */
-    private final List<Evaluator<? extends ExprNode, Entry, ID>> evaluators;
+    private final List<Evaluator<? extends ExprNode>> evaluators;
 
     /** The AndNode */
     private final AndNode node;
@@ -50,7 +50,7 @@ public class AndEvaluator<ID> implements
      * @param node The And Node
      * @param evaluators The list of evaluators for all the contaned nodes
      */
-    public AndEvaluator( AndNode node, List<Evaluator<? extends ExprNode, Entry, ID>> evaluators )
+    public AndEvaluator( AndNode node, List<Evaluator<? extends ExprNode>> evaluators )
     {
         this.node = node;
         this.evaluators = optimize( evaluators );
@@ -68,14 +68,14 @@ public class AndEvaluator<ID> implements
      * @param unoptimized the unoptimized list of Evaluators
      * @return optimized Evaluator list with increasing scan count ordering
      */
-    List<Evaluator<? extends ExprNode, Entry, ID>> optimize(
-        List<Evaluator<? extends ExprNode, Entry, ID>> unoptimized )
+    List<Evaluator<? extends ExprNode>> optimize(
+        List<Evaluator<? extends ExprNode>> unoptimized )
     {
-        List<Evaluator<? extends ExprNode, Entry, ID>> optimized = new ArrayList<Evaluator<? extends ExprNode, Entry, ID>>(
+        List<Evaluator<? extends ExprNode>> optimized = new ArrayList<Evaluator<? extends ExprNode>>(
             unoptimized.size() );
         optimized.addAll( unoptimized );
         
-        Collections.sort( optimized, new ScanCountComparator<ID>() );
+        Collections.sort( optimized, new ScanCountComparator() );
 
         return optimized;
     }
@@ -86,7 +86,7 @@ public class AndEvaluator<ID> implements
      */
     public boolean evaluateEntry( Entry entry ) throws Exception
     {
-        for ( Evaluator<?, Entry, ID> evaluator : evaluators )
+        for ( Evaluator<?> evaluator : evaluators )
         {
             if ( !evaluator.evaluateEntry( entry ) )
             {
@@ -101,9 +101,9 @@ public class AndEvaluator<ID> implements
     /**
      * {@inheritDoc}
      */
-    public boolean evaluate( IndexEntry<?, ID> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?> indexEntry ) throws Exception
     {
-        for ( Evaluator<?, Entry, ID> evaluator : evaluators )
+        for ( Evaluator<?> evaluator : evaluators )
         {
             if ( !evaluator.evaluate( indexEntry ) )
             {

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateCursor.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
 import org.apache.directory.server.core.api.partition.index.Index;
@@ -43,19 +45,19 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ApproximateCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
+public class ApproximateCursor<V> extends AbstractIndexCursor<V>
 {
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = "ApproximateCursors only support positioning by element when a user index exists on the asserted attribute.";
 
     /** An approximate evaluator for candidates */
-    private final ApproximateEvaluator<V, ID> approximateEvaluator;
+    private final ApproximateEvaluator<V> approximateEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V, Entry, ID> userIdxCursor;
+    private final IndexCursor<V> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<String, Entry, ID> uuidIdxCursor;
+    private final IndexCursor<String> uuidIdxCursor;
 
     /**
      * Creates a new instance of ApproximateCursor
@@ -64,7 +66,7 @@ public class ApproximateCursor<V, ID ext
      * @throws Exception If the creation failed
      */
     @SuppressWarnings("unchecked")
-    public ApproximateCursor( Store<Entry, ID> db, ApproximateEvaluator<V, ID> approximateEvaluator ) throws Exception
+    public ApproximateCursor( Store db, ApproximateEvaluator<V> approximateEvaluator ) throws Exception
     {
         this.approximateEvaluator = approximateEvaluator;
 
@@ -73,7 +75,7 @@ public class ApproximateCursor<V, ID ext
         
         if ( db.hasIndexOn( attributeType ) )
         {
-            Index<V, Entry, ID> index = ( Index<V, Entry, ID> ) db.getIndex( attributeType );
+            Index<V> index = ( Index<V> ) db.getIndex( attributeType );
             userIdxCursor = index.forwardCursor( value.getValue() );
             uuidIdxCursor = null;
         }
@@ -111,7 +113,7 @@ public class ApproximateCursor<V, ID ext
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, V value ) throws Exception
+    public void beforeValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "beforeValue()" );
         
@@ -129,7 +131,7 @@ public class ApproximateCursor<V, ID ext
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID id, V value ) throws Exception
+    public void afterValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "afterValue()" );
         
@@ -147,7 +149,7 @@ public class ApproximateCursor<V, ID ext
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<V, ID> element ) throws Exception
+    public void before( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "before()" );
         
@@ -166,7 +168,7 @@ public class ApproximateCursor<V, ID ext
      * {@inheritDoc}
      */
     @Override
-    public void after( IndexEntry<V, ID> element ) throws Exception
+    public void after( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "after()" );
         
@@ -253,7 +255,7 @@ public class ApproximateCursor<V, ID ext
         while ( uuidIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?, ID> candidate = uuidIdxCursor.get();
+            IndexEntry<?> candidate = uuidIdxCursor.get();
             
             if ( approximateEvaluator.evaluate( candidate ) )
             {
@@ -278,7 +280,7 @@ public class ApproximateCursor<V, ID ext
         while ( uuidIdxCursor.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?, ID> candidate = uuidIdxCursor.get();
+            IndexEntry<?> candidate = uuidIdxCursor.get();
             
             if ( approximateEvaluator.evaluate( candidate ) )
             {
@@ -293,7 +295,7 @@ public class ApproximateCursor<V, ID ext
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public IndexEntry<V, ID> get() throws Exception
+    public IndexEntry<V> get() throws Exception
     {
         checkNotClosed( "get()" );
         
@@ -304,7 +306,7 @@ public class ApproximateCursor<V, ID ext
 
         if ( available() )
         {
-            return ( IndexEntry<V, ID> ) uuidIdxCursor.get();
+            return ( IndexEntry<V> ) uuidIdxCursor.get();
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/ApproximateEvaluator.java Wed Nov  9 17:02:09 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.xdbm
 
 
 import java.util.Iterator;
+import java.util.UUID;
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.Index;
@@ -41,7 +42,7 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ApproximateEvaluator<T, ID extends Comparable<ID>> extends LeafEvaluator<T, ID>
+public class ApproximateEvaluator<T> extends LeafEvaluator<T>
 {
     /**
      * Creates a new ApproximateEvaluator
@@ -50,14 +51,14 @@ public class ApproximateEvaluator<T, ID 
      * @param schemaManager The SchemaManager
      * @throws Exception If the creation failed
      */
-    public ApproximateEvaluator( ApproximateNode<T> node, Store<Entry, ID> db, SchemaManager schemaManager )
+    public ApproximateEvaluator( ApproximateNode<T> node, Store db, SchemaManager schemaManager )
         throws Exception
     {
         super( node, db, schemaManager );
         
         if ( db.hasIndexOn( attributeType ) )
         {
-            idx = ( Index<T, Entry, ID> ) db.getIndex( attributeType );
+            idx = ( Index<T> ) db.getIndex( attributeType );
             normalizer = null;
             ldapComparator = null;
         }
@@ -132,7 +133,7 @@ public class ApproximateEvaluator<T, ID 
     /**
      * {@inheritDoc}
      */
-    public boolean evaluate( IndexEntry<?, ID> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?> indexEntry ) throws Exception
     {
         if ( idx != null )
         {

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java Wed Nov  9 17:02:09 2011
@@ -22,6 +22,7 @@ package org.apache.directory.server.xdbm
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.IndexCursor;
@@ -42,13 +43,13 @@ import org.apache.directory.shared.util.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CursorBuilder<ID extends Comparable<ID>>
+public class CursorBuilder
 {
     /** The database used by this builder */
-    private Store<Entry, ID> db = null;
+    private Store db = null;
 
     /** Evaluator dependency on a EvaluatorBuilder */
-    private EvaluatorBuilder<ID> evaluatorBuilder;
+    private EvaluatorBuilder evaluatorBuilder;
 
 
     /**
@@ -57,48 +58,48 @@ public class CursorBuilder<ID extends Co
      * @param db database used by this enumerator
      * @param evaluatorBuilder the evaluator builder
      */
-    public CursorBuilder( Store<Entry, ID> db, EvaluatorBuilder<ID> evaluatorBuilder )
+    public CursorBuilder( Store db, EvaluatorBuilder evaluatorBuilder )
     {
         this.db = db;
         this.evaluatorBuilder = evaluatorBuilder;
     }
 
 
-    public <T> IndexCursor<?, Entry, ID> build( ExprNode node ) throws Exception
+    public <T> IndexCursor<?> build( ExprNode node ) throws Exception
     {
         switch ( node.getAssertionType() )
         {
             /* ---------- LEAF NODE HANDLING ---------- */
 
             case APPROXIMATE:
-                return new ApproximateCursor<T, ID>( db, ( ApproximateEvaluator<T, ID> ) evaluatorBuilder.build( node ) );
+                return new ApproximateCursor<T>( db, ( ApproximateEvaluator<T> ) evaluatorBuilder.build( node ) );
 
             case EQUALITY:
-                return new EqualityCursor<T, ID>( db, ( EqualityEvaluator<T, ID> ) evaluatorBuilder.build( node ) );
+                return new EqualityCursor<T>( db, ( EqualityEvaluator<T> ) evaluatorBuilder.build( node ) );
 
             case GREATEREQ:
-                return new GreaterEqCursor<T, ID>( db, ( GreaterEqEvaluator<T, ID> ) evaluatorBuilder.build( node ) );
+                return new GreaterEqCursor<T>( db, ( GreaterEqEvaluator<T> ) evaluatorBuilder.build( node ) );
 
             case LESSEQ:
-                return new LessEqCursor<T, ID>( db, ( LessEqEvaluator<T, ID> ) evaluatorBuilder.build( node ) );
+                return new LessEqCursor<T>( db, ( LessEqEvaluator<T> ) evaluatorBuilder.build( node ) );
 
             case PRESENCE:
-                return new PresenceCursor<ID>( db, ( PresenceEvaluator<ID> ) evaluatorBuilder.build( node ) );
+                return new PresenceCursor( db, ( PresenceEvaluator ) evaluatorBuilder.build( node ) );
 
             case SCOPE:
                 if ( ( ( ScopeNode ) node ).getScope() == SearchScope.ONELEVEL )
                 {
-                    return new OneLevelScopeCursor<ID>( db,
-                        ( OneLevelScopeEvaluator<Entry, ID> ) evaluatorBuilder.build( node ) );
+                    return new OneLevelScopeCursor( db,
+                        ( OneLevelScopeEvaluator ) evaluatorBuilder.build( node ) );
                 }
                 else
                 {
-                    return new SubtreeScopeCursor<ID>( db, ( SubtreeScopeEvaluator<Entry, ID> ) evaluatorBuilder
+                    return new SubtreeScopeCursor( db, ( SubtreeScopeEvaluator ) evaluatorBuilder
                         .build( node ) );
                 }
 
             case SUBSTRING:
-                return new SubstringCursor<ID>( db, ( SubstringEvaluator<ID> ) evaluatorBuilder.build( node ) );
+                return new SubstringCursor( db, ( SubstringEvaluator ) evaluatorBuilder.build( node ) );
 
                 /* ---------- LOGICAL OPERATORS ---------- */
 
@@ -106,7 +107,7 @@ public class CursorBuilder<ID extends Co
                 return buildAndCursor( ( AndNode ) node );
 
             case NOT:
-                return new NotCursor<ID, ID>( db, evaluatorBuilder.build( ( ( NotNode ) node ).getFirstChild() ) );
+                return new NotCursor<UUID>( db, evaluatorBuilder.build( ( ( NotNode ) node ).getFirstChild() ) );
 
             case OR:
                 return buildOrCursor( ( OrNode ) node );
@@ -130,12 +131,12 @@ public class CursorBuilder<ID extends Co
      * @return Cursor over candidates satisfying disjunction expression
      * @throws Exception on db access failures
      */
-    private IndexCursor<?, Entry, ID> buildOrCursor( OrNode node ) throws Exception
+    private IndexCursor<?> buildOrCursor( OrNode node ) throws Exception
     {
         List<ExprNode> children = node.getChildren();
-        List<IndexCursor<?, Entry, ID>> childCursors = new ArrayList<IndexCursor<?, Entry, ID>>(
+        List<IndexCursor<?>> childCursors = new ArrayList<IndexCursor<?>>(
             children.size() );
-        List<Evaluator<? extends ExprNode, Entry, ID>> childEvaluators = new ArrayList<Evaluator<? extends ExprNode, Entry, ID>>(
+        List<Evaluator<? extends ExprNode>> childEvaluators = new ArrayList<Evaluator<? extends ExprNode>>(
             children.size() );
 
         // Recursively create Cursors and Evaluators for each child expression node
@@ -156,7 +157,7 @@ public class CursorBuilder<ID extends Co
      * @return Cursor over the conjunction expression
      * @throws Exception on db access failures
      */
-    private IndexCursor<?, Entry, ID> buildAndCursor( AndNode node ) throws Exception
+    private IndexCursor<?> buildAndCursor( AndNode node ) throws Exception
     {
         int minIndex = 0;
         long minValue = Long.MAX_VALUE;
@@ -190,7 +191,7 @@ public class CursorBuilder<ID extends Co
 
         // Once found we build the child Evaluators minus the one for the minChild
         ExprNode minChild = children.get( minIndex );
-        List<Evaluator<? extends ExprNode, Entry, ID>> childEvaluators = new ArrayList<Evaluator<? extends ExprNode, Entry, ID>>(
+        List<Evaluator<? extends ExprNode>> childEvaluators = new ArrayList<Evaluator<? extends ExprNode>>(
             children.size() - 1 );
         
         for ( ExprNode child : children )
@@ -204,7 +205,7 @@ public class CursorBuilder<ID extends Co
         }
 
         // Do recursive call to build min child Cursor then create AndCursor
-        IndexCursor<?, Entry, ID> childCursor = build( minChild );
+        IndexCursor<?> childCursor = build( minChild );
         
         return new AndCursor( childCursor, childEvaluators );
     }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultOptimizer.java Wed Nov  9 17:02:09 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.xdbm
 
 
 import java.util.List;
+import java.util.UUID;
 
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.i18n.I18n;
@@ -50,11 +51,11 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DefaultOptimizer<E, ID extends Comparable<ID>> implements Optimizer
+public class DefaultOptimizer implements Optimizer
 {
     /** the database this optimizer operates on */
-    private final Store<E, ID> db;
-    private ID contextEntryId;
+    private final Store db;
+    private UUID contextEntryId;
 
 
     /**
@@ -62,7 +63,7 @@ public class DefaultOptimizer<E, ID exte
      *
      * @param db the database this optimizer works for.
      */
-    public DefaultOptimizer( Store<E, ID> db ) throws Exception
+    public DefaultOptimizer( Store db ) throws Exception
     {
         this.db = db;
     }
@@ -70,7 +71,7 @@ public class DefaultOptimizer<E, ID exte
 
     // This will suppress PMD.EmptyCatchBlock warnings in this method
     @SuppressWarnings("PMD.EmptyCatchBlock")
-    private ID getContextEntryId() throws Exception
+    private UUID getContextEntryId() throws Exception
     {
         if ( contextEntryId == null )
         {
@@ -277,7 +278,7 @@ public class DefaultOptimizer<E, ID exte
     {
         if ( db.hasIndexOn( node.getAttributeType() ) )
         {
-            Index<V, E, ID> idx = ( Index<V, E, ID> ) db.getIndex( node.getAttributeType() );
+            Index<V> idx = ( Index<V> ) db.getIndex( node.getAttributeType() );
             return idx.count( node.getValue().getValue() );
         }
 
@@ -300,7 +301,7 @@ public class DefaultOptimizer<E, ID exte
     {
         if ( db.hasIndexOn( node.getAttributeType() ) )
         {
-            Index<V, E, ID> idx = ( Index<V, E, ID> ) db.getIndex( node.getAttributeType() );
+            Index<V> idx = ( Index<V> ) db.getIndex( node.getAttributeType() );
             if ( isGreaterThan )
             {
                 return idx.greaterThanCount( node.getValue().getValue() );
@@ -329,7 +330,7 @@ public class DefaultOptimizer<E, ID exte
     {
         if ( db.hasIndexOn( node.getAttributeType() ) )
         {
-            Index<?, ?, ?> idx = db.getIndex( node.getAttributeType() );
+            Index<?> idx = db.getIndex( node.getAttributeType() );
             return idx.count();
         }
 
@@ -339,7 +340,7 @@ public class DefaultOptimizer<E, ID exte
 
     /**
      * Gets the number of entries that would be returned by a presence node
-     * assertion.  Leverages the presence system index for scan counts.
+     * assertion.  Leverages the presence system index for scan counts.     
      *
      * @param node the presence node
      * @return the number of entries matched for the presence of an attribute
@@ -349,7 +350,7 @@ public class DefaultOptimizer<E, ID exte
     {
         if ( db.hasUserIndexOn( node.getAttributeType() ) )
         {
-            Index<String, E, ID> idx = db.getPresenceIndex();
+            Index<String> idx = db.getPresenceIndex();
             return idx.count( node.getAttributeType().getOid() );
         }
         else if ( db.hasSystemIndexOn( node.getAttributeType() ) )
@@ -372,7 +373,7 @@ public class DefaultOptimizer<E, ID exte
      */
     private long getScopeScan( ScopeNode node ) throws Exception
     {
-        ID id = db.getEntryId( node.getBaseDn() );
+        UUID id = db.getEntryId( node.getBaseDn() );
         switch ( node.getScope() )
         {
             case OBJECT:
@@ -382,7 +383,7 @@ public class DefaultOptimizer<E, ID exte
                 return db.getChildCount( id );
 
             case SUBTREE:
-                if ( id == getContextEntryId() )
+                if ( id.compareTo( getContextEntryId() ) == 0 )
                 {
                     return db.count();
                 }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import java.util.UUID;
+
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.api.partition.Partition;
@@ -50,16 +52,16 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DefaultSearchEngine<ID extends Comparable<ID>> implements SearchEngine<Entry, ID>
+public class DefaultSearchEngine implements SearchEngine
 {
     /** the Optimizer used by this DefaultSearchEngine */
     private final Optimizer optimizer;
     /** the Database this DefaultSearchEngine operates on */
-    private final Store<Entry, ID> db;
+    private final Store db;
     /** creates Cursors over entries satisfying filter expressions */
-    private final CursorBuilder<ID> cursorBuilder;
+    private final CursorBuilder cursorBuilder;
     /** creates evaluators which check to see if candidates satisfy a filter expression */
-    private final EvaluatorBuilder<ID> evaluatorBuilder;
+    private final EvaluatorBuilder evaluatorBuilder;
 
 
     // ------------------------------------------------------------------------
@@ -74,8 +76,8 @@ public class DefaultSearchEngine<ID exte
      * @param evaluatorBuilder an expression evaluator builder
      * @param optimizer an optimizer to use during search
      */
-    public DefaultSearchEngine( Store<Entry, ID> db, CursorBuilder<ID> cursorBuilder,
-        EvaluatorBuilder<ID> evaluatorBuilder, Optimizer optimizer )
+    public DefaultSearchEngine( Store db, CursorBuilder cursorBuilder,
+        EvaluatorBuilder evaluatorBuilder, Optimizer optimizer )
     {
         this.db = db;
         this.optimizer = optimizer;
@@ -98,11 +100,11 @@ public class DefaultSearchEngine<ID exte
     /**
      * @see SearchEngine#cursor(org.apache.directory.shared.ldap.model.name.Dn, org.apache.directory.shared.ldap.model.message.AliasDerefMode, ExprNode, SearchControls)
      */
-    public IndexCursor<ID, Entry, ID> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
+    public IndexCursor<UUID> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
         SearchControls searchCtls ) throws Exception
     {
         Dn effectiveBase;
-        ID baseId = db.getEntryId( base );
+        UUID baseId = db.getEntryId( base );
 
         // Check that we have an entry, otherwise we can immediately get out
         if ( baseId == null )
@@ -110,7 +112,7 @@ public class DefaultSearchEngine<ID exte
             if ( ((Partition)db).getSuffixDn().equals( base ) )
             {
                 // The context entry is not created yet, return an empty cursor
-                return new EmptyIndexCursor<ID, Entry, ID>();
+                return new EmptyIndexCursor<UUID>();
             }
             else
             {
@@ -151,24 +153,24 @@ public class DefaultSearchEngine<ID exte
 
         if ( searchCtls.getSearchScope() == SearchControls.OBJECT_SCOPE )
         {
-            ID effectiveBaseId = baseId;
+            UUID effectiveBaseId = baseId;
             if ( effectiveBase != base )
             {
                 effectiveBaseId = db.getEntryId( effectiveBase );
             }
 
-            IndexEntry<ID, ID> indexEntry = new ForwardIndexEntry<ID, ID>();
+            IndexEntry<UUID> indexEntry = new ForwardIndexEntry<UUID>();
             indexEntry.setId( effectiveBaseId );
             optimizer.annotate( filter );
-            Evaluator<? extends ExprNode, Entry, ID> evaluator = evaluatorBuilder.build( filter );
+            Evaluator<? extends ExprNode> evaluator = evaluatorBuilder.build( filter );
 
             if ( evaluator.evaluate( indexEntry ) )
             {
-                return new SingletonIndexCursor<ID, ID>( indexEntry );
+                return new SingletonIndexCursor<UUID>( indexEntry );
             }
             else
             {
-                return new EmptyIndexCursor<ID, Entry, ID>();
+                return new EmptyIndexCursor<UUID>();
             }
         }
 
@@ -181,14 +183,14 @@ public class DefaultSearchEngine<ID exte
 
         // Annotate the node with the optimizer and return search enumeration.
         optimizer.annotate( root );
-        return ( IndexCursor<ID, Entry, ID> ) cursorBuilder.build( root );
+        return ( IndexCursor<UUID> ) cursorBuilder.build( root );
     }
 
 
     /**
      * @see SearchEngine#evaluator(ExprNode)
      */
-    public Evaluator<? extends ExprNode, Entry, ID> evaluator( ExprNode filter ) throws Exception
+    public Evaluator<? extends ExprNode> evaluator( ExprNode filter ) throws Exception
     {
         return evaluatorBuilder.build( filter );
     }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityCursor.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
 import org.apache.directory.server.core.api.partition.index.Index;
@@ -41,19 +43,19 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EqualityCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
+public class EqualityCursor<V> extends AbstractIndexCursor<V>
 {
     /** The message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_714 );
 
     /** An equality evaluator for candidates */
-    private final EqualityEvaluator<V, ID> equalityEvaluator;
+    private final EqualityEvaluator<V> equalityEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V, Entry, ID> userIdxCursor;
+    private final IndexCursor<V> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<String, Entry, ID> uuidIdxCursor;
+    private final IndexCursor<String> uuidIdxCursor;
 
 
     /**
@@ -63,7 +65,7 @@ public class EqualityCursor<V, ID extend
      * @throws Exception If the creation failed
      */
     @SuppressWarnings("unchecked")
-    public EqualityCursor( Store<Entry, ID> db, EqualityEvaluator<V, ID> equalityEvaluator ) throws Exception
+    public EqualityCursor( Store db, EqualityEvaluator<V> equalityEvaluator ) throws Exception
     {
         this.equalityEvaluator = equalityEvaluator;
 
@@ -72,7 +74,7 @@ public class EqualityCursor<V, ID extend
         
         if ( db.hasIndexOn( attributeType ) )
         {
-            Index<V, Entry, ID> userIndex = ( Index<V, Entry, ID> ) db.getIndex( attributeType );
+            Index<V> userIndex = ( Index<V> ) db.getIndex( attributeType );
             userIdxCursor = userIndex.forwardCursor( value.getValue() );
             uuidIdxCursor = null;
         }
@@ -110,7 +112,7 @@ public class EqualityCursor<V, ID extend
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, V value ) throws Exception
+    public void beforeValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "beforeValue()" );
         
@@ -128,7 +130,7 @@ public class EqualityCursor<V, ID extend
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<V, ID> element ) throws Exception
+    public void before( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "before()" );
         
@@ -146,7 +148,7 @@ public class EqualityCursor<V, ID extend
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID id, V value ) throws Exception
+    public void afterValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "afterValue()" );
         
@@ -165,7 +167,7 @@ public class EqualityCursor<V, ID extend
     /**
      * {@inheritDoc}
      */
-    public void after( IndexEntry<V, ID> element ) throws Exception
+    public void after( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "after()" );
         
@@ -255,7 +257,7 @@ public class EqualityCursor<V, ID extend
         while ( uuidIdxCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?, ID> candidate = uuidIdxCursor.get();
+            IndexEntry<?> candidate = uuidIdxCursor.get();
             
             if ( equalityEvaluator.evaluate( candidate ) )
             {
@@ -280,7 +282,7 @@ public class EqualityCursor<V, ID extend
         while ( uuidIdxCursor.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?, ID> candidate = uuidIdxCursor.get();
+            IndexEntry<?> candidate = uuidIdxCursor.get();
             
             if ( equalityEvaluator.evaluate( candidate ) )
             {
@@ -296,7 +298,7 @@ public class EqualityCursor<V, ID extend
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public IndexEntry<V, ID> get() throws Exception
+    public IndexEntry<V> get() throws Exception
     {
         checkNotClosed( "get()" );
         
@@ -307,7 +309,7 @@ public class EqualityCursor<V, ID extend
 
         if ( available() )
         {
-            return ( IndexEntry<V, ID> ) uuidIdxCursor.get();
+            return ( IndexEntry<V> ) uuidIdxCursor.get();
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EqualityEvaluator.java Wed Nov  9 17:02:09 2011
@@ -22,6 +22,7 @@ package org.apache.directory.server.xdbm
 
 import java.util.Comparator;
 import java.util.Iterator;
+import java.util.UUID;
 
 import org.apache.directory.server.core.api.partition.index.Index;
 import org.apache.directory.server.core.api.partition.index.IndexEntry;
@@ -45,7 +46,7 @@ import org.apache.directory.shared.util.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EqualityEvaluator<T, ID extends Comparable<ID>> extends LeafEvaluator<T, ID>
+public class EqualityEvaluator<T> extends LeafEvaluator<T>
 {
     /** The default byte[] comparator if no comparator has been defined */
     private static final Comparator<byte[]> BINARY_COMPARATOR = new ByteArrayComparator( null );
@@ -55,14 +56,14 @@ public class EqualityEvaluator<T, ID ext
 
 
     @SuppressWarnings("unchecked")
-    public EqualityEvaluator( EqualityNode<T> node, Store<Entry, ID> db, SchemaManager schemaManager )
+    public EqualityEvaluator( EqualityNode<T> node, Store db, SchemaManager schemaManager )
         throws Exception
     {
         super( node, db, schemaManager );
 
         if ( db.hasIndexOn( attributeType ) )
         {
-            idx = ( Index<T, Entry, ID> ) db.getIndex( attributeType );
+            idx = ( Index<T> ) db.getIndex( attributeType );
             normalizer = null;
             ldapComparator = null;
         }
@@ -92,7 +93,7 @@ public class EqualityEvaluator<T, ID ext
     }
 
 
-    public boolean evaluate( IndexEntry<?, ID> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?> indexEntry ) throws Exception
     {
         if ( idx != null )
         {
@@ -151,7 +152,7 @@ public class EqualityEvaluator<T, ID ext
     }
 
 
-    public boolean evaluateId( ID id ) throws Exception
+    public boolean evaluateId( UUID id ) throws Exception
     {
         if ( idx != null )
         {

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/EvaluatorBuilder.java Wed Nov  9 17:02:09 2011
@@ -48,9 +48,9 @@ import org.apache.directory.shared.util.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class EvaluatorBuilder<ID extends Comparable<ID>>
+public class EvaluatorBuilder
 {
-    private final Store<Entry, ID> db;
+    private final Store db;
     private final SchemaManager schemaManager;
 
 
@@ -62,46 +62,46 @@ public class EvaluatorBuilder<ID extends
      * @param schemaManager the schema manager
      * @throws Exception failure to access db or lookup schema in registries
      */
-    public EvaluatorBuilder( Store<Entry, ID> db, SchemaManager schemaManager ) throws Exception
+    public EvaluatorBuilder( Store db, SchemaManager schemaManager ) throws Exception
     {
         this.db = db;
         this.schemaManager = schemaManager;
     }
 
 
-    public <T> Evaluator<? extends ExprNode, Entry, ID> build( ExprNode node ) throws Exception
+    public <T> Evaluator<? extends ExprNode> build( ExprNode node ) throws Exception
     {
         switch ( node.getAssertionType() )
         {
             /* ---------- LEAF NODE HANDLING ---------- */
 
             case APPROXIMATE:
-                return new ApproximateEvaluator<T, ID>( ( ApproximateNode<T> ) node, db, schemaManager );
+                return new ApproximateEvaluator<T>( ( ApproximateNode<T> ) node, db, schemaManager );
 
             case EQUALITY:
-                return new EqualityEvaluator<T, ID>( ( EqualityNode<T> ) node, db, schemaManager );
+                return new EqualityEvaluator<T>( ( EqualityNode<T> ) node, db, schemaManager );
 
             case GREATEREQ:
-                return new GreaterEqEvaluator<T, ID>( ( GreaterEqNode<T> ) node, db, schemaManager );
+                return new GreaterEqEvaluator<T>( ( GreaterEqNode<T> ) node, db, schemaManager );
 
             case LESSEQ:
-                return new LessEqEvaluator<T, ID>( ( LessEqNode<T> ) node, db, schemaManager );
+                return new LessEqEvaluator<T>( ( LessEqNode<T> ) node, db, schemaManager );
 
             case PRESENCE:
-                return new PresenceEvaluator<ID>( ( PresenceNode ) node, db, schemaManager );
+                return new PresenceEvaluator( ( PresenceNode ) node, db, schemaManager );
 
             case SCOPE:
                 if ( ( ( ScopeNode ) node ).getScope() == SearchScope.ONELEVEL )
                 {
-                    return new OneLevelScopeEvaluator<Entry, ID>( db, ( ScopeNode ) node );
+                    return new OneLevelScopeEvaluator( db, ( ScopeNode ) node );
                 }
                 else
                 {
-                    return new SubtreeScopeEvaluator<Entry, ID>( db, ( ScopeNode ) node );
+                    return new SubtreeScopeEvaluator( db, ( ScopeNode ) node );
                 }
 
             case SUBSTRING:
-                return new SubstringEvaluator<ID>( ( SubstringNode ) node, db, schemaManager );
+                return new SubstringEvaluator( ( SubstringNode ) node, db, schemaManager );
 
                 /* ---------- LOGICAL OPERATORS ---------- */
 
@@ -109,7 +109,7 @@ public class EvaluatorBuilder<ID extends
                 return buildAndEvaluator( ( AndNode ) node );
 
             case NOT:
-                return new NotEvaluator<ID>( (NotNode) node, build( ( ( NotNode ) node ).getFirstChild() ) );
+                return new NotEvaluator( (NotNode) node, build( ( ( NotNode ) node ).getFirstChild() ) );
 
             case OR:
                 return buildOrEvaluator( ( OrNode ) node );
@@ -126,28 +126,28 @@ public class EvaluatorBuilder<ID extends
     }
 
 
-    AndEvaluator<ID> buildAndEvaluator( AndNode node ) throws Exception
+    AndEvaluator buildAndEvaluator( AndNode node ) throws Exception
     {
         List<ExprNode> children = node.getChildren();
-        List<Evaluator<? extends ExprNode, Entry, ID>> evaluators = new ArrayList<Evaluator<? extends ExprNode, Entry, ID>>(
+        List<Evaluator<? extends ExprNode>> evaluators = new ArrayList<Evaluator<? extends ExprNode>>(
             children.size() );
         for ( ExprNode child : children )
         {
             evaluators.add( build( child ) );
         }
-        return new AndEvaluator<ID>( node, evaluators );
+        return new AndEvaluator( node, evaluators );
     }
 
 
-    OrEvaluator<ID> buildOrEvaluator( OrNode node ) throws Exception
+    OrEvaluator buildOrEvaluator( OrNode node ) throws Exception
     {
         List<ExprNode> children = node.getChildren();
-        List<Evaluator<? extends ExprNode, Entry, ID>> evaluators = new ArrayList<Evaluator<? extends ExprNode, Entry, ID>>(
+        List<Evaluator<? extends ExprNode>> evaluators = new ArrayList<Evaluator<? extends ExprNode>>(
             children.size() );
         for ( ExprNode child : children )
         {
             evaluators.add( build( child ) );
         }
-        return new OrEvaluator<ID>( node, evaluators );
+        return new OrEvaluator( node, evaluators );
     }
 }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqCursor.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
@@ -41,25 +43,25 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class GreaterEqCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
+public class GreaterEqCursor<V> extends AbstractIndexCursor<V>
 {
     private static final String UNSUPPORTED_MSG = "GreaterEqCursors only support positioning by element when a user index exists on the asserted attribute.";
 
     /** An greater eq evaluator for candidates */
-    private final GreaterEqEvaluator<V, ID> greaterEqEvaluator;
+    private final GreaterEqEvaluator<V> greaterEqEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V, Entry, ID> userIdxCursor;
+    private final IndexCursor<V> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<String, Entry, ID> ndnIdxCursor;
+    private final IndexCursor<String> ndnIdxCursor;
 
     /**
      * Used to store indexEntry from ndnCandidate so it can be saved after
      * call to evaluate() which changes the value so it's not referring to
      * the NDN but to the value of the attribute instead.
      */
-    IndexEntry<String, ID> ndnCandidate;
+    IndexEntry<String> ndnCandidate;
 
 
     /**
@@ -69,7 +71,7 @@ public class GreaterEqCursor<V, ID exten
      * @throws Exception If the creation failed
      */
     @SuppressWarnings("unchecked")
-    public GreaterEqCursor( Store<Entry, ID> db, GreaterEqEvaluator<V, ID> greaterEqEvaluator ) throws Exception
+    public GreaterEqCursor( Store db, GreaterEqEvaluator<V> greaterEqEvaluator ) throws Exception
     {
         this.greaterEqEvaluator = greaterEqEvaluator;
 
@@ -77,7 +79,7 @@ public class GreaterEqCursor<V, ID exten
         
         if ( db.hasIndexOn( attributeType ) )
         {
-            userIdxCursor = ( ( Index<V, Entry, ID> ) db.getIndex( attributeType ) ).forwardCursor();
+            userIdxCursor = ( ( Index<V> ) db.getIndex( attributeType ) ).forwardCursor();
             ndnIdxCursor = null;
         }
         else
@@ -100,7 +102,7 @@ public class GreaterEqCursor<V, ID exten
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, V value ) throws Exception
+    public void beforeValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "beforeValue()" );
         
@@ -134,7 +136,7 @@ public class GreaterEqCursor<V, ID exten
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID id, V value ) throws Exception
+    public void afterValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "afterValue()" );
         
@@ -179,7 +181,7 @@ public class GreaterEqCursor<V, ID exten
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<V, ID> element ) throws Exception
+    public void before( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "before()" );
         
@@ -213,7 +215,7 @@ public class GreaterEqCursor<V, ID exten
     /**
      * {@inheritDoc}
      */
-    public void after( IndexEntry<V, ID> element ) throws Exception
+    public void after( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "after()" );
         
@@ -266,7 +268,7 @@ public class GreaterEqCursor<V, ID exten
         
         if ( userIdxCursor != null )
         {
-            IndexEntry<V, ID> advanceTo = new ForwardIndexEntry<V, ID>();
+            IndexEntry<V> advanceTo = new ForwardIndexEntry<V>();
             advanceTo.setValue( ( V ) greaterEqEvaluator.getExpression().getValue().getValue() );
             userIdxCursor.before( advanceTo );
         }
@@ -339,7 +341,7 @@ public class GreaterEqCursor<V, ID exten
             while ( userIdxCursor.previous() )
             {
                 checkNotClosed( "previous()" );
-                IndexEntry<?, ID> candidate = userIdxCursor.get();
+                IndexEntry<?> candidate = userIdxCursor.get();
                 
                 if ( greaterEqEvaluator.getComparator().compare( candidate.getValue(),
                     greaterEqEvaluator.getExpression().getValue().getValue() ) >= 0 )
@@ -401,7 +403,7 @@ public class GreaterEqCursor<V, ID exten
      * {@inheritDoc}
      */
     @SuppressWarnings("unchecked")
-    public IndexEntry<V, ID> get() throws Exception
+    public IndexEntry<V> get() throws Exception
     {
         checkNotClosed( "get()" );
         
@@ -417,7 +419,7 @@ public class GreaterEqCursor<V, ID exten
 
         if ( available() )
         {
-            return ( IndexEntry<V, ID> ) ndnCandidate;
+            return ( IndexEntry<V> ) ndnCandidate;
         }
 
         throw new InvalidCursorPositionException( I18n.err( I18n.ERR_708 ) );

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/GreaterEqEvaluator.java Wed Nov  9 17:02:09 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.xdbm
 
 
 import java.util.Iterator;
+import java.util.UUID;
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.Index;
@@ -41,17 +42,17 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class GreaterEqEvaluator<T, ID extends Comparable<ID>> extends LeafEvaluator<T, ID>
+public class GreaterEqEvaluator<T> extends LeafEvaluator<T>
 {
     @SuppressWarnings("unchecked")
-    public GreaterEqEvaluator( GreaterEqNode<T> node, Store<Entry, ID> db, SchemaManager schemaManager )
+    public GreaterEqEvaluator( GreaterEqNode<T> node, Store db, SchemaManager schemaManager )
         throws Exception
     {
         super( node, db, schemaManager );
 
         if ( db.hasIndexOn( node.getAttributeType() ) )
         {
-            idx = ( Index<T, Entry, ID> ) db.getIndex( attributeType );
+            idx = ( Index<T> ) db.getIndex( attributeType );
         }
         else
         {
@@ -87,7 +88,7 @@ public class GreaterEqEvaluator<T, ID ex
     }
 
 
-    public boolean evaluate( IndexEntry<?, ID> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?> indexEntry ) throws Exception
     {
         if ( idx != null && idx.isDupsEnabled() )
         {
@@ -116,7 +117,7 @@ public class GreaterEqEvaluator<T, ID ex
 
         // if the attribute exists and has a greater than or equal value return true
         //noinspection unchecked
-        if ( attr != null && evaluate( ( IndexEntry<Object, ID> ) indexEntry, attr ) )
+        if ( attr != null && evaluate( ( IndexEntry<Object> ) indexEntry, attr ) )
         {
             return true;
         }
@@ -138,7 +139,7 @@ public class GreaterEqEvaluator<T, ID ex
                 attr = entry.get( descendant );
 
                 //noinspection unchecked
-                if ( attr != null && evaluate( ( IndexEntry<Object, ID> ) indexEntry, attr ) )
+                if ( attr != null && evaluate( ( IndexEntry<Object> ) indexEntry, attr ) )
                 {
                     return true;
                 }
@@ -150,7 +151,7 @@ public class GreaterEqEvaluator<T, ID ex
     }
 
 
-    public boolean evaluateId( ID id ) throws Exception
+    public boolean evaluateId( UUID id ) throws Exception
     {
         if ( idx != null && idx.isDupsEnabled() )
         {
@@ -202,7 +203,7 @@ public class GreaterEqEvaluator<T, ID ex
 
     // TODO - determine if comaparator and index entry should have the Value
     // wrapper or the raw normalized value 
-    private boolean evaluate( IndexEntry<Object, ID> indexEntry, Attribute attribute )
+    private boolean evaluate( IndexEntry<Object> indexEntry, Attribute attribute )
         throws Exception
     {
         /*

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LeafEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LeafEvaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LeafEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LeafEvaluator.java Wed Nov  9 17:02:09 2011
@@ -36,13 +36,13 @@ import org.apache.directory.shared.ldap.
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class LeafEvaluator<T, ID extends Comparable<ID>> implements Evaluator<SimpleNode<T>, Entry, ID>
+public abstract class LeafEvaluator<T> implements Evaluator<SimpleNode<T>>
 {
     /** The ExprNode to evaluate */
     protected final SimpleNode<T> node;
 
     /** The backend */
-    protected final Store<Entry, ID> db;
+    protected final Store db;
     
     /** The SchemaManager instance */
     protected final SchemaManager schemaManager;
@@ -57,10 +57,10 @@ public abstract class LeafEvaluator<T, I
     protected LdapComparator<? super Object> ldapComparator;
     
     /** The index to use if any */
-    protected Index<T, Entry, ID> idx;
+    protected Index<T> idx;
 
     @SuppressWarnings("unchecked")
-    public LeafEvaluator( SimpleNode<T> node, Store<Entry, ID> db, SchemaManager schemaManager )
+    public LeafEvaluator( SimpleNode<T> node, Store db, SchemaManager schemaManager )
     throws Exception
     {
         this.db = db;

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqCursor.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
 import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
@@ -41,29 +43,29 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LessEqCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
+public class LessEqCursor<V> extends AbstractIndexCursor<V>
 {
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_716 );
 
     /** An less eq evaluator for candidates */
-    private final LessEqEvaluator<V, ID> lessEqEvaluator;
+    private final LessEqEvaluator<V> lessEqEvaluator;
 
     /** Cursor over attribute entry matching filter: set when index present */
-    private final IndexCursor<V, Entry, ID> userIdxCursor;
+    private final IndexCursor<V> userIdxCursor;
 
     /** NDN Cursor on all entries in  (set when no index on user attribute) */
-    private final IndexCursor<V, Entry, ID> uuidIdxCursor;
+    private final IndexCursor<V> uuidIdxCursor;
 
     /**
      * Used to store indexEntry from ndnCandidate so it can be saved after
      * call to evaluate() which changes the value so it's not referring to
      * the NDN but to the value of the attribute instead.
      */
-    IndexEntry<V, ID> ndnCandidate;
+    IndexEntry<V> ndnCandidate;
 
 
     @SuppressWarnings("unchecked")
-    public LessEqCursor( Store<Entry, ID> db, LessEqEvaluator<V, ID> lessEqEvaluator ) throws Exception
+    public LessEqCursor( Store db, LessEqEvaluator<V> lessEqEvaluator ) throws Exception
     {
         this.lessEqEvaluator = lessEqEvaluator;
 
@@ -71,12 +73,12 @@ public class LessEqCursor<V, ID extends 
         
         if ( db.hasIndexOn( attributeType ) )
         {
-            userIdxCursor = ( ( Index<V, Entry, ID> ) db.getIndex( attributeType ) ).forwardCursor();
+            userIdxCursor = ( ( Index<V> ) db.getIndex( attributeType ) ).forwardCursor();
             uuidIdxCursor = null;
         }
         else
         {
-            uuidIdxCursor = ( IndexCursor<V, Entry, ID> ) db.getEntryUuidIndex().forwardCursor();
+            uuidIdxCursor = ( IndexCursor<V> ) db.getEntryUuidIndex().forwardCursor();
             userIdxCursor = null;
         }
     }
@@ -94,7 +96,7 @@ public class LessEqCursor<V, ID extends 
     /**
      * {@inheritDoc}
      */
-    public void beforeValue( ID id, V value ) throws Exception
+    public void beforeValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "beforeValue()" );
         
@@ -145,7 +147,7 @@ public class LessEqCursor<V, ID extends 
     /**
      * {@inheritDoc}
      */
-    public void before( IndexEntry<V, ID> element ) throws Exception
+    public void before( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "before()" );
         
@@ -193,7 +195,7 @@ public class LessEqCursor<V, ID extends 
     /**
      * {@inheritDoc}
      */
-    public void afterValue( ID id, V value ) throws Exception
+    public void afterValue( UUID id, V value ) throws Exception
     {
         checkNotClosed( "afterValue()" );
         
@@ -234,7 +236,7 @@ public class LessEqCursor<V, ID extends 
     /**
      * {@inheritDoc}
      */
-    public void after( IndexEntry<V, ID> element ) throws Exception
+    public void after( IndexEntry<V> element ) throws Exception
     {
         checkNotClosed( "after()" );
         
@@ -293,7 +295,7 @@ public class LessEqCursor<V, ID extends 
         checkNotClosed( "afterLast()" );
         if ( userIdxCursor != null )
         {
-            IndexEntry<V, ID> advanceTo = new ForwardIndexEntry<V, ID>();
+            IndexEntry<V> advanceTo = new ForwardIndexEntry<V>();
             //noinspection unchecked
             advanceTo.setValue( ( V ) lessEqEvaluator.getExpression().getValue().getValue() );
             userIdxCursor.after( advanceTo );
@@ -369,7 +371,7 @@ public class LessEqCursor<V, ID extends 
             while ( userIdxCursor.next() )
             {
                 checkNotClosed( "next()" );
-                IndexEntry<?, ID> candidate = userIdxCursor.get();
+                IndexEntry<?> candidate = userIdxCursor.get();
                 
                 if ( lessEqEvaluator.getComparator().compare( candidate.getValue(),
                     lessEqEvaluator.getExpression().getValue().getValue() ) <= 0 )
@@ -400,7 +402,7 @@ public class LessEqCursor<V, ID extends 
     }
 
 
-    public IndexEntry<V, ID> get() throws Exception
+    public IndexEntry<V> get() throws Exception
     {
         checkNotClosed( "get()" );
         

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/LessEqEvaluator.java Wed Nov  9 17:02:09 2011
@@ -21,6 +21,7 @@ package org.apache.directory.server.xdbm
 
 
 import java.util.Iterator;
+import java.util.UUID;
 
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.Index;
@@ -41,17 +42,17 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LessEqEvaluator<T, ID extends Comparable<ID>> extends LeafEvaluator<T, ID>
+public class LessEqEvaluator<T> extends LeafEvaluator<T>
 {
     @SuppressWarnings("unchecked")
-    public LessEqEvaluator( LessEqNode<T> node, Store<Entry, ID> db, SchemaManager schemaManager )
+    public LessEqEvaluator( LessEqNode<T> node, Store db, SchemaManager schemaManager )
         throws Exception
     {
         super( node, db, schemaManager );
 
         if ( db.hasIndexOn( attributeType ) )
         {
-            idx = ( Index<T, Entry, ID> ) db.getIndex( attributeType );
+            idx = ( Index<T> ) db.getIndex( attributeType );
         }
         else
         {
@@ -87,7 +88,7 @@ public class LessEqEvaluator<T, ID exten
     }
 
 
-    public boolean evaluateId( ID id ) throws Exception
+    public boolean evaluateId( UUID id ) throws Exception
     {
         if ( ( idx != null ) && idx.isDupsEnabled() )
         {
@@ -98,7 +99,7 @@ public class LessEqEvaluator<T, ID exten
     }
 
 
-    public boolean evaluate( IndexEntry<?, ID> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?> indexEntry ) throws Exception
     {
         if ( ( idx != null ) && idx.isDupsEnabled() )
         {
@@ -124,7 +125,7 @@ public class LessEqEvaluator<T, ID exten
 
         // if the attribute does not exist just return false
         //noinspection unchecked
-        if ( attr != null && evaluate( ( IndexEntry<Object, ID> ) indexEntry, attr ) )
+        if ( attr != null && evaluate( ( IndexEntry<Object> ) indexEntry, attr ) )
         {
             return true;
         }
@@ -146,7 +147,7 @@ public class LessEqEvaluator<T, ID exten
                 attr = entry.get( descendant );
 
                 //noinspection unchecked
-                if ( attr != null && evaluate( ( IndexEntry<Object, ID> ) indexEntry, attr ) )
+                if ( attr != null && evaluate( ( IndexEntry<Object> ) indexEntry, attr ) )
                 {
                     return true;
                 }
@@ -199,7 +200,7 @@ public class LessEqEvaluator<T, ID exten
 
     // TODO - determine if comaparator and index entry should have the Value
     // wrapper or the raw normalized value
-    private boolean evaluate( IndexEntry<Object, ID> indexEntry, Attribute attribute )
+    private boolean evaluate( IndexEntry<Object> indexEntry, Attribute attribute )
         throws Exception
     {
         /*

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotCursor.java Wed Nov  9 17:02:09 2011
@@ -36,19 +36,19 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class NotCursor<V, ID extends Comparable<ID>> extends AbstractIndexCursor<V, Entry, ID>
+public class NotCursor<V> extends AbstractIndexCursor<V>
 {
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_718 );
-    private final IndexCursor<V, Entry, ID> uuidCursor;
-    private final Evaluator<? extends ExprNode, Entry, ID> childEvaluator;
+    private final IndexCursor<V> uuidCursor;
+    private final Evaluator<? extends ExprNode> childEvaluator;
 
 
     @SuppressWarnings("unchecked")
-    public NotCursor( Store<Entry, ID> store, Evaluator<? extends ExprNode, Entry, ID> childEvaluator )
+    public NotCursor( Store store, Evaluator<? extends ExprNode> childEvaluator )
         throws Exception
     {
         this.childEvaluator = childEvaluator;
-        this.uuidCursor = ( IndexCursor<V, Entry, ID> ) store.getEntryUuidIndex().forwardCursor();
+        this.uuidCursor = ( IndexCursor<V> ) store.getEntryUuidIndex().forwardCursor();
     }
 
 
@@ -98,7 +98,7 @@ public class NotCursor<V, ID extends Com
         while ( uuidCursor.previous() )
         {
             checkNotClosed( "previous()" );
-            IndexEntry<?, ID> candidate = uuidCursor.get();
+            IndexEntry<?> candidate = uuidCursor.get();
             
             if ( !childEvaluator.evaluate( candidate ) )
             {
@@ -115,7 +115,7 @@ public class NotCursor<V, ID extends Com
         while ( uuidCursor.next() )
         {
             checkNotClosed( "next()" );
-            IndexEntry<?, ID> candidate = uuidCursor.get();
+            IndexEntry<?> candidate = uuidCursor.get();
             
             if ( !childEvaluator.evaluate( candidate ) )
             {
@@ -127,7 +127,7 @@ public class NotCursor<V, ID extends Com
     }
 
 
-    public IndexEntry<V, ID> get() throws Exception
+    public IndexEntry<V> get() throws Exception
     {
         checkNotClosed( "get()" );
         

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/NotEvaluator.java Wed Nov  9 17:02:09 2011
@@ -32,16 +32,16 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class NotEvaluator<ID> implements Evaluator<NotNode, Entry, ID>
+public class NotEvaluator implements Evaluator<NotNode>
 {
     /** The ExprNode to evaluate */
     private final NotNode node;
 
     /** The Evaluator to use for the inner Node */
-    private final Evaluator<? extends ExprNode, Entry, ID> childEvaluator;
+    private final Evaluator<? extends ExprNode> childEvaluator;
 
 
-    public NotEvaluator( NotNode node, Evaluator<? extends ExprNode, Entry, ID> childEvaluator )
+    public NotEvaluator( NotNode node, Evaluator<? extends ExprNode> childEvaluator )
     {
         this.node = node;
         this.childEvaluator = childEvaluator;
@@ -54,7 +54,7 @@ public class NotEvaluator<ID> implements
     }
 
 
-    public boolean evaluate( IndexEntry<?, ID> indexEntry ) throws Exception
+    public boolean evaluate( IndexEntry<?> indexEntry ) throws Exception
     {
         return !childEvaluator.evaluate( indexEntry );
     }

Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java?rev=1199849&r1=1199848&r2=1199849&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/OneLevelScopeCursor.java Wed Nov  9 17:02:09 2011
@@ -20,6 +20,8 @@
 package org.apache.directory.server.xdbm.search.impl;
 
 
+import java.util.UUID;
+
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.core.api.partition.index.AbstractIndexCursor;
 import org.apache.directory.server.core.api.partition.index.IndexCursor;
@@ -36,26 +38,26 @@ import org.apache.directory.shared.ldap.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class OneLevelScopeCursor<ID extends Comparable<ID>> extends AbstractIndexCursor<ID, Entry, ID>
+public class OneLevelScopeCursor extends AbstractIndexCursor<UUID>
 {
     /** Error message for unsupported operations */
     private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 );
 
     /** The entry database/store */
-    private final Store<Entry, ID> db;
+    private final Store db;
 
     /** A onelevel ScopeNode Evaluator */
     @SuppressWarnings("unchecked")
     private final OneLevelScopeEvaluator evaluator;
 
     /** A Cursor over the entries in the scope of the search base */
-    private final IndexCursor<ID, Entry, ID> scopeCursor;
+    private final IndexCursor<UUID> scopeCursor;
 
     /** A Cursor over entries brought into scope by alias dereferencing */
-    private final Cursor<IndexEntry<ID, ID>> dereferencedCursor;
+    private final Cursor<IndexEntry<UUID>> dereferencedCursor;
 
     /** Currently active Cursor: we switch between two cursors */
-    private Cursor<IndexEntry<ID, ID>> cursor;
+    private Cursor<IndexEntry<UUID>> cursor;
 
 
     /**
@@ -66,7 +68,7 @@ public class OneLevelScopeCursor<ID exte
      * @throws Exception on db access failures
      */
     //@SuppressWarnings("unchecked")
-    public OneLevelScopeCursor( Store<Entry, ID> db, OneLevelScopeEvaluator<Entry, ID> evaluator )
+    public OneLevelScopeCursor( Store db, OneLevelScopeEvaluator evaluator )
         throws Exception
     {
         this.db = db;
@@ -266,7 +268,7 @@ public class OneLevelScopeCursor<ID exte
     }
 
 
-    public IndexEntry<ID, ID> get() throws Exception
+    public IndexEntry<UUID> get() throws Exception
     {
         checkNotClosed( "get()" );
         



Mime
View raw message