You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2012/08/24 17:07:32 UTC
svn commit: r1376953 [1/2] - in /directory/apacheds/branches/apacheds-mvbt:
jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/
ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/
server-co...
Author: elecharny
Date: Fri Aug 24 15:07:31 2012
New Revision: 1376953
URL: http://svn.apache.org/viewvc?rev=1376953&view=rev
Log:
o Removed the IndexCursor interface, it's not useful anymore.
o Changed the classes implementing this interface all over the code
Removed:
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/IndexCursor.java
Modified:
directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NestedFilterTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/NotCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/OrCursorTest.java
directory/apacheds/branches/apacheds-mvbt/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java
directory/apacheds/branches/apacheds-mvbt/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
directory/apacheds/branches/apacheds-mvbt/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/IndexUtils.java
Modified: directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Fri Aug 24 15:07:31 2012
@@ -35,7 +35,7 @@ import org.apache.directory.server.i18n.
import org.apache.directory.server.xdbm.AbstractIndex;
import org.apache.directory.server.xdbm.EmptyIndexCursor;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.EmptyCursor;
import org.apache.directory.shared.ldap.model.cursor.Tuple;
@@ -429,7 +429,7 @@ public class JdbmIndex<K, V> extends Abs
// Index Cursor Operations
// ------------------------------------------------------------------------
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> reverseCursor() throws Exception
+ public Cursor<IndexEntry<K, Long>> reverseCursor() throws Exception
{
if ( withReverse )
{
@@ -443,14 +443,14 @@ public class JdbmIndex<K, V> extends Abs
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> forwardCursor() throws Exception
+ public Cursor<IndexEntry<K, Long>> forwardCursor() throws Exception
{
return new IndexCursorAdaptor<K, Long>( ( Cursor ) forward.cursor(), true );
}
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> reverseCursor( Long id ) throws Exception
+ public Cursor<IndexEntry<K, Long>> reverseCursor( Long id ) throws Exception
{
if ( withReverse )
{
@@ -464,7 +464,7 @@ public class JdbmIndex<K, V> extends Abs
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> forwardCursor( K key ) throws Exception
+ public Cursor<IndexEntry<K, Long>> forwardCursor( K key ) throws Exception
{
return new IndexCursorAdaptor<K, Long>( ( Cursor ) forward.cursor( key ), true );
}
Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Fri Aug 24 15:07:31 2012
@@ -35,12 +35,12 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.ParentIdAndRdn;
import org.apache.directory.server.xdbm.SingletonIndexCursor;
import org.apache.directory.server.xdbm.search.cursor.DescendantCursor;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.Modification;
@@ -392,11 +392,11 @@ public class LdifPartition extends Abstr
indexEntry.setId( baseId );
indexEntry.setKey( parentIdAndRdn );
- IndexCursor<ParentIdAndRdn<Long>, Long> cursor = new SingletonIndexCursor<ParentIdAndRdn<Long>, Long>(
+ Cursor<IndexEntry<ParentIdAndRdn<Long>, Long>> cursor = new SingletonIndexCursor<ParentIdAndRdn<Long>, Long>(
indexEntry );
Long parentId = parentIdAndRdn.getParentId();
- IndexCursor<Long, Long> scopeCursor = new DescendantCursor( this, baseId, parentId, cursor );
+ Cursor<IndexEntry<Long, Long>> scopeCursor = new DescendantCursor( this, baseId, parentId, cursor );
// Then, if there are some children, move then to the new place
try
Modified: directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/SingleFileLdifPartition.java Fri Aug 24 15:07:31 2012
@@ -36,10 +36,10 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.ParentIdAndRdn;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.Modification;
@@ -328,7 +328,7 @@ public class SingleFileLdifPartition ext
private void appendRecursive( Long id, int nbSibbling ) throws Exception
{
// Start with the root
- IndexCursor<ParentIdAndRdn<Long>, Long> cursor = rdnIdx.forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn<Long>, Long>> cursor = rdnIdx.forwardCursor();
IndexEntry<ParentIdAndRdn<Long>, Long> startingPos = new ForwardIndexEntry<ParentIdAndRdn<Long>, Long>();
startingPos.setKey( new ParentIdAndRdn<Long>( id, ( Rdn[] ) null ) );
Modified: directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Fri Aug 24 15:07:31 2012
@@ -39,9 +39,10 @@ import org.apache.directory.server.confi
import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.search.SearchEngine;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.StringValue;
@@ -726,7 +727,7 @@ public class ConfigPartitionReader
// Prepare the search request
AttributeType adsdAt = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
EqualityNode<?> filter = new EqualityNode( adsdAt, new StringValue( name ) );
- IndexCursor<Long, Long> cursor = null;
+ Cursor<IndexEntry<Long, Long>> cursor = null;
// Create a container for all the read beans
List<AdsBaseBean> beans = new ArrayList<AdsBaseBean>();
Modified: directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/server-integ/src/test/java/org/apache/directory/IndexTest.java Fri Aug 24 15:07:31 2012
@@ -29,9 +29,10 @@ import java.io.File;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.schema.AttributeType;
import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -129,7 +130,7 @@ public class IndexTest
assertEquals( 26, idx.count() );
- IndexCursor<String, Long> cursor1 = idx.forwardCursor();
+ Cursor<IndexEntry<String, Long>> cursor1 = idx.forwardCursor();
cursor1.beforeFirst();
assertHasNext( cursor1, 1L );
@@ -148,7 +149,7 @@ public class IndexTest
}
- private void assertHasNext( IndexCursor<String, Long> cursor1, long expectedId ) throws Exception
+ private void assertHasNext( Cursor<IndexEntry<String, Long>> cursor1, long expectedId ) throws Exception
{
assertTrue( cursor1.next() );
assertEquals( expectedId, cursor1.get().getId().longValue() );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java Fri Aug 24 15:07:31 2012
@@ -51,7 +51,6 @@ import org.apache.directory.server.core.
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.IndexNotFoundException;
import org.apache.directory.server.xdbm.MasterTable;
@@ -61,6 +60,7 @@ import org.apache.directory.server.xdbm.
import org.apache.directory.server.xdbm.search.SearchEngine;
import org.apache.directory.server.xdbm.search.cursor.ChildrenCursor;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Attribute;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.Modification;
@@ -546,7 +546,7 @@ public abstract class AbstractBTreeParti
public void dumpRdnIdx( ID id, String tabs ) throws Exception
{
// Start with the root
- IndexCursor<ParentIdAndRdn<ID>, ID> cursor = rdnIdx.forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor = rdnIdx.forwardCursor();
IndexEntry<ParentIdAndRdn<ID>, ID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<ID>, ID>();
startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
@@ -565,7 +565,7 @@ public abstract class AbstractBTreeParti
private void dumpRdnIdx( ID id, int nbSibbling, String tabs ) throws Exception
{
// Start with the root
- IndexCursor<ParentIdAndRdn<ID>, ID> cursor = rdnIdx.forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor = rdnIdx.forwardCursor();
IndexEntry<ParentIdAndRdn<ID>, ID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<ID>, ID>();
startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
@@ -928,13 +928,13 @@ public abstract class AbstractBTreeParti
/**
* {@inheritDoc}
*/
- public final IndexCursor<ID, ID> list( ID id ) throws LdapException
+ public final Cursor<IndexEntry<ID, ID>> list( ID id ) throws LdapException
{
try
{
// We use the OneLevel index to get all the entries from a starting point
// and below up to the number of children
- IndexCursor<ParentIdAndRdn<ID>, ID> cursor = rdnIdx.forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor = rdnIdx.forwardCursor();
IndexEntry<ParentIdAndRdn<ID>, ID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<ID>, ID>();
startingPos.setKey( new ParentIdAndRdn( id, ( Rdn[] ) null ) );
@@ -962,7 +962,7 @@ public abstract class AbstractBTreeParti
try
{
SearchScope scope = searchContext.getScope();
- IndexCursor<ID, ID> underlying;
+ Cursor<IndexEntry<ID, ID>> underlying;
Dn dn = searchContext.getDn();
AliasDerefMode derefMode = searchContext.getAliasDerefMode();
ExprNode filter = searchContext.getFilter();
@@ -2655,7 +2655,7 @@ public abstract class AbstractBTreeParti
{
try
{
- IndexCursor<?, ID> cursor = index.forwardCursor();
+ Cursor<IndexEntry<?, ID>> cursor = ( Cursor ) index.forwardCursor();
while ( cursor.next() )
{
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/EntryCursorAdaptor.java Fri Aug 24 15:07:31 2012
@@ -22,7 +22,6 @@ package org.apache.directory.server.core
import java.util.Iterator;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.shared.i18n.I18n;
import org.apache.directory.shared.ldap.model.cursor.ClosureMonitor;
@@ -44,10 +43,10 @@ public class EntryCursorAdaptor<ID exten
private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
private final AbstractBTreePartition<ID> db;
- private final IndexCursor<ID, ID> indexCursor;
+ private final Cursor<IndexEntry<ID, ID>> indexCursor;
- public EntryCursorAdaptor( AbstractBTreePartition<ID> db, IndexCursor<ID, ID> indexCursor )
+ public EntryCursorAdaptor( AbstractBTreePartition<ID> db, Cursor<IndexEntry<ID, ID>> indexCursor )
{
LOG_CURSOR.debug( "Creating EntryCursorAdaptor {}", this );
this.db = db;
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractIndexCursor.java Fri Aug 24 15:07:31 2012
@@ -28,8 +28,7 @@ import org.apache.directory.shared.ldap.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
-public abstract class AbstractIndexCursor<V, ID> extends AbstractCursor<IndexEntry<V, ID>> implements
- IndexCursor<V, ID>
+public abstract class AbstractIndexCursor<V, ID> extends AbstractCursor<IndexEntry<V, ID>>
{
/** Tells if there are some element available in the cursor */
private boolean available = false;
@@ -76,24 +75,6 @@ public abstract class AbstractIndexCurso
/**
* {@inheritDoc}
*/
- public void afterValue( ID id, V value ) throws Exception
- {
- throw new UnsupportedOperationException( getUnsupportedMessage() );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void beforeValue( ID id, V value ) throws Exception
- {
- throw new UnsupportedOperationException( getUnsupportedMessage() );
- }
-
-
- /**
- * {@inheritDoc}
- */
protected boolean setAvailable( boolean available )
{
return this.available = available;
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java Fri Aug 24 15:07:31 2012
@@ -195,16 +195,16 @@ public interface Index<K, O, ID>
void drop( K attrVal, ID id ) throws Exception;
- IndexCursor<K, ID> reverseCursor() throws Exception;
+ Cursor<IndexEntry<K, ID>> reverseCursor() throws Exception;
- IndexCursor<K, ID> forwardCursor() throws Exception;
+ Cursor<IndexEntry<K, ID>> forwardCursor() throws Exception;
- IndexCursor<K, ID> reverseCursor( ID id ) throws Exception;
+ Cursor<IndexEntry<K, ID>> reverseCursor( ID id ) throws Exception;
- IndexCursor<K, ID> forwardCursor( K key ) throws Exception;
+ Cursor<IndexEntry<K, ID>> forwardCursor( K key ) throws Exception;
Cursor<K> reverseValueCursor( ID id ) throws Exception;
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Store.java Fri Aug 24 15:07:31 2012
@@ -29,6 +29,7 @@ import java.util.Set;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.Modification;
import org.apache.directory.shared.ldap.model.name.Dn;
@@ -343,7 +344,7 @@ public interface Store<E, ID extends Com
* @return an IndexEntry Cursor over the child entries
* @throws Exception on failures to access the underlying store
*/
- IndexCursor<ID, ID> list( ID id ) throws Exception;
+ Cursor<IndexEntry<ID, ID>> list( ID id ) throws Exception;
/**
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/impl/avl/AvlIndex.java Fri Aug 24 15:07:31 2012
@@ -27,7 +27,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndex;
import org.apache.directory.server.xdbm.EmptyIndexCursor;
-import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.EmptyCursor;
import org.apache.directory.shared.ldap.model.cursor.Tuple;
@@ -233,7 +233,7 @@ public class AvlIndex<K, O> extends Abst
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> forwardCursor() throws Exception
+ public Cursor<IndexEntry<K, Long>> forwardCursor() throws Exception
{
return new IndexCursorAdaptor( forward.cursor(), true );
}
@@ -243,7 +243,7 @@ public class AvlIndex<K, O> extends Abst
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> forwardCursor( K key ) throws Exception
+ public Cursor<IndexEntry<K, Long>> forwardCursor( K key ) throws Exception
{
return new IndexCursorAdaptor( forward.cursor( key ), true );
}
@@ -357,7 +357,7 @@ public class AvlIndex<K, O> extends Abst
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> reverseCursor() throws Exception
+ public Cursor<IndexEntry<K, Long>> reverseCursor() throws Exception
{
if ( withReverse )
{
@@ -374,7 +374,7 @@ public class AvlIndex<K, O> extends Abst
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
- public IndexCursor<K, Long> reverseCursor( Long id ) throws Exception
+ public Cursor<IndexEntry<K, Long>> reverseCursor( Long id ) throws Exception
{
if ( withReverse )
{
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/SearchEngine.java Fri Aug 24 15:07:31 2012
@@ -20,8 +20,9 @@
package org.apache.directory.server.xdbm.search;
-import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.shared.ldap.model.constants.JndiPropertyConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.filter.ExprNode;
import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
import org.apache.directory.shared.ldap.model.message.SearchScope;
@@ -81,7 +82,7 @@ public interface SearchEngine<E, ID>
* @return enumeration over SearchResults
* @throws Exception if the search fails
*/
- IndexCursor<ID, ID> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
+ Cursor<IndexEntry<ID, ID>> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
SearchScope scope ) throws Exception;
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AllEntriesCursor.java Fri Aug 24 15:07:31 2012
@@ -23,9 +23,9 @@ package org.apache.directory.server.xdbm
import org.apache.directory.server.core.partition.impl.btree.IndexCursorAdaptor;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,7 +45,7 @@ public class AllEntriesCursor<ID extends
private IndexEntry<ID, ID> indexEntry = new ForwardIndexEntry<ID, ID>();
/** The cursor on the EntryUUID index */
- private final IndexCursor<String, ID> wrapped;
+ private final Cursor<IndexEntry<String, ID>> wrapped;
/**
@@ -73,33 +73,9 @@ public class AllEntriesCursor<ID extends
/**
* {@inheritDoc}
*/
- public void afterValue( ID key, ID value ) throws Exception
- {
- checkNotClosed( "afterValue()" );
-
- wrapped.afterValue( key, null );
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void beforeValue( ID id, ID value ) throws Exception
- {
- checkNotClosed( "beforeValue()" );
-
- wrapped.beforeValue( id, null );
- }
-
-
- /**
- * {@inheritDoc}
- */
public void after( IndexEntry<ID, ID> indexEntry ) throws Exception
{
checkNotClosed( "after()" );
-
- wrapped.afterValue( indexEntry.getId(), null );
}
@@ -129,8 +105,6 @@ public class AllEntriesCursor<ID extends
public void before( IndexEntry<ID, ID> indexEntry ) throws Exception
{
checkNotClosed( "before()" );
-
- wrapped.beforeValue( indexEntry.getId(), null );
}
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/AndCursor.java Fri Aug 24 15:07:31 2012
@@ -26,10 +26,10 @@ import java.util.List;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.search.Evaluator;
import org.apache.directory.server.xdbm.search.impl.ScanCountComparator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.filter.ExprNode;
import org.slf4j.Logger;
@@ -50,7 +50,7 @@ public class AndCursor<V, ID> extends Ab
private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_707 );
/** */
- private final IndexCursor<V, ID> wrapped;
+ private final Cursor<IndexEntry<V, ID>> wrapped;
/** The evaluators used for the members of the And filter */
private final List<Evaluator<? extends ExprNode, ID>> evaluators;
@@ -63,7 +63,7 @@ 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, ID> wrapped,
+ public AndCursor( Cursor<IndexEntry<V, ID>> wrapped,
List<Evaluator<? extends ExprNode, ID>> evaluators )
{
LOG_CURSOR.debug( "Creating AndCursor {}", this );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ApproximateCursor.java Fri Aug 24 15:07:31 2012
@@ -23,10 +23,10 @@ package org.apache.directory.server.xdbm
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.evaluator.ApproximateEvaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.Value;
@@ -58,10 +58,10 @@ public class ApproximateCursor<V, ID ext
private final ApproximateEvaluator<V, ID> approximateEvaluator;
/** Cursor over attribute entry matching filter: set when index present */
- private final IndexCursor<V, ID> userIdxCursor;
+ private final Cursor<IndexEntry<V, ID>> userIdxCursor;
/** NDN Cursor on all entries in (set when no index on user attribute) */
- private final IndexCursor<String, ID> uuidIdxCursor;
+ private final Cursor<IndexEntry<String, ID>> uuidIdxCursor;
/**
@@ -119,42 +119,6 @@ public class ApproximateCursor<V, ID ext
/**
* {@inheritDoc}
*/
- public void beforeValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "beforeValue()" );
-
- if ( userIdxCursor != null )
- {
- userIdxCursor.beforeValue( id, value );
- }
- else
- {
- super.beforeValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void afterValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "afterValue()" );
-
- if ( userIdxCursor != null )
- {
- userIdxCursor.afterValue( id, value );
- }
- else
- {
- super.afterValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
public void before( IndexEntry<V, ID> element ) throws Exception
{
checkNotClosed( "before()" );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/ChildrenCursor.java Fri Aug 24 15:07:31 2012
@@ -23,10 +23,10 @@ package org.apache.directory.server.xdbm
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.ParentIdAndRdn;
import org.apache.directory.server.xdbm.Store;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -47,7 +47,7 @@ public class ChildrenCursor<ID extends C
private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_719 );
/** A Cursor over the entries in the scope of the search base */
- private final IndexCursor<ParentIdAndRdn<ID>, ID> cursor;
+ private final Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor;
/** The entry database/store */
private final Store<Entry, ID> db;
@@ -66,7 +66,7 @@ public class ChildrenCursor<ID extends C
* @param evaluator an IndexEntry (candidate) evaluator
* @throws Exception on db access failures
*/
- public ChildrenCursor( Store<Entry, ID> db, ID parentId, IndexCursor<ParentIdAndRdn<ID>, ID> cursor )
+ public ChildrenCursor( Store<Entry, ID> db, ID parentId, Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor )
throws Exception
{
LOG_CURSOR.debug( "Creating ChildrenCursor {}", this );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/DescendantCursor.java Fri Aug 24 15:07:31 2012
@@ -24,10 +24,10 @@ import org.apache.commons.collections.Ar
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.ParentIdAndRdn;
import org.apache.directory.server.xdbm.Store;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.name.Rdn;
import org.slf4j.Logger;
@@ -56,7 +56,7 @@ public class DescendantCursor<ID extends
private IndexEntry prefetched;
/** The current Cursor over the entries in the scope of the search base */
- private IndexCursor<ParentIdAndRdn<ID>, ID> currentCursor;
+ private Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> currentCursor;
/** The current Parent ID */
private ID currentParentId;
@@ -84,7 +84,8 @@ public class DescendantCursor<ID extends
* @param evaluator an IndexEntry (candidate) evaluator
* @throws Exception on db access failures
*/
- public DescendantCursor( Store<Entry, ID> db, ID baseId, ID parentId, IndexCursor<ParentIdAndRdn<ID>, ID> cursor )
+ public DescendantCursor( Store<Entry, ID> db, ID baseId, ID parentId,
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor )
throws Exception
{
this( db, baseId, parentId, cursor, TOP_LEVEL );
@@ -98,7 +99,8 @@ public class DescendantCursor<ID extends
* @param evaluator an IndexEntry (candidate) evaluator
* @throws Exception on db access failures
*/
- public DescendantCursor( Store<Entry, ID> db, ID baseId, ID parentId, IndexCursor<ParentIdAndRdn<ID>, ID> cursor,
+ public DescendantCursor( Store<Entry, ID> db, ID baseId, ID parentId,
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor,
boolean topLevel )
throws Exception
{
@@ -200,7 +202,7 @@ public class DescendantCursor<ID extends
if ( !finished )
{
currentCursor.close();
- currentCursor = ( IndexCursor<ParentIdAndRdn<ID>, ID> ) cursorStack.pop();
+ currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> ) cursorStack.pop();
currentParentId = ( ID ) parentIdStack.pop();
}
@@ -226,7 +228,7 @@ public class DescendantCursor<ID extends
ID newParentId = ( ID ) cursorEntry.getId();
// Yes, then create a new cursor and go down one level
- IndexCursor<ParentIdAndRdn<ID>, ID> cursor = db.getRdnIndex().forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor = db.getRdnIndex().forwardCursor();
IndexEntry<ParentIdAndRdn<ID>, ID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<ID>, ID>();
startingPos.setKey( new ParentIdAndRdn( newParentId, ( Rdn[] ) null ) );
@@ -250,7 +252,7 @@ public class DescendantCursor<ID extends
if ( !finished )
{
currentCursor.close();
- currentCursor = ( IndexCursor<ParentIdAndRdn<ID>, ID> ) cursorStack.pop();
+ currentCursor = ( Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> ) cursorStack.pop();
currentParentId = ( ID ) parentIdStack.pop();
}
// and continue...
@@ -277,7 +279,7 @@ public class DescendantCursor<ID extends
// Close the cursors stored in the stack, if we have some
for ( Object cursor : cursorStack )
{
- ( ( IndexCursor ) cursor ).close();
+ ( ( Cursor<IndexEntry<?, ?>> ) cursor ).close();
}
// And finally, close the current cursor
@@ -295,7 +297,7 @@ public class DescendantCursor<ID extends
// Close the cursors stored in the stack, if we have some
for ( Object cursor : cursorStack )
{
- ( ( IndexCursor ) cursor ).close( cause );
+ ( ( Cursor<IndexEntry<?, ?>> ) cursor ).close( cause );
}
// And finally, close the current cursor
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/EqualityCursor.java Fri Aug 24 15:07:31 2012
@@ -23,10 +23,10 @@ package org.apache.directory.server.xdbm
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.evaluator.EqualityEvaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.entry.Value;
@@ -56,10 +56,10 @@ public class EqualityCursor<V, ID extend
private final EqualityEvaluator<V, ID> equalityEvaluator;
/** Cursor over attribute entry matching filter: set when index present */
- private final IndexCursor<V, ID> userIdxCursor;
+ private final Cursor<IndexEntry<V, ID>> userIdxCursor;
/** NDN Cursor on all entries in (set when no index on user attribute) */
- private final IndexCursor<String, ID> uuidIdxCursor;
+ private final Cursor<IndexEntry<String, ID>> uuidIdxCursor;
/**
@@ -117,24 +117,6 @@ public class EqualityCursor<V, ID extend
/**
* {@inheritDoc}
*/
- public void beforeValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "beforeValue()" );
-
- if ( userIdxCursor != null )
- {
- userIdxCursor.beforeValue( id, value );
- }
- else
- {
- super.beforeValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
public void before( IndexEntry<V, ID> element ) throws Exception
{
checkNotClosed( "before()" );
@@ -153,25 +135,6 @@ public class EqualityCursor<V, ID extend
/**
* {@inheritDoc}
*/
- public void afterValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "afterValue()" );
-
- if ( userIdxCursor
- != null )
- {
- userIdxCursor.afterValue( id, value );
- }
- else
- {
- super.afterValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
public void after( IndexEntry<V, ID> element ) throws Exception
{
checkNotClosed( "after()" );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/GreaterEqCursor.java Fri Aug 24 15:07:31 2012
@@ -24,10 +24,10 @@ import org.apache.directory.server.i18n.
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.evaluator.GreaterEqEvaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -55,10 +55,10 @@ public class GreaterEqCursor<V, ID exten
private final GreaterEqEvaluator<V, ID> greaterEqEvaluator;
/** Cursor over attribute entry matching filter: set when index present */
- private final IndexCursor<V, ID> userIdxCursor;
+ private final Cursor<IndexEntry<V, ID>> userIdxCursor;
/** NDN Cursor on all entries in (set when no index on user attribute) */
- private final IndexCursor<String, ID> uuidIdxCursor;
+ private final Cursor<IndexEntry<String, ID>> uuidIdxCursor;
/**
* Used to store indexEntry from uuidCandidate so it can be saved after
@@ -107,85 +107,6 @@ public class GreaterEqCursor<V, ID exten
/**
* {@inheritDoc}
*/
- public void beforeValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "beforeValue()" );
-
- if ( userIdxCursor != null )
- {
- /*
- * First we need to check and make sure this element is within
- * bounds as mandated by the assertion node. To do so we compare
- * it's value with the value of the node. If it is smaller or
- * equal to this lower bound then we simply position the
- * userIdxCursor before the first element. Otherwise we let the
- * underlying userIdx Cursor position the element.
- */
- if ( greaterEqEvaluator.getComparator()
- .compare( value, greaterEqEvaluator.getExpression().getValue().getValue() ) <= 0 )
- {
- beforeFirst();
- return;
- }
-
- userIdxCursor.beforeValue( id, value );
- setAvailable( false );
- }
- else
- {
- super.beforeValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void afterValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "afterValue()" );
-
- if ( userIdxCursor != null )
- {
- int comparedValue = greaterEqEvaluator.getComparator().compare( value,
- greaterEqEvaluator.getExpression().getValue().getValue() );
-
- /*
- * First we need to check and make sure this element is within
- * bounds as mandated by the assertion node. To do so we compare
- * it's value with the value of the node. If it is equal to this
- * lower bound then we simply position the userIdxCursor after
- * this first node. If it is less than this value then we
- * position the Cursor before the first entry.
- */
- if ( comparedValue == 0 )
- {
- userIdxCursor.afterValue( id, value );
- setAvailable( false );
-
- return;
- }
- else if ( comparedValue < 0 )
- {
- beforeFirst();
-
- return;
- }
-
- // Element is in the valid range as specified by assertion
- userIdxCursor.afterValue( id, value );
- setAvailable( false );
- }
- else
- {
- super.afterValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
public void before( IndexEntry<V, ID> element ) throws Exception
{
checkNotClosed( "before()" );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/LessEqCursor.java Fri Aug 24 15:07:31 2012
@@ -24,10 +24,10 @@ import org.apache.directory.server.i18n.
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.evaluator.LessEqEvaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -55,10 +55,10 @@ public class LessEqCursor<V, ID extends
private final LessEqEvaluator<V, ID> lessEqEvaluator;
/** Cursor over attribute entry matching filter: set when index present */
- private final IndexCursor<V, ID> userIdxCursor;
+ private final Cursor<IndexEntry<V, ID>> userIdxCursor;
/** NDN Cursor on all entries in (set when no index on user attribute) */
- private final IndexCursor<V, ID> uuidIdxCursor;
+ private final Cursor<IndexEntry<V, ID>> uuidIdxCursor;
/**
* Used to store indexEntry from uudCandidate so it can be saved after
@@ -83,7 +83,7 @@ public class LessEqCursor<V, ID extends
}
else
{
- uuidIdxCursor = ( IndexCursor<V, ID> ) db.getEntryUuidIndex().forwardCursor();
+ uuidIdxCursor = ( Cursor ) db.getEntryUuidIndex().forwardCursor();
userIdxCursor = null;
}
}
@@ -101,57 +101,6 @@ public class LessEqCursor<V, ID extends
/**
* {@inheritDoc}
*/
- public void beforeValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "beforeValue()" );
-
- if ( userIdxCursor != null )
- {
- /*
- * First we need to check and make sure this element is within
- * bounds as mandated by the assertion node. To do so we compare
- * it's value with the value of the expression node. If the
- * element's value is greater than this upper bound then we
- * position the userIdxCursor after the last node.
- *
- * If the element's value is equal to this upper bound then we
- * position the userIdxCursor right before the last node.
- *
- * If the element's value is smaller, then we delegate to the
- * before() method of the userIdxCursor.
- */
- //noinspection unchecked
- int compareValue = lessEqEvaluator.getComparator().compare( value,
- lessEqEvaluator.getExpression().getValue().getValue() );
-
- if ( compareValue > 0 )
- {
- afterLast();
-
- return;
- }
- else if ( compareValue == 0 )
- {
- last();
- previous();
- setAvailable( false );
-
- return;
- }
-
- userIdxCursor.beforeValue( id, value );
- setAvailable( false );
- }
- else
- {
- super.beforeValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
public void before( IndexEntry<V, ID> element ) throws Exception
{
checkNotClosed( "before()" );
@@ -200,47 +149,6 @@ public class LessEqCursor<V, ID extends
/**
* {@inheritDoc}
*/
- public void afterValue( ID id, V value ) throws Exception
- {
- checkNotClosed( "afterValue()" );
-
- if ( userIdxCursor != null )
- {
- int comparedValue = lessEqEvaluator.getComparator().compare( value,
- lessEqEvaluator.getExpression().getValue().getValue() );
-
- /*
- * First we need to check and make sure this element is within
- * bounds as mandated by the assertion node. To do so we compare
- * it's value with the value of the expression node.
- *
- * If the element's value is equal to or greater than this upper
- * bound then we position the userIdxCursor after the last node.
- *
- * If the element's value is smaller, then we delegate to the
- * after() method of the userIdxCursor.
- */
- if ( comparedValue >= 0 )
- {
- afterLast();
-
- return;
- }
-
- // Element is in the valid range as specified by assertion
- userIdxCursor.afterValue( id, value );
- setAvailable( false );
- }
- else
- {
- super.afterValue( id, value );
- }
- }
-
-
- /**
- * {@inheritDoc}
- */
public void after( IndexEntry<V, ID> element ) throws Exception
{
checkNotClosed( "after()" );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/NotCursor.java Fri Aug 24 15:07:31 2012
@@ -22,10 +22,10 @@ package org.apache.directory.server.xdbm
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.Evaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -44,7 +44,7 @@ public class NotCursor<V, ID extends Com
private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_718 );
- private final IndexCursor<V, ID> uuidCursor;
+ private final Cursor<IndexEntry<V, ID>> uuidCursor;
private final Evaluator<? extends ExprNode, ID> childEvaluator;
@@ -54,7 +54,7 @@ public class NotCursor<V, ID extends Com
{
LOG_CURSOR.debug( "Creating NotCursor {}", this );
this.childEvaluator = childEvaluator;
- this.uuidCursor = ( IndexCursor<V, ID> ) store.getEntryUuidIndex().forwardCursor();
+ this.uuidCursor = ( Cursor ) store.getEntryUuidIndex().forwardCursor();
}
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OneLevelScopeCursor.java Fri Aug 24 15:07:31 2012
@@ -23,7 +23,6 @@ package org.apache.directory.server.xdbm
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.ParentIdAndRdn;
import org.apache.directory.server.xdbm.Store;
@@ -58,7 +57,7 @@ public class OneLevelScopeCursor<ID exte
private final OneLevelScopeEvaluator evaluator;
/** A Cursor over the entries in the scope of the search base */
- private final IndexCursor scopeCursor;
+ private final Cursor<IndexEntry<ID, ID>> scopeCursor;
/** A Cursor over entries brought into scope by alias dereferencing */
private final Cursor<IndexEntry<ID, ID>> dereferencedCursor;
@@ -84,7 +83,7 @@ public class OneLevelScopeCursor<ID exte
// We use the RdnIndex to get all the entries from a starting point
// and below up to the number of children
- IndexCursor<ParentIdAndRdn<ID>, ID> cursor = db.getRdnIndex().forwardCursor();
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor = db.getRdnIndex().forwardCursor();
IndexEntry<ParentIdAndRdn<ID>, ID> startingPos = new ForwardIndexEntry<ParentIdAndRdn<ID>, ID>();
startingPos.setKey( new ParentIdAndRdn( evaluator.getBaseId(), ( Rdn[] ) null ) );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/OrCursor.java Fri Aug 24 15:07:31 2012
@@ -27,7 +27,6 @@ import java.util.Set;
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.search.Evaluator;
import org.apache.directory.shared.ldap.model.cursor.Cursor;
@@ -48,14 +47,14 @@ public class OrCursor<V, ID> extends Abs
private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_722 );
- private final List<IndexCursor<V, ID>> cursors;
+ private final List<Cursor<IndexEntry<V, ID>>> cursors;
private final List<Evaluator<? extends ExprNode, ID>> evaluators;
private final List<Set<ID>> blacklists;
private int cursorIndex = -1;
// TODO - do same evaluator fail fast optimization that we do in AndCursor
- public OrCursor( List<IndexCursor<V, ID>> cursors,
+ public OrCursor( List<Cursor<IndexEntry<V, ID>>> cursors,
List<Evaluator<? extends ExprNode, ID>> evaluators )
{
LOG_CURSOR.debug( "Creating OrCursor {}", this );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/PresenceCursor.java Fri Aug 24 15:07:31 2012
@@ -22,10 +22,10 @@ package org.apache.directory.server.xdbm
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.evaluator.PresenceEvaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -44,8 +44,8 @@ public class PresenceCursor<ID extends C
private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_724 );
- private final IndexCursor<String, ID> uuidCursor;
- private final IndexCursor<String, ID> presenceCursor;
+ private final Cursor<IndexEntry<String, ID>> uuidCursor;
+ private final Cursor<IndexEntry<String, ID>> presenceCursor;
private final PresenceEvaluator<ID> presenceEvaluator;
/** The prefetched entry, if it's a valid one */
@@ -97,24 +97,6 @@ public class PresenceCursor<ID extends C
/**
* {@inheritDoc}
*/
- public void beforeValue( ID id, String value ) throws Exception
- {
- checkNotClosed( "beforeValue()" );
-
- if ( presenceCursor != null )
- {
- presenceCursor.beforeValue( id, value );
-
- return;
- }
-
- super.beforeValue( id, value );
- }
-
-
- /**
- * {@inheritDoc}
- */
public void before( IndexEntry<String, ID> element ) throws Exception
{
checkNotClosed( "before()" );
@@ -133,24 +115,6 @@ public class PresenceCursor<ID extends C
/**
* {@inheritDoc}
*/
- public void afterValue( ID id, String value ) throws Exception
- {
- checkNotClosed( "afterValue()" );
-
- if ( presenceCursor != null )
- {
- presenceCursor.afterValue( id, value );
-
- return;
- }
-
- super.afterValue( id, value );
- }
-
-
- /**
- * {@inheritDoc}
- */
public void after( IndexEntry<String, ID> element ) throws Exception
{
checkNotClosed( "after()" );
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubstringCursor.java Fri Aug 24 15:07:31 2012
@@ -24,10 +24,10 @@ import org.apache.directory.server.i18n.
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
import org.apache.directory.server.xdbm.Index;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.evaluator.SubstringEvaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.slf4j.Logger;
@@ -46,7 +46,7 @@ public class SubstringCursor<ID extends
private static final String UNSUPPORTED_MSG = I18n.err( I18n.ERR_725 );
private final boolean hasIndex;
- private final IndexCursor<String, ID> wrapped;
+ private final Cursor<IndexEntry<String, ID>> wrapped;
private final SubstringEvaluator<ID> evaluator;
private final ForwardIndexEntry<String, ID> indexEntry = new ForwardIndexEntry<String, ID>();
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/cursor/SubtreeScopeCursor.java Fri Aug 24 15:07:31 2012
@@ -24,12 +24,12 @@ import org.apache.directory.server.core.
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.AbstractIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.ParentIdAndRdn;
import org.apache.directory.server.xdbm.SingletonIndexCursor;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.evaluator.SubtreeScopeEvaluator;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.slf4j.Logger;
@@ -56,13 +56,13 @@ public class SubtreeScopeCursor<ID exten
private final SubtreeScopeEvaluator<Entry, ID> evaluator;
/** A Cursor over the entries in the scope of the search base */
- private final IndexCursor<ID, ID> scopeCursor;
+ private final Cursor<IndexEntry<ID, ID>> scopeCursor;
/** A Cursor over entries brought into scope by alias dereferencing */
- private final IndexCursor<ID, ID> dereferencedCursor;
+ private final Cursor<IndexEntry<ID, ID>> dereferencedCursor;
/** Currently active Cursor: we switch between two cursors */
- private IndexCursor<ID, ID> cursor;
+ private Cursor<IndexEntry<ID, ID>> cursor;
private ID contextEntryId;
@@ -96,7 +96,7 @@ public class SubtreeScopeCursor<ID exten
indexEntry.setId( baseId );
indexEntry.setKey( parentIdAndRdn );
- IndexCursor<ParentIdAndRdn<ID>, ID> cursor = new SingletonIndexCursor<ParentIdAndRdn<ID>, ID>(
+ Cursor<IndexEntry<ParentIdAndRdn<ID>, ID>> cursor = new SingletonIndexCursor<ParentIdAndRdn<ID>, ID>(
indexEntry );
ID parentId = parentIdAndRdn.getParentId();
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java Fri Aug 24 15:07:31 2012
@@ -24,7 +24,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.directory.server.i18n.I18n;
-import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.Evaluator;
import org.apache.directory.server.xdbm.search.cursor.AndCursor;
@@ -38,6 +38,7 @@ import org.apache.directory.server.xdbm.
import org.apache.directory.server.xdbm.search.cursor.PresenceCursor;
import org.apache.directory.server.xdbm.search.cursor.SubstringCursor;
import org.apache.directory.server.xdbm.search.cursor.SubtreeScopeCursor;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.filter.AndNode;
import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -75,55 +76,55 @@ public class CursorBuilder<ID extends Co
}
- public <T> IndexCursor<?, ID> build( ExprNode node ) throws Exception
+ public <T> Cursor<IndexEntry<?, ID>> build( ExprNode node ) throws Exception
{
switch ( node.getAssertionType() )
{
/* ---------- LEAF NODE HANDLING ---------- */
case APPROXIMATE:
- return new ApproximateCursor<T, ID>( db,
+ return ( Cursor ) new ApproximateCursor<T, ID>( db,
( org.apache.directory.server.xdbm.search.evaluator.ApproximateEvaluator<T, ID> ) evaluatorBuilder
.build( node ) );
case EQUALITY:
- return new EqualityCursor<T, ID>( db,
+ return ( Cursor ) new EqualityCursor<T, ID>( db,
( org.apache.directory.server.xdbm.search.evaluator.EqualityEvaluator<T, ID> ) evaluatorBuilder
.build( node ) );
case GREATEREQ:
- return new GreaterEqCursor<T, ID>( db,
+ return ( Cursor ) new GreaterEqCursor<T, ID>( db,
( org.apache.directory.server.xdbm.search.evaluator.GreaterEqEvaluator<T, ID> ) evaluatorBuilder
.build( node ) );
case LESSEQ:
- return new LessEqCursor<T, ID>( db,
+ return ( Cursor ) new LessEqCursor<T, ID>( db,
( org.apache.directory.server.xdbm.search.evaluator.LessEqEvaluator<T, ID> ) evaluatorBuilder
.build( node ) );
case PRESENCE:
- return new PresenceCursor<ID>( db,
+ return ( Cursor ) new PresenceCursor<ID>( db,
( org.apache.directory.server.xdbm.search.evaluator.PresenceEvaluator<ID> ) evaluatorBuilder
.build( node ) );
case SCOPE:
if ( ( ( ScopeNode ) node ).getScope() == SearchScope.ONELEVEL )
{
- return new OneLevelScopeCursor<ID>(
+ return ( Cursor ) new OneLevelScopeCursor<ID>(
db,
( org.apache.directory.server.xdbm.search.evaluator.OneLevelScopeEvaluator<Entry, ID> ) evaluatorBuilder
.build( node ) );
}
else
{
- return new SubtreeScopeCursor<ID>(
+ return ( Cursor ) new SubtreeScopeCursor<ID>(
db,
( org.apache.directory.server.xdbm.search.evaluator.SubtreeScopeEvaluator<Entry, ID> ) evaluatorBuilder
.build( node ) );
}
case SUBSTRING:
- return new SubstringCursor<ID>( db,
+ return ( Cursor ) new SubstringCursor<ID>( db,
( org.apache.directory.server.xdbm.search.evaluator.SubstringEvaluator<ID> ) evaluatorBuilder
.build( node ) );
@@ -133,7 +134,8 @@ public class CursorBuilder<ID extends Co
return buildAndCursor( ( AndNode ) node );
case NOT:
- return new NotCursor<ID, ID>( db, evaluatorBuilder.build( ( ( NotNode ) node ).getFirstChild() ) );
+ return ( Cursor ) new NotCursor<ID, ID>( db, evaluatorBuilder.build( ( ( NotNode ) node )
+ .getFirstChild() ) );
case OR:
return buildOrCursor( ( OrNode ) node );
@@ -157,10 +159,10 @@ public class CursorBuilder<ID extends Co
* @return Cursor over candidates satisfying disjunction expression
* @throws Exception on db access failures
*/
- private IndexCursor<?, ID> buildOrCursor( OrNode node ) throws Exception
+ private Cursor<IndexEntry<?, ID>> buildOrCursor( OrNode node ) throws Exception
{
List<ExprNode> children = node.getChildren();
- List<IndexCursor<?, ID>> childCursors = new ArrayList<IndexCursor<?, ID>>(
+ List<Cursor<IndexEntry<?, ID>>> childCursors = new ArrayList<Cursor<IndexEntry<?, ID>>>(
children.size() );
List<Evaluator<? extends ExprNode, ID>> childEvaluators = new ArrayList<Evaluator<? extends ExprNode, ID>>(
children.size() );
@@ -183,7 +185,7 @@ public class CursorBuilder<ID extends Co
* @return Cursor over the conjunction expression
* @throws Exception on db access failures
*/
- private IndexCursor<?, ID> buildAndCursor( AndNode node ) throws Exception
+ private Cursor<IndexEntry<?, ID>> buildAndCursor( AndNode node ) throws Exception
{
int minIndex = 0;
long minValue = Long.MAX_VALUE;
@@ -231,7 +233,7 @@ public class CursorBuilder<ID extends Co
}
// Do recursive call to build min child Cursor then create AndCursor
- IndexCursor<?, ID> childCursor = build( minChild );
+ Cursor<IndexEntry<?, ID>> childCursor = build( minChild );
return new AndCursor( childCursor, childEvaluators );
}
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/DefaultSearchEngine.java Fri Aug 24 15:07:31 2012
@@ -24,13 +24,13 @@ import org.apache.directory.server.core.
import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.EmptyIndexCursor;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.SingletonIndexCursor;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.search.Evaluator;
import org.apache.directory.server.xdbm.search.Optimizer;
import org.apache.directory.server.xdbm.search.SearchEngine;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.exception.LdapNoSuchObjectException;
import org.apache.directory.shared.ldap.model.filter.AndNode;
@@ -97,7 +97,7 @@ public class DefaultSearchEngine<ID exte
/**
* {@inheritDoc}
*/
- public IndexCursor<ID, ID> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
+ public Cursor<IndexEntry<ID, ID>> cursor( Dn base, AliasDerefMode aliasDerefMode, ExprNode filter,
SearchScope scope ) throws Exception
{
Dn effectiveBase;
@@ -193,7 +193,7 @@ public class DefaultSearchEngine<ID exte
// Annotate the node with the optimizer and return search enumeration.
optimizer.annotate( root );
- return ( IndexCursor<ID, ID> ) cursorBuilder.build( root );
+ return ( Cursor ) cursorBuilder.build( root );
}
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/SingletonIndexCursorTest.java Fri Aug 24 15:07:31 2012
@@ -53,8 +53,8 @@ public class SingletonIndexCursorTest
indexEntry.setKey( "test" );
indexCursor = new SingletonIndexCursor<String, Long>( indexEntry );
}
-
-
+
+
@After
public void cleanup() throws Exception
{
@@ -66,7 +66,7 @@ public class SingletonIndexCursorTest
public void testConstructor() throws Exception
{
Cursor cursor = new SingletonIndexCursor<String, Long>( indexEntry );
-
+
cursor.close();
}
@@ -241,23 +241,8 @@ public class SingletonIndexCursorTest
@Test(expected = UnsupportedOperationException.class)
- public void testBeforeValue() throws Exception
- {
- indexCursor.beforeValue( 1L, "test" );
- }
-
-
- @Test(expected = UnsupportedOperationException.class)
public void testAfter() throws Exception
{
indexCursor.after( null );
}
-
-
- @Test(expected = UnsupportedOperationException.class)
- public void testAfterValue() throws Exception
- {
- indexCursor.afterValue( 1L, "test" );
- }
-
}
Modified: directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java?rev=1376953&r1=1376952&r2=1376953&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java (original)
+++ directory/apacheds/branches/apacheds-mvbt/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/search/impl/AndCursorTest.java Fri Aug 24 15:07:31 2012
@@ -33,7 +33,7 @@ import org.apache.commons.io.FileUtils;
import org.apache.directory.server.core.api.partition.Partition;
import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
import org.apache.directory.server.xdbm.ForwardIndexEntry;
-import org.apache.directory.server.xdbm.IndexCursor;
+import org.apache.directory.server.xdbm.IndexEntry;
import org.apache.directory.server.xdbm.Store;
import org.apache.directory.server.xdbm.StoreUtils;
import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
@@ -43,6 +43,7 @@ import org.apache.directory.server.xdbm.
import org.apache.directory.server.xdbm.search.evaluator.PresenceEvaluator;
import org.apache.directory.server.xdbm.search.evaluator.SubstringEvaluator;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.model.cursor.Cursor;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.filter.AndNode;
@@ -179,7 +180,7 @@ public class AndCursorTest
ExprNode exprNode = FilterParser.parse( schemaManager, filter );
- IndexCursor<?, Long> cursor = cursorBuilder.build( exprNode );
+ Cursor<IndexEntry<?, Long>> cursor = cursorBuilder.build( exprNode );
cursor.beforeFirst();
@@ -216,7 +217,7 @@ public class AndCursorTest
ExprNode exprNode = new SubstringNode( schemaManager.getAttributeType( "cn" ), "J", null );
eval = new SubstringEvaluator( ( SubstringNode ) exprNode, store, schemaManager );
- IndexCursor<?, Long> wrapped = new SubstringCursor( store, ( SubstringEvaluator ) eval );
+ Cursor<IndexEntry<?, Long>> wrapped = new SubstringCursor( store, ( SubstringEvaluator ) eval );
/* adding this results in NPE adding Presence evaluator not
Substring evaluator but adding Substring cursor as wrapped cursor */
@@ -230,7 +231,7 @@ public class AndCursorTest
andNode.addNode( exprNode );
- IndexCursor<?, Long> cursor = new AndCursor( wrapped, evaluators ); //cursorBuilder.build( andNode );
+ Cursor<IndexEntry<?, Long>> cursor = new AndCursor( wrapped, evaluators ); //cursorBuilder.build( andNode );
cursor.beforeFirst();