You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/02/20 04:58:21 UTC
svn commit: r379013 [14/45] - in /directory/trunks/apacheds: ./ core-plugin/
core-plugin/src/main/java/org/apache/directory/server/core/tools/schema/
core-plugin/src/test/java/org/apache/directory/server/core/tools/schema/
core-shared/ core-shared/src/...
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexNotFoundException.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexNotFoundException.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexNotFoundException.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexNotFoundException.java Sun Feb 19 19:57:02 2006
@@ -26,8 +26,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class IndexNotFoundException
- extends NamingException
+public class IndexNotFoundException extends NamingException
{
private static final long serialVersionUID = 3906088970608981815L;
@@ -40,13 +39,12 @@
*
* @param indexName the name of the index that was not found
*/
- public IndexNotFoundException( String indexName )
+ public IndexNotFoundException(String indexName)
{
- super( "Cannot efficiently search the DIB w/o an index on attribute "
- + indexName + "\n. To allow such searches please contact the "
+ super( "Cannot efficiently search the DIB w/o an index on attribute " + indexName
+ + "\n. To allow such searches please contact the "
+ "directory\nadministrator to create the index or to enable "
- + "referrals on searches using these\nattributes to a replica with "
- + "the required set of indices." );
+ + "referrals on searches using these\nattributes to a replica with " + "the required set of indices." );
this.indexName = indexName;
}
@@ -57,7 +55,7 @@
* @param message the message associated with the exception.
* @param indexName the name of the index that was not found
*/
- public IndexNotFoundException( String message, String indexName )
+ public IndexNotFoundException(String message, String indexName)
{
super( message );
this.indexName = indexName;
@@ -72,8 +70,7 @@
* @param indexName the name of the index that was not found
* @param rootCause the root cause of this exception
*/
- public IndexNotFoundException( String message, String indexName,
- Throwable rootCause )
+ public IndexNotFoundException(String message, String indexName, Throwable rootCause)
{
this( message, indexName );
setRootCause( rootCause );
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexNotFoundException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexNotFoundException.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexRecord.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexRecord.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexRecord.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexRecord.java Sun Feb 19 19:57:02 2006
@@ -119,7 +119,7 @@
*/
public Attributes getAttributes()
{
- if( entry == null )
+ if ( entry == null )
{
return null;
}
@@ -148,14 +148,14 @@
tuple.setKey( null );
tuple.setValue( null );
}
-
-
+
+
/**
* Utility method used to copy the contents of one IndexRecord into this
* IndexRecord.
*
* @param record the record whose contents we copy
- */
+ */
public void copy( IndexRecord record )
{
entry = record.getAttributes();
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexRecord.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexRecord.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/KeyOnlyComparator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/KeyOnlyComparator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/KeyOnlyComparator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/KeyOnlyComparator.java Sun Feb 19 19:57:02 2006
@@ -28,15 +28,14 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class KeyOnlyComparator
- implements TupleComparator, Serializable
+public class KeyOnlyComparator implements TupleComparator, Serializable
{
private static final long serialVersionUID = 3544956549803161397L;
private SerializableComparator keyComparator = null;
- public KeyOnlyComparator( SerializableComparator comparator )
+ public KeyOnlyComparator(SerializableComparator comparator)
{
keyComparator = comparator;
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/KeyOnlyComparator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/KeyOnlyComparator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java Sun Feb 19 19:57:02 2006
@@ -53,7 +53,6 @@
/** substring matching type constant */
private static final int SUBSTRING_MATCH = 3;
-
/** Database used to evaluate leaf with */
private BTreeDirectoryPartition db;
/** Oid Registry used to translate attributeIds to OIDs */
@@ -73,10 +72,9 @@
* @param scopeEvaluator
* @param substringEvaluator
*/
- public LeafEvaluator( BTreeDirectoryPartition db, OidRegistry oidRegistry,
- AttributeTypeRegistry attributeTypeRegistry,
- ScopeEvaluator scopeEvaluator,
- SubstringEvaluator substringEvaluator )
+ public LeafEvaluator(BTreeDirectoryPartition db, OidRegistry oidRegistry,
+ AttributeTypeRegistry attributeTypeRegistry, ScopeEvaluator scopeEvaluator,
+ SubstringEvaluator substringEvaluator)
{
this.db = db;
this.oidRegistry = oidRegistry;
@@ -107,31 +105,30 @@
{
return scopeEvaluator.evaluate( node, record );
}
-
- switch( ( ( LeafNode ) node ).getAssertionType() )
+
+ switch ( ( ( LeafNode ) node ).getAssertionType() )
{
- case( LeafNode.APPROXIMATE ):
- return evalEquality( ( SimpleNode ) node, record );
- case( LeafNode.EQUALITY ):
- return evalEquality( ( SimpleNode ) node, record );
- case( LeafNode.EXTENSIBLE ):
- throw new NotImplementedException();
- case( LeafNode.GREATEREQ ):
- return evalGreater( ( SimpleNode ) node, record, true );
- case( LeafNode.LESSEQ ):
- return evalGreater( ( SimpleNode ) node, record, false );
- case( LeafNode.PRESENCE ):
- String attrId = ( ( PresenceNode ) node ).getAttribute();
- return evalPresence( attrId, record );
- case( LeafNode.SUBSTRING ):
- return substringEvaluator.evaluate( node, record );
- default:
- throw new NamingException( "Unrecognized leaf node type: "
- + ( ( LeafNode ) node ).getAssertionType() );
+ case ( LeafNode.APPROXIMATE ):
+ return evalEquality( ( SimpleNode ) node, record );
+ case ( LeafNode.EQUALITY ):
+ return evalEquality( ( SimpleNode ) node, record );
+ case ( LeafNode.EXTENSIBLE ):
+ throw new NotImplementedException();
+ case ( LeafNode.GREATEREQ ):
+ return evalGreater( ( SimpleNode ) node, record, true );
+ case ( LeafNode.LESSEQ ):
+ return evalGreater( ( SimpleNode ) node, record, false );
+ case ( LeafNode.PRESENCE ):
+ String attrId = ( ( PresenceNode ) node ).getAttribute();
+ return evalPresence( attrId, record );
+ case ( LeafNode.SUBSTRING ):
+ return substringEvaluator.evaluate( node, record );
+ default:
+ throw new NamingException( "Unrecognized leaf node type: " + ( ( LeafNode ) node ).getAssertionType() );
}
}
-
-
+
+
/**
* Evaluates a simple greater than or less than attribute value assertion on
* a perspective candidate.
@@ -143,30 +140,29 @@
* @return the ava evaluation on the perspective candidate
* @throws NamingException if there is a database access failure
*/
- private boolean evalGreater( SimpleNode node, IndexRecord record,
- boolean isGreater ) throws NamingException
+ private boolean evalGreater( SimpleNode node, IndexRecord record, boolean isGreater ) throws NamingException
{
String attrId = node.getAttribute();
BigInteger id = record.getEntryId();
-
+
if ( db.hasUserIndexOn( attrId ) )
{
Index idx = db.getUserIndex( attrId );
-
+
if ( isGreater )
{
- return idx.hasValue( node.getValue(), id, true );
+ return idx.hasValue( node.getValue(), id, true );
}
-
+
return idx.hasValue( node.getValue(), id, false );
}
-
+
// resusitate entry if need be
if ( null == record.getAttributes() )
{
record.setAttributes( db.lookup( id ) );
}
-
+
// get the attribute associated with the node
Attribute attr = record.getAttributes().get( attrId );
@@ -175,7 +171,7 @@
{
return false;
}
-
+
/*
* We need to iterate through all values and for each value we normalize
* and use the comparator to determine if a match exists.
@@ -184,7 +180,7 @@
Comparator comparator = getComparator( attrId );
Object filterValue = node.getValue();
NamingEnumeration list = attr.getAll();
-
+
/*
* Cheaper to not check isGreater in one loop - better to separate
* out into two loops which you choose to execute based on isGreater
@@ -194,7 +190,7 @@
while ( list.hasMore() )
{
Object value = normalizer.normalize( list.next() );
-
+
// Found a value that is greater than or equal to the ava value
if ( 0 >= comparator.compare( value, filterValue ) )
{
@@ -202,12 +198,12 @@
}
}
}
- else
- {
+ else
+ {
while ( list.hasMore() )
{
Object value = normalizer.normalize( list.next() );
-
+
// Found a value that is less than or equal to the ava value
if ( 0 <= comparator.compare( value, filterValue ) )
{
@@ -215,12 +211,12 @@
}
}
}
-
+
// no match so return false
return false;
}
-
+
/**
* Evaluates a simple presence attribute value assertion on a perspective
* candidate.
@@ -230,21 +226,20 @@
* @return the ava evaluation on the perspective candidate
* @throws NamingException if there is a database access failure
*/
- private boolean evalPresence( String attrId, IndexRecord rec )
- throws NamingException
+ private boolean evalPresence( String attrId, IndexRecord rec ) throws NamingException
{
if ( db.hasUserIndexOn( attrId ) )
{
Index idx = db.getExistanceIndex();
return idx.hasValue( attrId, rec.getEntryId() );
}
-
+
// resusitate entry if need be
if ( null == rec.getAttributes() )
{
rec.setAttributes( db.lookup( rec.getEntryId() ) );
}
-
+
// get the attribute associated with the node
Attributes attrs = rec.getAttributes();
@@ -252,7 +247,7 @@
{
return false;
}
-
+
return null != attrs.get( attrId );
}
@@ -266,8 +261,7 @@
* @return the ava evaluation on the perspective candidate
* @throws NamingException if there is a database access failure
*/
- private boolean evalEquality( SimpleNode node, IndexRecord rec )
- throws NamingException
+ private boolean evalEquality( SimpleNode node, IndexRecord rec ) throws NamingException
{
if ( db.hasUserIndexOn( node.getAttribute() ) )
{
@@ -285,22 +279,22 @@
* AVA value is contained or the normalized form of the AVA value is
* contained.
*/
-
+
// resusitate entry if need be
if ( null == rec.getAttributes() )
{
rec.setAttributes( db.lookup( rec.getEntryId() ) );
}
-
+
// get the attribute associated with the node
Attribute attr = rec.getAttributes().get( node.getAttribute() );
-
+
// If we do not have the attribute just return false
if ( null == attr )
{
return false;
}
-
+
// check if AVA value exists in attribute
if ( attr.contains( node.getValue() ) )
{
@@ -315,7 +309,7 @@
{
return true;
}
-
+
/*
* We need to now iterate through all values because we could not get
* a lookup to work. For each value we normalize and use the comparator
@@ -325,13 +319,13 @@
while ( list.hasMore() )
{
Object value = normalizer.normalize( list.next() );
-
+
if ( 0 == comparator.compare( value, filterValue ) )
{
return true;
}
}
-
+
// no match so return false
return false;
}
@@ -372,22 +366,21 @@
* @return the matching rule
* @throws NamingException if there is a failure
*/
- private MatchingRule getMatchingRule( String attrId, int matchType )
- throws NamingException
+ private MatchingRule getMatchingRule( String attrId, int matchType ) throws NamingException
{
MatchingRule mrule = null;
String oid = oidRegistry.getOid( attrId );
AttributeType type = attributeTypeRegistry.lookup( oid );
- switch( matchType )
+ switch ( matchType )
{
- case( EQUALITY_MATCH ):
+ case ( EQUALITY_MATCH ):
mrule = type.getEquality();
break;
- case( SUBSTRING_MATCH ):
+ case ( SUBSTRING_MATCH ):
mrule = type.getSubstr();
break;
- case( ORDERING_MATCH ):
+ case ( ORDERING_MATCH ):
mrule = type.getOrdering();
break;
default:
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java Sun Feb 19 19:57:02 2006
@@ -37,6 +37,7 @@
/** the sequence key - stores last sequence value in the admin table */
String SEQPROP_KEY = "__sequence__";
+
/**
* Gets the Attributes of an entry from this MasterTable.
*
@@ -45,7 +46,8 @@
* @throws NamingException if there is a read error on the underlying Db.
*/
Attributes get( BigInteger id ) throws NamingException;
-
+
+
/**
* Puts the Attributes of an entry into this master table at an index
* specified by id. Used both to create new entries and update existing
@@ -57,7 +59,8 @@
* @throws NamingException if there is a write error on the underlying Db.
*/
Attributes put( Attributes entry, BigInteger id ) throws NamingException;
-
+
+
/**
* Deletes a entry from the master table at an index specified by id.
*
@@ -67,6 +70,7 @@
*/
Attributes delete( BigInteger id ) throws NamingException;
+
/**
* Get's the current id value from this master database's sequence without
* affecting the seq.
@@ -76,7 +80,8 @@
* read.
*/
BigInteger getCurrentId() throws NamingException;
-
+
+
/**
* Get's the next value from this SequenceBDb. This has the side-effect of
* changing the current sequence values perminantly in memory and on disk.
@@ -86,7 +91,8 @@
* read and writen to.
*/
BigInteger getNextId() throws NamingException;
-
+
+
/**
* Gets a persistant property stored in the admin table of this MasterTable.
*
@@ -95,7 +101,8 @@
* @throws NamingException when the underlying admin table cannot be read
*/
String getProperty( String property ) throws NamingException;
-
+
+
/**
* Sets a persistant property stored in the admin table of this MasterTable.
*
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MasterTable.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsEnumeration.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsEnumeration.java Sun Feb 19 19:57:02 2006
@@ -35,8 +35,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class NoDupsEnumeration
- implements NamingEnumeration
+public class NoDupsEnumeration implements NamingEnumeration
{
/** Temporary Tuple used to return results */
private final Tuple returned = new Tuple();
@@ -54,12 +53,10 @@
// C O N S T R U C T O R
// ------------------------------------------------------------------------
-
/**
* Creates a cursor over a TupleBrowser where duplicates are not expected.
*/
- public NoDupsEnumeration( TupleBrowser browser, boolean doAscendingScan )
- throws NamingException
+ public NoDupsEnumeration(TupleBrowser browser, boolean doAscendingScan) throws NamingException
{
this.browser = browser;
this.doAscendingScan = doAscendingScan;
@@ -71,14 +68,12 @@
// NamingEnumeration Interface Method Implementations
// ------------------------------------------------------------------------
-
/**
* Returns the same Tuple every time but with different key/value pairs.
*
* @see javax.naming.NamingEnumeration#next()
*/
- public Object next()
- throws NamingException
+ public Object next() throws NamingException
{
// Load values into the Tuple to return
returned.setKey( prefetched.getKey() );
@@ -88,8 +83,8 @@
prefetch();
return returned;
}
-
-
+
+
/**
* Returns the same Tuple every time but with different key/value pairs.
*
@@ -97,7 +92,7 @@
*/
public Object nextElement()
{
- try
+ try
{
return next();
}
@@ -142,7 +137,6 @@
// ------------------------------------------------------------------------
// Private/Package Friendly Methods
// ------------------------------------------------------------------------
-
/**
* Gets the direction of this NamingEnumeration.
@@ -167,11 +161,11 @@
// Prefetch into tuple!
boolean isSuccess = false;
- if ( doAscendingScan )
+ if ( doAscendingScan )
{
isSuccess = browser.getNext( prefetched );
- }
- else
+ }
+ else
{
isSuccess = browser.getPrevious( prefetched );
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsEnumeration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoDupsEnumeration.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Optimizer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Optimizer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java Sun Feb 19 19:57:02 2006
@@ -42,7 +42,7 @@
private ScopeEvaluator evaluator = null;
- public ScopeEnumerator( BTreeDirectoryPartition db, ScopeEvaluator evaluator )
+ public ScopeEnumerator(BTreeDirectoryPartition db, ScopeEvaluator evaluator)
{
this.db = db;
this.evaluator = evaluator;
@@ -63,20 +63,19 @@
final ScopeNode snode = ( ScopeNode ) node;
final BigInteger id = db.getEntryId( snode.getBaseDn() );
- switch( snode.getScope() )
+ switch ( snode.getScope() )
{
- case( SearchControls.OBJECT_SCOPE ):
- final IndexRecord record = new IndexRecord();
- record.setEntryId( id );
- record.setIndexKey( snode.getBaseDn() );
- return new SingletonEnumeration( record );
- case( SearchControls.ONELEVEL_SCOPE ):
- return enumerateChildren( snode.getBaseDn(),
- snode.getDerefAliases().derefInSearching() );
- case( SearchControls.SUBTREE_SCOPE ):
- return enumerateDescendants( snode );
- default:
- throw new NamingException( "Unrecognized search scope!" );
+ case ( SearchControls.OBJECT_SCOPE ):
+ final IndexRecord record = new IndexRecord();
+ record.setEntryId( id );
+ record.setIndexKey( snode.getBaseDn() );
+ return new SingletonEnumeration( record );
+ case ( SearchControls.ONELEVEL_SCOPE ):
+ return enumerateChildren( snode.getBaseDn(), snode.getDerefAliases().derefInSearching() );
+ case ( SearchControls.SUBTREE_SCOPE ):
+ return enumerateDescendants( snode );
+ default:
+ throw new NamingException( "Unrecognized search scope!" );
}
}
@@ -92,20 +91,19 @@
* @throws NamingException if any failures occur while accessing system
* indices.
*/
- private NamingEnumeration enumerateChildren( String dn, boolean deref )
- throws NamingException
+ private NamingEnumeration enumerateChildren( String dn, boolean deref ) throws NamingException
{
Index idx = db.getHierarchyIndex();
final BigInteger id = db.getEntryId( dn );
final NamingEnumeration children = idx.listIndices( id );
-
+
/*
* If alias dereferencing is not enabled while searching then we just
* return the enumeration of the base entry's children.
*/
- if ( ! deref )
+ if ( !deref )
{
- return children;
+ return children;
}
/* ====================================================================
@@ -122,16 +120,16 @@
// List all entries brought into one level scope at base by aliases
idx = db.getOneAliasIndex();
NamingEnumeration aliasIntroduced = idx.listIndices( id );
-
+
// Still need to use assertion enum to weed out aliases
- NamingEnumeration nonAliasChildren = new IndexAssertionEnumeration(
- children, new AssertNotAlias() );
-
+ NamingEnumeration nonAliasChildren = new IndexAssertionEnumeration( children, new AssertNotAlias() );
+
// Combine both into one enumeration
- NamingEnumeration [] all = {nonAliasChildren, aliasIntroduced};
+ NamingEnumeration[] all =
+ { nonAliasChildren, aliasIntroduced };
return new DisjunctionEnumeration( all );
}
-
+
/**
* Constructs an enumeration over all entries within subtree scope even
@@ -143,8 +141,7 @@
* @throws NamingException if any failures occur while accessing system
* indices.
*/
- private NamingEnumeration enumerateDescendants( final ScopeNode node )
- throws NamingException
+ private NamingEnumeration enumerateDescendants( final ScopeNode node ) throws NamingException
{
Index idx = null;
@@ -152,20 +149,18 @@
* If we do not dereference while searching then we simply return any
* entry that is not a descendant of the base.
*/
- if ( ! node.getDerefAliases().derefInSearching() )
+ if ( !node.getDerefAliases().derefInSearching() )
{
// Gets a NamingEnumeration over all elements
idx = db.getNdnIndex();
NamingEnumeration underlying = idx.listIndices();
- return new IndexAssertionEnumeration( underlying,
- new AssertDescendant( node ) );
+ return new IndexAssertionEnumeration( underlying, new AssertDescendant( node ) );
}
// Create an assertion to assert or evaluate an expression
IndexAssertion assertion = new IndexAssertion()
{
- public boolean assertCandidate( IndexRecord rec )
- throws NamingException
+ public boolean assertCandidate( IndexRecord rec ) throws NamingException
{
return evaluator.evaluate( node, rec );
}
@@ -177,7 +172,6 @@
return new IndexAssertionEnumeration( underlying, assertion );
}
-
/**
* Asserts an entry is a descendant.
*/
@@ -186,13 +180,13 @@
/** Scope node with base and alias info */
private final ScopeNode scope;
-
+
/**
* Creates a assertion using a ScopeNode to determine the search base.
*
* @param node the scope node with search base
*/
- AssertDescendant( final ScopeNode node )
+ AssertDescendant(final ScopeNode node)
{
scope = node;
}
@@ -209,8 +203,7 @@
String dn = db.getEntryDn( record.getEntryId() );
return dn.endsWith( scope.getBaseDn() );
}
- }
-
+ }
/**
* Asserts an entry is NOT an alias.
@@ -225,13 +218,13 @@
public boolean assertCandidate( IndexRecord record ) throws NamingException
{
Index aliasIdx = db.getAliasIndex();
-
+
if ( null == aliasIdx.reverseLookup( record.getEntryId() ) )
{
return true;
}
-
+
return false;
- }
+ }
}
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java Sun Feb 19 19:57:02 2006
@@ -54,7 +54,7 @@
*
* @param db the database used to evaluate scope node
*/
- public ScopeEvaluator( BTreeDirectoryPartition db )
+ public ScopeEvaluator(BTreeDirectoryPartition db)
{
this.db = db;
}
@@ -63,26 +63,25 @@
/**
* @see org.apache.directory.server.core.partition.impl.btree.Evaluator#evaluate(ExprNode, org.apache.directory.server.core.partition.impl.btree.IndexRecord)
*/
- public boolean evaluate( ExprNode node, IndexRecord record )
- throws NamingException
+ public boolean evaluate( ExprNode node, IndexRecord record ) throws NamingException
{
ScopeNode snode = ( ScopeNode ) node;
-
- switch( snode.getScope() )
+
+ switch ( snode.getScope() )
{
- case( SearchControls.OBJECT_SCOPE ):
- String dn = db.getEntryDn( record.getEntryId() );
- return dn.equals( snode.getBaseDn() );
- case( SearchControls.ONELEVEL_SCOPE ):
- return assertOneLevelScope( snode, record.getEntryId() );
- case( SearchControls.SUBTREE_SCOPE ):
- return assertSubtreeScope( snode, record.getEntryId() );
- default:
- throw new NamingException( "Unrecognized search scope!" );
+ case ( SearchControls.OBJECT_SCOPE ):
+ String dn = db.getEntryDn( record.getEntryId() );
+ return dn.equals( snode.getBaseDn() );
+ case ( SearchControls.ONELEVEL_SCOPE ):
+ return assertOneLevelScope( snode, record.getEntryId() );
+ case ( SearchControls.SUBTREE_SCOPE ):
+ return assertSubtreeScope( snode, record.getEntryId() );
+ default:
+ throw new NamingException( "Unrecognized search scope!" );
}
}
-
-
+
+
/**
* Asserts whether or not a candidate has one level scope while taking
* alias dereferencing into account.
@@ -93,20 +92,19 @@
* alias dereferencing is enabled.
* @throws NamingException if the index lookups fail.
*/
- public boolean assertSubtreeScope( final ScopeNode node,
- final BigInteger id ) throws NamingException
+ public boolean assertSubtreeScope( final ScopeNode node, final BigInteger id ) throws NamingException
{
String dn = db.getEntryDn( id );
DerefAliasesEnum mode = node.getDerefAliases();
Object baseId = db.getEntryId( node.getBaseDn() );
boolean isDescendant = dn.endsWith( node.getBaseDn() );
-
+
/*
* The candidate id could be any entry in the db. If search
* dereferencing is not enabled then we return the results of the
* descendant test.
*/
- if ( ! mode.derefInSearching() )
+ if ( !mode.derefInSearching() )
{
return isDescendant;
}
@@ -121,7 +119,7 @@
{
return false;
}
-
+
/*
* The candidate is NOT an alias at this point. So if it is a
* descendant we just return it since it is in normal subtree scope.
@@ -130,7 +128,7 @@
{
return true;
}
-
+
/*
* At this point the candidate is not a descendant and it is not an
* alias. We need to check if the candidate is in extended subtree
@@ -147,8 +145,8 @@
idx = db.getSubAliasIndex();
return idx.hasValue( baseId, id );
}
-
-
+
+
/**
* Asserts whether or not a candidate has one level scope while taking
* alias dereferencing into account.
@@ -159,8 +157,7 @@
* alias dereferencing is enabled.
* @throws NamingException if the index lookups fail.
*/
- public boolean assertOneLevelScope( final ScopeNode node,
- final BigInteger id ) throws NamingException
+ public boolean assertOneLevelScope( final ScopeNode node, final BigInteger id ) throws NamingException
{
DerefAliasesEnum mode = node.getDerefAliases();
Object baseId = db.getEntryId( node.getBaseDn() );
@@ -172,7 +169,7 @@
* dereferencing is not enabled then we return the results of the child
* test.
*/
- if ( ! mode.derefInSearching() )
+ if ( !mode.derefInSearching() )
{
return isChild;
}
@@ -187,7 +184,7 @@
{
return false;
}
-
+
/*
* The candidate is NOT an alias at this point. So if it is a child we
* just return it since it is in normal one level scope.
@@ -196,7 +193,7 @@
{
return true;
}
-
+
/*
* At this point the candidate is not a child and it is not an alias.
* We need to check if the candidate is in extended one level scope by
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java Sun Feb 19 19:57:02 2006
@@ -35,7 +35,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public interface SearchEngine
+public interface SearchEngine
{
/**
* @todo put this in the right place
@@ -62,14 +62,16 @@
* The alias dereferencing mode value for JNDI providers
*/
String SEARCHING = "searching";
-
+
+
/**
* Gets the optimizer for this DefaultSearchEngine.
*
* @return the optimizer
*/
Optimizer getOptimizer();
-
+
+
/**
* Conducts a search on a database.
*
@@ -80,8 +82,8 @@
* @return enumeration over SearchResults
* @throws NamingException if the search fails
*/
- NamingEnumeration search( Name base, Map env, ExprNode filter,
- SearchControls searchCtls ) throws NamingException;
+ NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls ) throws NamingException;
+
/**
* Evaluates a filter on an entry with a id.
@@ -91,5 +93,5 @@
* @return true if the filter passes the entry, false otherwise
* @throws NamingException if something goes wrong while accessing the db
*/
- boolean evaluate( ExprNode filter, BigInteger id ) throws NamingException;
+ boolean evaluate( ExprNode filter, BigInteger id ) throws NamingException;
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SearchEngine.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java Sun Feb 19 19:57:02 2006
@@ -63,9 +63,8 @@
* @param db the database
* @param evaluator a substring evaluator
*/
- public SubstringEnumerator( BTreeDirectoryPartition db,
- AttributeTypeRegistry attributeTypeRegistry,
- SubstringEvaluator evaluator )
+ public SubstringEnumerator(BTreeDirectoryPartition db, AttributeTypeRegistry attributeTypeRegistry,
+ SubstringEvaluator evaluator)
{
this.db = db;
this.evaluator = evaluator;
@@ -76,14 +75,12 @@
// ------------------------------------------------------------------------
// SubstringEnumerator Methods
// ------------------------------------------------------------------------
-
-
+
/**
* @see Enumerator#enumerate(
* org.apache.directory.shared.ldap.filter.ExprNode)
*/
- public NamingEnumeration enumerate( final ExprNode node )
- throws NamingException
+ public NamingEnumeration enumerate( final ExprNode node ) throws NamingException
{
Pattern regex = null;
Index idx = null;
@@ -97,14 +94,13 @@
* Build out regex in this block so we do not do it twice in the
* evaluator if there is no index on the attribute of the substr ava
*/
- try
+ try
{
regex = snode.getRegex( normalizer );
- }
- catch ( PatternSyntaxException e )
+ }
+ catch ( PatternSyntaxException e )
{
- NamingException ne = new NamingException( "SubstringNode '"
- + node + "' had incorrect syntax" );
+ NamingException ne = new NamingException( "SubstringNode '" + node + "' had incorrect syntax" );
ne.setRootCause( e );
throw ne;
}
@@ -118,13 +114,13 @@
if ( null == snode.getInitial() )
{
return idx.listIndices( regex );
- }
- else
+ }
+ else
{
return idx.listIndices( regex, snode.getInitial() );
}
}
-
+
/*
* From this point on we are dealing with an enumeration over entries
* based on an attribute that is not indexed. We have no choice but
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java Sun Feb 19 19:57:02 2006
@@ -33,6 +33,7 @@
import org.apache.directory.shared.ldap.schema.MatchingRule;
import org.apache.directory.shared.ldap.schema.Normalizer;
+
/**
* Evaluates substring filter assertions on an entry.
*
@@ -56,8 +57,8 @@
* @param oidRegistry the OID registry for name to OID mapping
* @param attributeTypeRegistry the attributeType registry
*/
- public SubstringEvaluator( BTreeDirectoryPartition db, OidRegistry oidRegistry,
- AttributeTypeRegistry attributeTypeRegistry )
+ public SubstringEvaluator(BTreeDirectoryPartition db, OidRegistry oidRegistry,
+ AttributeTypeRegistry attributeTypeRegistry)
{
this.db = db;
this.oidRegistry = oidRegistry;
@@ -68,55 +69,53 @@
/**
* @see org.apache.directory.server.core.partition.impl.btree.Evaluator#evaluate(ExprNode, IndexRecord)
*/
- public boolean evaluate( ExprNode node, IndexRecord record )
- throws NamingException
+ public boolean evaluate( ExprNode node, IndexRecord record ) throws NamingException
{
- Pattern regex = null;
+ Pattern regex = null;
SubstringNode snode = ( SubstringNode ) node;
String oid = oidRegistry.getOid( snode.getAttribute() );
AttributeType type = attributeTypeRegistry.lookup( oid );
-
+
MatchingRule rule = type.getSubstr();
if ( rule == null )
{
rule = type.getEquality();
}
-
+
Normalizer normalizer = rule.getNormalizer();
if ( db.hasUserIndexOn( snode.getAttribute() ) )
{
Index idx = db.getUserIndex( snode.getAttribute() );
-
+
/*
* Note that this is using the reverse half of the index giving a
* considerable performance improvement on this kind of operation.
* Otherwise we would have to scan the entire index if there were
* no reverse lookups.
*/
-
+
NamingEnumeration list = idx.listReverseIndices( record.getEntryId() );
// compile the regular expression to search for a matching attribute
- try
+ try
{
regex = snode.getRegex( normalizer );
- }
- catch ( PatternSyntaxException pse )
+ }
+ catch ( PatternSyntaxException pse )
{
- NamingException ne = new NamingException( "SubstringNode '"
- + node + "' had " + "incorrect syntax" );
+ NamingException ne = new NamingException( "SubstringNode '" + node + "' had " + "incorrect syntax" );
ne.setRootCause( pse );
throw ne;
}
// cycle through the attribute values testing for a match
- while ( list.hasMore() )
+ while ( list.hasMore() )
{
IndexRecord rec = ( IndexRecord ) list.next();
-
+
// once match is found cleanup and return true
- if ( regex.matcher( ( String ) rec.getIndexKey() ).matches() )
+ if ( regex.matcher( ( String ) rec.getIndexKey() ).matches() )
{
list.close();
return true;
@@ -130,17 +129,17 @@
// --------------------------------------------------------------------
// Index not defined beyond this point
// --------------------------------------------------------------------
-
+
// resusitate the entry if it has not been and set entry in IndexRecord
if ( null == record.getAttributes() )
{
Attributes attrs = db.lookup( record.getEntryId() );
record.setAttributes( attrs );
}
-
+
// get the attribute
Attribute attr = record.getAttributes().get( snode.getAttribute() );
-
+
// if the attribute does not exist just return false
if ( null == attr )
{
@@ -148,32 +147,30 @@
}
// compile the regular expression to search for a matching attribute
- try
+ try
{
regex = snode.getRegex( normalizer );
- }
- catch ( PatternSyntaxException pse )
+ }
+ catch ( PatternSyntaxException pse )
{
- NamingException ne = new NamingException( "SubstringNode '"
- + node + "' had " + "incorrect syntax" );
+ NamingException ne = new NamingException( "SubstringNode '" + node + "' had " + "incorrect syntax" );
ne.setRootCause( pse );
throw ne;
}
-
+
/*
* Cycle through the attribute values testing normalized version
* obtained from using the substring matching rule's normalizer.
* The test uses the comparator obtained from the appropriate
* substring matching rule.
- */
- NamingEnumeration list = attr.getAll();
- while ( list.hasMore() )
- {
- String value = ( String )
- normalizer.normalize( list.next() );
-
+ */
+ NamingEnumeration list = attr.getAll();
+ while ( list.hasMore() )
+ {
+ String value = ( String ) normalizer.normalize( list.next() );
+
// Once match is found cleanup and return true
- if ( regex.matcher( value ).matches() )
+ if ( regex.matcher( value ).matches() )
{
list.close();
return true;
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java Sun Feb 19 19:57:02 2006
@@ -41,6 +41,7 @@
*/
TupleComparator getComparator();
+
/**
* Gets the data renderer used by this Table to display or log records keys
* and values.
@@ -49,6 +50,7 @@
*/
TupleRenderer getRenderer();
+
/**
* Sets the data renderer to by used by this Table to display or log record
* keys and values.
@@ -57,6 +59,7 @@
*/
void setRenderer( TupleRenderer renderer );
+
/**
* Gets the name of this Table.
*
@@ -64,6 +67,7 @@
*/
String getName();
+
/**
* Checks to see if this Table has enabled the use of duplicate keys.
*
@@ -71,6 +75,7 @@
*/
boolean isDupsEnabled();
+
/**
* Checks to see if this Table has enabled sorting on the values of
* duplicate keys.
@@ -78,13 +83,12 @@
* @return true if duplicate key values are sorted, false otherwise.
*/
boolean isSortedDupsEnabled();
-
+
// ------------------------------------------------------------------------
// Simple Table Key/Value Assertions
// ------------------------------------------------------------------------
-
/**
* Checks to see if this table has a key: same as a get call with a check to
* see if the returned value is null or not.
@@ -95,6 +99,7 @@
*/
boolean has( Object key ) throws NamingException;
+
/**
* Checks to see if this table has a key with a specific value.
*
@@ -105,6 +110,7 @@
*/
boolean has( Object key, Object value ) throws NamingException;
+
/**
* Checks to see if this table has a record with a key greater/less than or
* equal to the key argument. The key argument need not exist for this
@@ -120,6 +126,7 @@
*/
boolean has( Object key, boolean isGreaterThan ) throws NamingException;
+
/**
* Checks to see if this table has a record with a key equal to the
* argument key with a value greater/less than or equal to the value
@@ -138,9 +145,8 @@
* or if the underlying Db is not of the Btree type that allows sorted
* duplicate values.
*/
- boolean has( Object key, Object val, boolean isGreaterThan )
- throws NamingException;
-
+ boolean has( Object key, Object val, boolean isGreaterThan ) throws NamingException;
+
// ------------------------------------------------------------------------
// Table Value Accessors/Mutators
@@ -160,6 +166,7 @@
*/
Object get( Object key ) throws NamingException;
+
/**
* Puts a record into this Table.
*
@@ -172,6 +179,7 @@
*/
Object put( Object key, Object value ) throws NamingException;
+
/**
* Efficiently puts a set of values into the Table. If the Table does not
* support duplicate keys then only the first key within the enumeration is
@@ -186,6 +194,7 @@
*/
Object put( Object key, NamingEnumeration values ) throws NamingException;
+
/**
* Removes all records with key from this Table.
*
@@ -195,6 +204,7 @@
*/
Object remove( Object key ) throws NamingException;
+
/**
* Removes a single specific record with key and value from this Table.
*
@@ -219,8 +229,7 @@
* @throws NamingException if there is a failure to read or write to
* the underlying Db
*/
- Object remove( Object key, NamingEnumeration values )
- throws NamingException;
+ Object remove( Object key, NamingEnumeration values ) throws NamingException;
/**
@@ -240,7 +249,6 @@
// ------------------------------------------------------------------------
// listTuple overloads
// ------------------------------------------------------------------------
-
/**
* Sets a cursor to the first record in the Table and enables single
@@ -250,6 +258,7 @@
*/
NamingEnumeration listTuples() throws NamingException;
+
/**
* Sets a cursor to the first record in the Table with a key value of
* key and enables single next steps across all duplicate records with
@@ -260,6 +269,7 @@
*/
NamingEnumeration listTuples( Object key ) throws NamingException;
+
/**
* Sets a cursor to the first record in the Table with a key value
* greater/less than or equal to key and enables single next steps across
@@ -272,8 +282,8 @@
* iterates down over descending keys less than or equal to key argument
* @throws NamingException if the underlying cursor could not be set
*/
- NamingEnumeration listTuples( Object key, boolean isGreaterThan )
- throws NamingException;
+ NamingEnumeration listTuples( Object key, boolean isGreaterThan ) throws NamingException;
+
/**
* Sets a cursor to the first record in the Table with a key equal to
@@ -294,14 +304,12 @@
* this method is called over a cursor on a table that does not have sorted
* duplicates enabled.
*/
- NamingEnumeration listTuples( Object key, Object val, boolean isGreaterThan )
- throws NamingException;
+ NamingEnumeration listTuples( Object key, Object val, boolean isGreaterThan ) throws NamingException;
// ------------------------------------------------------------------------
// Table Record Count Methods
// ------------------------------------------------------------------------
-
/**
* Gets the count of the number of records in this Table.
@@ -311,6 +319,7 @@
*/
int count() throws NamingException;
+
/**
* Gets the count of the number of records in this Table with a specific
* key: returns the number of duplicates for a key.
@@ -321,6 +330,7 @@
*/
int count( Object key ) throws NamingException;
+
/**
* Returns the number of records greater than or less than a key value. The
* key need not exist for this call to return a non-zero value.
@@ -332,6 +342,7 @@
* @throws NamingException if there is a failure to read the underlying Db
*/
int count( Object key, boolean isGreaterThan ) throws NamingException;
+
/**
* Closes the underlying Db of this Table.
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Table.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Tuple.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Tuple.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Tuple.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Tuple.java Sun Feb 19 19:57:02 2006
@@ -32,7 +32,7 @@
/** the value for this Tuple */
private Object value;
-
+
/**
* Do nothing default that has a null key and null value.
*/
@@ -40,21 +40,21 @@
{
// does nothing!
}
-
+
/**
* Creates a Tuple using a key and a value.
*
* @param key the key to set
* @param value the value to set
- */
- public Tuple( Object key, Object value )
+ */
+ public Tuple(Object key, Object value)
{
this.key = key;
this.value = value;
}
-
-
+
+
/**
* Gets the key for this Tuple.
*
@@ -64,8 +64,8 @@
{
return key;
}
-
-
+
+
/**
* Sets the key for this Tuple.
*
@@ -75,8 +75,8 @@
{
this.key = key;
}
-
-
+
+
/**
* Gets the value for this Tuple.
*
@@ -86,8 +86,8 @@
{
return value;
}
-
-
+
+
/**
* Sets the value for this Tuple.
*
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Tuple.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Tuple.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleBrowser.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleBrowser.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleBrowser.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleBrowser.java Sun Feb 19 19:57:02 2006
@@ -38,6 +38,7 @@
*/
boolean getNext( Tuple tuple ) throws NamingException;
+
/**
* Gets the previous value deemed greater than the last using the key
* comparator.
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleBrowser.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleBrowser.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleComparator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleComparator.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java Sun Feb 19 19:57:02 2006
@@ -34,8 +34,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class TupleEnumeration
- implements NamingEnumeration
+public class TupleEnumeration implements NamingEnumeration
{
private final Object key;
private final Iterator iterator;
@@ -48,14 +47,14 @@
* @param key the keys whose duplicate values are to be returned
* @param iterator the underlying iterator this cursor uses
*/
- public TupleEnumeration( Object key, Iterator iterator )
+ public TupleEnumeration(Object key, Iterator iterator)
{
this.key = key;
tuple.setKey( key );
this.iterator = iterator;
}
-
+
/**
* Gets the next value as a Tuple.
*
@@ -107,7 +106,7 @@
/**
* @see javax.naming.NamingEnumeration#close()
*/
- public void close()
- {
+ public void close()
+ {
}
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleEnumeration.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleRenderer.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleRenderer.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleRenderer.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleRenderer.java Sun Feb 19 19:57:02 2006
@@ -34,6 +34,7 @@
*/
String getKeyString( Object key );
+
/**
* Gets the value Object rendered as a String.
*
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleRenderer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/TupleRenderer.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id
Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java Sun Feb 19 19:57:02 2006
@@ -1,136 +1,136 @@
-/*
- * Copyright 2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.directory.server.core.partition.impl.btree.gui;
-
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-
-import javax.swing.tree.TreeNode;
-
-import org.apache.directory.shared.ldap.filter.BranchNode;
-import org.apache.directory.shared.ldap.filter.ExprNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * A node representing an entry.
- *
- * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
- */
-public class ASTNode implements TreeNode
-{
- private static final Logger log = LoggerFactory.getLogger( ASTNode.class );
-
- private final ASTNode parent;
- private final ExprNode exprNode;
- private final ArrayList children;
-
-
- public ASTNode( ASTNode parent, ExprNode exprNode )
- {
- this.children = new ArrayList(2);
- this.exprNode = exprNode;
-
- if( parent == null )
- {
- this.parent = this;
- }
- else
- {
- this.parent = parent;
- }
-
- try
- {
- if( exprNode.isLeaf() )
- {
- return;
- }
-
- BranchNode branch = ( BranchNode ) exprNode;
- ArrayList exprNodes = branch.getChildren();
- for ( int ii = 0; ii < exprNodes.size(); ii++ )
- {
- ExprNode child = ( ExprNode ) exprNodes.get(ii);
- children.add( new ASTNode( this, child ) );
- }
- }
- catch( Exception e )
- {
- // FIXME What exception could be thrown here?
- log.warn( "Unexpected exception: parent=" + parent + ", exprNode=" + exprNode, e );
- }
- }
-
-
- public Enumeration children()
- {
- return Collections.enumeration( children );
- }
-
-
- public boolean getAllowsChildren()
- {
- return !exprNode.isLeaf();
- }
-
-
- public TreeNode getChildAt( int childIndex )
- {
- return ( TreeNode ) children.get( childIndex );
- }
-
-
- public int getChildCount()
- {
- return children.size();
- }
-
-
- public int getIndex( TreeNode child )
- {
- return children.indexOf( child );
- }
-
-
- public TreeNode getParent()
- {
- return parent;
- }
-
-
- public boolean isLeaf()
- {
- return children.size() <= 0;
- }
-
-
- public String toString()
- {
- return exprNode.toString();
- }
-
-
- public ExprNode getExprNode()
- {
- return exprNode;
- }
-}
+/*
+ * Copyright 2004 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.directory.server.core.partition.impl.btree.gui;
+
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+
+import javax.swing.tree.TreeNode;
+
+import org.apache.directory.shared.ldap.filter.BranchNode;
+import org.apache.directory.shared.ldap.filter.ExprNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * A node representing an entry.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class ASTNode implements TreeNode
+{
+ private static final Logger log = LoggerFactory.getLogger( ASTNode.class );
+
+ private final ASTNode parent;
+ private final ExprNode exprNode;
+ private final ArrayList children;
+
+
+ public ASTNode(ASTNode parent, ExprNode exprNode)
+ {
+ this.children = new ArrayList( 2 );
+ this.exprNode = exprNode;
+
+ if ( parent == null )
+ {
+ this.parent = this;
+ }
+ else
+ {
+ this.parent = parent;
+ }
+
+ try
+ {
+ if ( exprNode.isLeaf() )
+ {
+ return;
+ }
+
+ BranchNode branch = ( BranchNode ) exprNode;
+ ArrayList exprNodes = branch.getChildren();
+ for ( int ii = 0; ii < exprNodes.size(); ii++ )
+ {
+ ExprNode child = ( ExprNode ) exprNodes.get( ii );
+ children.add( new ASTNode( this, child ) );
+ }
+ }
+ catch ( Exception e )
+ {
+ // FIXME What exception could be thrown here?
+ log.warn( "Unexpected exception: parent=" + parent + ", exprNode=" + exprNode, e );
+ }
+ }
+
+
+ public Enumeration children()
+ {
+ return Collections.enumeration( children );
+ }
+
+
+ public boolean getAllowsChildren()
+ {
+ return !exprNode.isLeaf();
+ }
+
+
+ public TreeNode getChildAt( int childIndex )
+ {
+ return ( TreeNode ) children.get( childIndex );
+ }
+
+
+ public int getChildCount()
+ {
+ return children.size();
+ }
+
+
+ public int getIndex( TreeNode child )
+ {
+ return children.indexOf( child );
+ }
+
+
+ public TreeNode getParent()
+ {
+ return parent;
+ }
+
+
+ public boolean isLeaf()
+ {
+ return children.size() <= 0;
+ }
+
+
+ public String toString()
+ {
+ return exprNode.toString();
+ }
+
+
+ public ExprNode getExprNode()
+ {
+ return exprNode;
+ }
+}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/ASTNode.java
------------------------------------------------------------------------------
--- svn:keywords (original)
+++ svn:keywords Sun Feb 19 19:57:02 2006
@@ -1 +1,4 @@
-HeadURL Id LastChangedBy LastChangedDate LastChangedRevision
+Rev
+Revision
+Date
+Id