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/03/03 01:20:12 UTC
svn commit: r1296527 [4/4] - in /directory/apacheds/branches/apacheds-txns:
./ apache-felix/
core-annotations/src/main/java/org/apache/directory/server/core/factory/
core-integ/src/test/java/org/apache/directory/server/core/configuration/
core-integ/sr...
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=1296527&r1=1296526&r2=1296527&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 Sat Mar 3 00:20:10 2012
@@ -25,10 +25,10 @@ import java.util.UUID;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.core.api.partition.Partition;
-import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.core.api.partition.index.Index;
import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.search.Optimizer;
import org.apache.directory.shared.ldap.model.filter.AndNode;
import org.apache.directory.shared.ldap.model.filter.ApproximateNode;
@@ -58,7 +58,7 @@ public class DefaultOptimizer implements
/** the database this optimizer operates on */
private final Partition db;
private UUID contextEntryId;
-
+
private TxnManagerFactory txnManagerFactory;
private OperationExecutionManagerFactory executionManagerFactory;
@@ -68,8 +68,9 @@ public class DefaultOptimizer implements
*
* @param db the database this optimizer works for.
*/
- public DefaultOptimizer( Partition db,
- TxnManagerFactory txnManagerFactory, OperationExecutionManagerFactory executionManagerFactory ) throws Exception
+ public DefaultOptimizer( Partition db,
+ TxnManagerFactory txnManagerFactory, OperationExecutionManagerFactory executionManagerFactory )
+ throws Exception
{
this.txnManagerFactory = txnManagerFactory;
this.executionManagerFactory = executionManagerFactory;
@@ -171,7 +172,7 @@ public class DefaultOptimizer implements
/** Cannot really say so we presume the total index count */
count = getFullScan( leaf );
}
- else if ( node instanceof ApproximateNode)
+ else if ( node instanceof ApproximateNode )
{
/** Feature not implemented so we just use equality matching */
count = getEqualityScan( ( ApproximateNode ) leaf );
@@ -192,9 +193,9 @@ public class DefaultOptimizer implements
}
else if ( node instanceof OrNode )
{
- count = getDisjunctionScan( (OrNode) node );
+ count = getDisjunctionScan( ( OrNode ) node );
}
- else if ( node instanceof NotNode)
+ else if ( node instanceof NotNode )
{
annotate( ( ( NotNode ) node ).getFirstChild() );
@@ -359,7 +360,7 @@ public class DefaultOptimizer implements
if ( db.hasUserIndexOn( node.getAttributeType() ) )
{
Index<String> idx;
- idx = ( Index<String> )db.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID );
+ idx = ( Index<String> ) db.getSystemIndex( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID );
return idx.count( node.getAttributeType().getOid() );
}
else if ( db.hasSystemIndexOn( node.getAttributeType() ) )
@@ -392,7 +393,7 @@ public class DefaultOptimizer implements
case ONELEVEL:
idx = db.getSystemIndex( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID );
- return ( ( Index<UUID> )idx ).count( id );
+ return ( ( Index<UUID> ) idx ).count( id );
case SUBTREE:
if ( id.compareTo( getContextEntryId() ) == 0 )
@@ -402,7 +403,7 @@ public class DefaultOptimizer implements
else
{
idx = db.getSystemIndex( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID );
- return ( ( Index<UUID> )idx ).count( id );
+ return ( ( Index<UUID> ) idx ).count( id );
}
default:
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=1296527&r1=1296526&r2=1296527&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 Sat Mar 3 00:20:10 2012
@@ -27,7 +27,6 @@ import javax.naming.directory.SearchCont
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.core.api.partition.OperationExecutionManager;
import org.apache.directory.server.core.api.partition.Partition;
-import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.core.api.partition.index.EmptyIndexCursor;
import org.apache.directory.server.core.api.partition.index.ForwardIndexEntry;
import org.apache.directory.server.core.api.partition.index.Index;
@@ -35,6 +34,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.api.partition.index.IndexEntry;
import org.apache.directory.server.core.api.partition.index.SingletonIndexCursor;
import org.apache.directory.server.core.api.txn.TxnLogManager;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.search.Evaluator;
import org.apache.directory.server.xdbm.search.Optimizer;
import org.apache.directory.server.xdbm.search.SearchEngine;
@@ -58,23 +58,21 @@ public class DefaultSearchEngine impleme
{
/** the Optimizer used by this DefaultSearchEngine */
private final Optimizer optimizer;
-
+
/** the Database this DefaultSearchEngine operates on */
private final Partition db;
-
+
/** creates Cursors over entries satisfying filter expressions */
private final CursorBuilder cursorBuilder;
-
+
/** creates evaluators which check to see if candidates satisfy a filter expression */
private final EvaluatorBuilder evaluatorBuilder;
-
+
/** Txn log manager */
private final TxnLogManager txnLogManager;
-
+
/** Operation execution manager */
private final OperationExecutionManager executionManager;
-
-
// ------------------------------------------------------------------------
@@ -96,7 +94,7 @@ public class DefaultSearchEngine impleme
this.optimizer = optimizer;
this.cursorBuilder = cursorBuilder;
this.evaluatorBuilder = evaluatorBuilder;
- txnLogManager = evaluatorBuilder.getTxnManagerFactory().txnLogManagerInstance();
+ txnLogManager = evaluatorBuilder.getTxnManagerFactory().txnLogManagerInstance();
executionManager = evaluatorBuilder.getExecutionManagerFactory().instance();
}
@@ -140,12 +138,12 @@ public class DefaultSearchEngine impleme
Index<?> aliasIdx;
aliasIdx = db.getSystemIndex( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
aliasIdx = txnLogManager.wrap( db.getSuffixDn(), aliasIdx );
- String aliasedBase = ( (Index<String>) aliasIdx ).reverseLookup( baseId );
+ String aliasedBase = ( ( Index<String> ) aliasIdx ).reverseLookup( baseId );
// --------------------------------------------------------------------
// Determine the effective base with aliases
// --------------------------------------------------------------------
-
+
/*
* If the base is not an alias or if alias dereferencing does not
* occur on finding the base then we set the effective base to the
@@ -154,9 +152,9 @@ public class DefaultSearchEngine impleme
if ( ( null == aliasedBase ) || !aliasDerefMode.isDerefFindingBase() )
{
effectiveBase = base;
-
+
// We depend on the provided base with the given scope
- txnLogManager.addRead( base, SearchScope.values()[ searchCtls.getSearchScope() ] );
+ txnLogManager.addRead( base, SearchScope.values()[searchCtls.getSearchScope()] );
}
/*
@@ -167,13 +165,13 @@ public class DefaultSearchEngine impleme
else
{
effectiveBase = new Dn( aliasedBase );
-
+
// Add dependency on the effective base with the given scope
- txnLogManager.addRead( effectiveBase, SearchScope.values()[ searchCtls.getSearchScope() ] );
-
+ txnLogManager.addRead( effectiveBase, SearchScope.values()[searchCtls.getSearchScope()] );
+
// We also depend on the base as we are routed through it.
txnLogManager.addRead( base, SearchScope.OBJECT );
-
+
}
// --------------------------------------------------------------------
@@ -205,8 +203,8 @@ public class DefaultSearchEngine impleme
// Add the scope node using the effective base to the filter
BranchNode root = new AndNode();
- ExprNode node = new ScopeNode( aliasDerefMode, effectiveBase, SearchScope.getSearchScope(searchCtls
- .getSearchScope()) );
+ ExprNode node = new ScopeNode( aliasDerefMode, effectiveBase, SearchScope.getSearchScope( searchCtls
+ .getSearchScope() ) );
root.getChildren().add( node );
root.getChildren().add( filter );
Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java?rev=1296527&r1=1296526&r2=1296527&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeCursor.java Sat Mar 3 00:20:10 2012
@@ -24,7 +24,6 @@ import java.util.UUID;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.core.api.partition.Partition;
-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;
import org.apache.directory.server.core.api.partition.index.IndexCursor;
@@ -32,6 +31,7 @@ import org.apache.directory.server.core.
import org.apache.directory.server.core.api.txn.TxnLogManager;
import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
import org.apache.directory.shared.ldap.model.message.SearchScope;
import org.apache.directory.shared.ldap.model.name.Dn;
@@ -63,14 +63,14 @@ public class SubtreeScopeCursor extends
private IndexCursor<UUID> cursor;
private UUID contextEntryId;
-
+
/** Alias idx if dereferencing aliases */
private Index<String> aliasIdx;
-
+
/** Txn and Operation Execution Factories */
private TxnManagerFactory txnManagerFactory;
private OperationExecutionManagerFactory executionManagerFactory;
-
+
/**
* Creates a Cursor over entries satisfying subtree level scope criteria.
@@ -86,7 +86,7 @@ public class SubtreeScopeCursor extends
{
this.txnManagerFactory = txnManagerFactory;
this.executionManagerFactory = executionManagerFactory;
-
+
TxnLogManager txnLogManager = txnManagerFactory.txnLogManagerInstance();
this.db = db;
this.evaluator = evaluator;
@@ -103,13 +103,13 @@ public class SubtreeScopeCursor extends
}
if ( evaluator.isDereferencing() )
- {
+ {
Index<?> subAliasIdx = db.getSystemIndex( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID );
subAliasIdx = txnLogManager.wrap( db.getSuffixDn(), subAliasIdx );
- dereferencedCursor = ( ( Index<UUID> )subAliasIdx ).forwardCursor( evaluator.getBaseId() );
-
- aliasIdx = ( Index<String> )db.getSystemIndex( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
- aliasIdx = ( Index<String> )txnLogManager.wrap( db.getSuffixDn(), aliasIdx );
+ dereferencedCursor = ( ( Index<UUID> ) subAliasIdx ).forwardCursor( evaluator.getBaseId() );
+
+ aliasIdx = ( Index<String> ) db.getSystemIndex( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
+ aliasIdx = ( Index<String> ) txnLogManager.wrap( db.getSuffixDn(), aliasIdx );
}
else
{
@@ -126,7 +126,7 @@ public class SubtreeScopeCursor extends
return UNSUPPORTED_MSG;
}
-
+
// This will suppress PMD.EmptyCatchBlock warnings in this method
private UUID getContextEntryId() throws Exception
{
@@ -215,7 +215,7 @@ public class SubtreeScopeCursor extends
{
checkNotClosed( "previous()" );
setAvailable( cursor.previous() );
-
+
if ( available() && aliasIdx.reverseLookup( cursor.get().getId() ) == null )
{
break;
@@ -238,7 +238,7 @@ public class SubtreeScopeCursor extends
* last element.
*/
setAvailable( cursor.previous() );
-
+
if ( !available() )
{
cursor = scopeCursor;
@@ -315,7 +315,7 @@ public class SubtreeScopeCursor extends
{
cursor = dereferencedCursor;
cursor.beforeFirst();
-
+
return setAvailable( cursor.next() );
}
@@ -329,22 +329,22 @@ public class SubtreeScopeCursor extends
public IndexEntry<UUID> get() throws Exception
{
checkNotClosed( "get()" );
-
+
if ( available() )
{
- IndexEntry<UUID> indexEntry = cursor.get();
-
+ IndexEntry<UUID> indexEntry = cursor.get();
+
/*
* If the entry is coming from the alias index, then search scope is enlarged
* to include the returned entry.
*/
-
+
if ( cursor == dereferencedCursor )
{
Dn aliasTargetDn = executionManagerFactory.instance().buildEntryDn( db, indexEntry.getId() );
txnManagerFactory.txnLogManagerInstance().addRead( aliasTargetDn, SearchScope.OBJECT );
}
-
+
return indexEntry;
}
@@ -354,18 +354,18 @@ public class SubtreeScopeCursor extends
private void closeCursors() throws Exception
{
- if( dereferencedCursor != null )
+ if ( dereferencedCursor != null )
{
dereferencedCursor.close();
}
-
- if( scopeCursor != null )
+
+ if ( scopeCursor != null )
{
scopeCursor.close();
}
}
-
-
+
+
@Override
public void close() throws Exception
{
Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeEvaluator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeEvaluator.java?rev=1296527&r1=1296526&r2=1296527&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeEvaluator.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/SubtreeScopeEvaluator.java Sat Mar 3 00:20:10 2012
@@ -24,11 +24,11 @@ import java.util.UUID;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.core.api.partition.Partition;
-import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.core.api.partition.index.Index;
import org.apache.directory.server.core.api.partition.index.IndexEntry;
import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
+import org.apache.directory.server.i18n.I18n;
import org.apache.directory.server.xdbm.search.Evaluator;
import org.apache.directory.shared.ldap.model.entry.Entry;
import org.apache.directory.shared.ldap.model.filter.ScopeNode;
@@ -63,13 +63,13 @@ public class SubtreeScopeEvaluator exten
/** True if the scope requires alias dereferencing while searching */
private final boolean dereferencing;
-
+
/** One level idx */
private final Index<UUID> subLevelIdx;
-
+
/** One level alias idx. Set if dereferencing aliases */
private final Index<UUID> subAliasIdx;
-
+
/** Alias idx. Set if dereferencing aliases */
private final Index<String> aliasIdx;
@@ -83,8 +83,8 @@ public class SubtreeScopeEvaluator exten
*/
@SuppressWarnings("unchecked")
public SubtreeScopeEvaluator( Partition db, ScopeNode node,
- TxnManagerFactory txnManagerFactory,
- OperationExecutionManagerFactory executionManagerFactory ) throws Exception
+ TxnManagerFactory txnManagerFactory,
+ OperationExecutionManagerFactory executionManagerFactory ) throws Exception
{
super( db, txnManagerFactory, executionManagerFactory );
this.node = node;
@@ -97,19 +97,19 @@ public class SubtreeScopeEvaluator exten
baseId = executionManager.getEntryId( db, node.getBaseDn() );
baseIsContextEntry = ( getContextEntryId().compareTo( baseId ) == 0 );
dereferencing = node.getDerefAliases().isDerefInSearching() || node.getDerefAliases().isDerefAlways();
-
+
Index<?> index;
-
+
index = db.getSystemIndex( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID );
- subLevelIdx = ( Index<UUID> )txnLogManager.wrap( db.getSuffixDn(), index );
-
+ subLevelIdx = ( Index<UUID> ) txnLogManager.wrap( db.getSuffixDn(), index );
+
if ( dereferencing )
{
index = db.getSystemIndex( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID );
- subAliasIdx = ( Index<UUID> )txnLogManager.wrap( db.getSuffixDn(), index );
-
+ subAliasIdx = ( Index<UUID> ) txnLogManager.wrap( db.getSuffixDn(), index );
+
index = db.getSystemIndex( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
- aliasIdx = ( Index<String> )txnLogManager.wrap( db.getSuffixDn(), index );
+ aliasIdx = ( Index<String> ) txnLogManager.wrap( db.getSuffixDn(), index );
}
else
{
@@ -160,7 +160,7 @@ public class SubtreeScopeEvaluator exten
public boolean evaluate( IndexEntry<?> candidate ) throws Exception
{
UUID id = candidate.getId();
-
+
/*
* This condition catches situations where the candidate is equal to
* the base entry and when the base entry is the context entry. Note
Modified: directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java?rev=1296527&r1=1296526&r2=1296527&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java (original)
+++ directory/apacheds/branches/apacheds-txns/xdbm-partition/src/test/java/org/apache/directory/server/xdbm/impl/avl/AvlPartitionTest.java Sat Mar 3 00:20:10 2012
@@ -34,14 +34,14 @@ import java.util.UUID;
import org.apache.directory.server.constants.ApacheSchemaConstants;
import org.apache.directory.server.core.api.interceptor.context.AddOperationContext;
-import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
-import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
-import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
import org.apache.directory.server.core.api.partition.OperationExecutionManager;
import org.apache.directory.server.core.api.partition.index.GenericIndex;
import org.apache.directory.server.core.api.partition.index.Index;
import org.apache.directory.server.core.api.partition.index.IndexEntry;
import org.apache.directory.server.core.api.partition.index.IndexNotFoundException;
+import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
+import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
+import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
import org.apache.directory.server.xdbm.XdbmStoreUtils;
import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
import org.apache.directory.shared.ldap.model.csn.CsnFactory;
@@ -95,17 +95,18 @@ public class AvlPartitionTest
/** The DC AttributeType instance */
private static AttributeType DC_AT;
-
+
/** The ApacheAlias AttributeType instance */
private static AttributeType APACHE_ALIAS_AT;
-
+
/** Operation execution manager */
private static OperationExecutionManager executionManager;
-
+
/** txn and operation execution manager factories */
private static TxnManagerFactory txnManagerFactory;
private static OperationExecutionManagerFactory executionManagerFactory;
+
@BeforeClass
public static void setup() throws Exception
{
@@ -117,7 +118,7 @@ public class AvlPartitionTest
int targetPos = path.indexOf( "target" );
workingDirectory = path.substring( 0, targetPos + 6 );
}
-
+
File logDir = new File( workingDirectory + File.separatorChar + "txnlog" + File.separatorChar );
logDir.mkdirs();
txnManagerFactory = new TxnManagerFactory( logDir.getPath(), 1 << 13, 1 << 14 );
@@ -135,7 +136,7 @@ public class AvlPartitionTest
if ( !loaded )
{
- fail( "Schema load failed : " + Exceptions.printErrors(schemaManager.getErrors()) );
+ fail( "Schema load failed : " + Exceptions.printErrors( schemaManager.getErrors() ) );
}
EXAMPLE_COM = new Dn( schemaManager, "dc=example,dc=com" );
@@ -241,7 +242,7 @@ public class AvlPartitionTest
public void testSimplePropertiesLocked() throws Exception
{
assertNotNull( partition.getAliasIndex() );
-
+
try
{
partition.addIndex( new AvlIndex<String>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ) );
@@ -253,7 +254,7 @@ public class AvlPartitionTest
assertEquals( 0, partition.getCacheSize() );
assertNotNull( partition.getPresenceIndex() );
-
+
try
{
partition.addIndex( new AvlIndex<String>( ApacheSchemaConstants.APACHE_PRESENCE_AT_OID ) );
@@ -264,7 +265,7 @@ public class AvlPartitionTest
}
assertNotNull( partition.getOneLevelIndex() );
-
+
try
{
partition.addIndex( new AvlIndex<UUID>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID ) );
@@ -275,7 +276,7 @@ public class AvlPartitionTest
}
assertNotNull( partition.getSubLevelIndex() );
-
+
try
{
partition.addIndex( new AvlIndex<UUID>( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) );
@@ -286,7 +287,7 @@ public class AvlPartitionTest
}
assertNotNull( partition.getId() );
-
+
try
{
partition.setId( "foo" );
@@ -298,7 +299,7 @@ public class AvlPartitionTest
assertNotNull( partition.getEntryUuidIndex() );
assertNotNull( partition.getRdnIndex() );
-
+
try
{
partition.addIndex( new AvlRdnIndex( ApacheSchemaConstants.APACHE_RDN_AT_OID ) );
@@ -309,7 +310,7 @@ public class AvlPartitionTest
}
assertNotNull( partition.getOneAliasIndex() );
-
+
try
{
partition.addIndex( new AvlIndex<UUID>( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID ) );
@@ -320,7 +321,7 @@ public class AvlPartitionTest
}
assertNotNull( partition.getSubAliasIndex() );
-
+
try
{
partition.addIndex( new AvlIndex<UUID>( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID ) );
@@ -331,7 +332,7 @@ public class AvlPartitionTest
}
assertNotNull( partition.getSuffixDn() );
-
+
Iterator<String> systemIndices = partition.getSystemIndices();
for ( int i = 0; i < 10; i++ )
@@ -342,7 +343,7 @@ public class AvlPartitionTest
assertFalse( systemIndices.hasNext() );
assertNotNull( partition.getSystemIndex( APACHE_ALIAS_AT ) );
-
+
try
{
partition.getSystemIndex( SN_AT );
@@ -351,7 +352,7 @@ public class AvlPartitionTest
catch ( IndexNotFoundException e )
{
}
-
+
try
{
partition.getSystemIndex( DC_AT );
@@ -362,10 +363,10 @@ public class AvlPartitionTest
}
assertNotNull( partition.getSuffixDn() );
-
+
Iterator<String> userIndices = partition.getUserIndices();
int count = 0;
-
+
while ( userIndices.hasNext() )
{
userIndices.next();
@@ -383,7 +384,7 @@ public class AvlPartitionTest
assertNotNull( userIndices.next() );
assertFalse( userIndices.hasNext() );
assertNotNull( partition.getUserIndex( OU_AT ) );
-
+
try
{
partition.getUserIndex( SN_AT );
@@ -392,7 +393,7 @@ public class AvlPartitionTest
catch ( IndexNotFoundException e )
{
}
-
+
try
{
partition.getUserIndex( DC_AT );
@@ -414,11 +415,13 @@ public class AvlPartitionTest
public void testFreshStore() throws Exception
{
Dn dn = new Dn( schemaManager, "o=Good Times Co." );
- assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000001" ), executionManager.getEntryId( partition, dn ) );
+ assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000001" ),
+ executionManager.getEntryId( partition, dn ) );
assertEquals( 11, partition.count() );
// note that the suffix entry returns 0 for it's parent which does not exist
- assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000000" ), executionManager.getParentId( partition, executionManager.getEntryId( partition, dn ) ) );
+ assertEquals( UUID.fromString( "00000000-0000-0000-0000-000000000000" ),
+ executionManager.getParentId( partition, executionManager.getEntryId( partition, dn ) ) );
assertNull( executionManager.getParentId( partition, UUID.fromString( "00000000-0000-0000-0000-000000000000" ) ) );
// should be allowed
@@ -429,17 +432,20 @@ public class AvlPartitionTest
@Test
public void testEntryOperations() throws Exception
{
- assertEquals( 3, executionManager.getChildCount( partition, UUID.fromString( "00000000-0000-0000-0000-000000000001" ) ) );
+ assertEquals( 3,
+ executionManager.getChildCount( partition, UUID.fromString( "00000000-0000-0000-0000-000000000001" ) ) );
- Cursor<IndexEntry<UUID>> cursor = executionManager.list( partition, UUID.fromString( "00000000-0000-0000-0000-000000000001" ) );
+ Cursor<IndexEntry<UUID>> cursor = executionManager.list( partition,
+ UUID.fromString( "00000000-0000-0000-0000-000000000001" ) );
assertNotNull( cursor );
cursor.beforeFirst();
assertTrue( cursor.next() );
- assertEquals( Strings.getUUIDString( 2 ), cursor.get().getId() );
+ assertEquals( Strings.getUUIDString( 2 ), cursor.get().getId() );
assertTrue( cursor.next() );
assertEquals( 3, executionManager.getChildCount( partition, Strings.getUUIDString( 1 ) ) );
- executionManager.delete( partition, executionManager.buildEntryDn( partition, Strings.getUUIDString( 2 ) ), Strings.getUUIDString( 2 ) );
+ executionManager.delete( partition, executionManager.buildEntryDn( partition, Strings.getUUIDString( 2 ) ),
+ Strings.getUUIDString( 2 ) );
assertEquals( 2, executionManager.getChildCount( partition, Strings.getUUIDString( 1 ) ) );
assertEquals( 10, partition.count() );
@@ -695,7 +701,7 @@ public class AvlPartitionTest
Rdn rdn = new Rdn( "cn=Ryan" );
- childEntry = ( DefaultEntry )addContext.getModifiedEntry();
+ childEntry = ( DefaultEntry ) addContext.getModifiedEntry();
Entry modifiedChildEntry = childEntry.clone();
executionManager.moveAndRename( partition, childDn, parentDn, rdn, modifiedChildEntry, childEntry, true );
@@ -732,7 +738,7 @@ public class AvlPartitionTest
executionManager.modify( partition, dn, add );
assertTrue( lookedup.get( "sn" ).contains( attribVal ) );
- executionManager.modify( partition, dn, new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
+ executionManager.modify( partition, dn, new DefaultModification( ModificationOperation.ADD_ATTRIBUTE,
schemaManager.getAttributeType( "telephoneNumber" ), "+1974045779" ) );
lookedup = executionManager.lookup( partition, executionManager.getEntryId( partition, dn ) );
assertTrue( lookedup.get( "telephoneNumber" ).contains( "+1974045779" ) );
@@ -759,7 +765,8 @@ public class AvlPartitionTest
lookedup = executionManager.modify( partition, dn, add );
assertEquals( attribVal, lookedup.get( "sn" ).get().getString() );
- lookedup = executionManager.modify( partition, dn, new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, SN_AT, "JWalker" ) );
+ lookedup = executionManager.modify( partition, dn, new DefaultModification(
+ ModificationOperation.REPLACE_ATTRIBUTE, SN_AT, "JWalker" ) );
assertEquals( "JWalker", lookedup.get( "sn" ).get().getString() );
}
@@ -782,10 +789,12 @@ public class AvlPartitionTest
assertNull( lookedup.get( "sn" ) );
// add an entry for the sake of testing the remove operation
- lookedup = executionManager.modify( partition, dn, new DefaultModification( ModificationOperation.ADD_ATTRIBUTE, SN_AT, "JWalker" ) );
+ lookedup = executionManager.modify( partition, dn, new DefaultModification(
+ ModificationOperation.ADD_ATTRIBUTE, SN_AT, "JWalker" ) );
assertNotNull( lookedup.get( "sn" ) );
- lookedup = executionManager.modify( partition, dn, new DefaultModification( ModificationOperation.REMOVE_ATTRIBUTE, SN_AT ) );
+ lookedup = executionManager.modify( partition, dn, new DefaultModification(
+ ModificationOperation.REMOVE_ATTRIBUTE, SN_AT ) );
assertNull( lookedup.get( "sn" ) );
}