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 [13/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/...
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.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/Oid.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Oid.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Oid.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Oid.java Sun Feb 19 19:57:02 2006
@@ -16,6 +16,7 @@
*/
package org.apache.directory.server.core.partition;
+
/**
* Provides constants of private OIDs.
*
@@ -25,19 +26,20 @@
public class Oid
{
/** Private OID (1.2.6.1.4.1.18060.1.1.1.3.1) for _ndn op attrib */
- public static final String NDN = "1.2.6.1.4.1.18060.1.1.1.3.1" ;
+ public static final String NDN = "1.2.6.1.4.1.18060.1.1.1.3.1";
/** Private OID (1.2.6.1.4.1.18060.1.1.1.3.2) for _updn op attrib */
- public static final String UPDN = "1.2.6.1.4.1.18060.1.1.1.3.2" ;
+ public static final String UPDN = "1.2.6.1.4.1.18060.1.1.1.3.2";
/** Private OID (1.2.6.1.4.1.18060.1.1.1.3.3) for _existance op attrib */
- public static final String EXISTANCE = "1.2.6.1.4.1.18060.1.1.1.3.3" ;
+ public static final String EXISTANCE = "1.2.6.1.4.1.18060.1.1.1.3.3";
/** Private OID (1.2.6.1.4.1.18060.1.1.1.3.4) for _hierarchy op attrib */
- public static final String HIERARCHY = "1.2.6.1.4.1.18060.1.1.1.3.4" ;
+ public static final String HIERARCHY = "1.2.6.1.4.1.18060.1.1.1.3.4";
/** Private OID (1.2.6.1.4.1.18060.1.1.1.3.5) for _oneAlias index */
- public static final String ONEALIAS = "1.2.6.1.4.1.18060.1.1.1.3.5" ;
+ public static final String ONEALIAS = "1.2.6.1.4.1.18060.1.1.1.3.5";
/** Private OID (1.2.6.1.4.1.18060.1.1.1.3.6) for _subAlias index */
- public static final String SUBALIAS = "1.2.6.1.4.1.18060.1.1.1.3.6" ;
+ public static final String SUBALIAS = "1.2.6.1.4.1.18060.1.1.1.3.6";
/** Private OID (1.2.6.1.4.1.18060.1.1.1.3.7) for _alias index */
- public static final String ALIAS = "1.2.6.1.4.1.18060.1.1.1.3.7" ;
+ public static final String ALIAS = "1.2.6.1.4.1.18060.1.1.1.3.7";
+
private Oid()
{
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Oid.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Oid.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/BTreeDirectoryPartition.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java Sun Feb 19 19:57:02 2006
@@ -59,38 +59,37 @@
The following OID branch is reserved for the directory TLP once it
graduates the incubator:
- 1.2.6.1.4.1.18060.1.1
+ 1.2.6.1.4.1.18060.1.1
The following branch is reserved for the apache directory server:
- 1.2.6.1.4.1.18060.1.1.1
+ 1.2.6.1.4.1.18060.1.1.1
- The following branch is reserved for use by apache directory server Syntaxes:
+ The following branch is reserved for use by apache directory server Syntaxes:
- 1.2.6.1.4.1.18060.1.1.1.1
+ 1.2.6.1.4.1.18060.1.1.1.1
- The following branch is reserved for use by apache directory server MatchingRules:
+ The following branch is reserved for use by apache directory server MatchingRules:
- 1.2.6.1.4.1.18060.1.1.1.2
+ 1.2.6.1.4.1.18060.1.1.1.2
- The following branch is reserved for use by apache directory server AttributeTypes:
+ The following branch is reserved for use by apache directory server AttributeTypes:
- 1.2.6.1.4.1.18060.1.1.1.3
+ 1.2.6.1.4.1.18060.1.1.1.3
- * 1.2.6.1.4.1.18060.1.1.1.3.1 - apacheNdn
- * 1.2.6.1.4.1.18060.1.1.1.3.2 - apacheUpdn
- * 1.2.6.1.4.1.18060.1.1.1.3.3 - apacheExistance
- * 1.2.6.1.4.1.18060.1.1.1.3.4 - apacheHierarchy
- * 1.2.6.1.4.1.18060.1.1.1.3.5 - apacheOneAlias
- * 1.2.6.1.4.1.18060.1.1.1.3.6 - apacheSubAlias
- * 1.2.6.1.4.1.18060.1.1.1.3.7 - apacheAlias
+ * 1.2.6.1.4.1.18060.1.1.1.3.1 - apacheNdn
+ * 1.2.6.1.4.1.18060.1.1.1.3.2 - apacheUpdn
+ * 1.2.6.1.4.1.18060.1.1.1.3.3 - apacheExistance
+ * 1.2.6.1.4.1.18060.1.1.1.3.4 - apacheHierarchy
+ * 1.2.6.1.4.1.18060.1.1.1.3.5 - apacheOneAlias
+ * 1.2.6.1.4.1.18060.1.1.1.3.6 - apacheSubAlias
+ * 1.2.6.1.4.1.18060.1.1.1.3.7 - apacheAlias
- The following branch is reserved for use by apache directory server ObjectClasses:
+ The following branch is reserved for use by apache directory server ObjectClasses:
- 1.2.6.1.4.1.18060.1.1.1.4
-
- ==================================================================== */
+ 1.2.6.1.4.1.18060.1.1.1.4
+ ==================================================================== */
/**
* the search engine used to search the database
@@ -98,6 +97,7 @@
private SearchEngine searchEngine = null;
private AttributeTypeRegistry attributeTypeRegistry = null;
+
// ------------------------------------------------------------------------
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
@@ -108,9 +108,10 @@
protected BTreeDirectoryPartition()
{
}
-
- public void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg ) throws NamingException
+
+ public void init( DirectoryServiceConfiguration factoryCfg, DirectoryPartitionConfiguration cfg )
+ throws NamingException
{
attributeTypeRegistry = factoryCfg.getGlobalRegistries().getAttributeTypeRegistry();
OidRegistry oidRegistry = factoryCfg.getGlobalRegistries().getOidRegistry();
@@ -128,7 +129,7 @@
sysOidSet.add( Oid.ALIAS );
Iterator i = cfg.getIndexedAttributes().iterator();
- while( i.hasNext() )
+ while ( i.hasNext() )
{
String name = ( String ) i.next();
String oid = oidRegistry.getOid( name );
@@ -167,8 +168,7 @@
}
else
{
- throw new NamingException( "Unidentified system index "
- + oid );
+ throw new NamingException( "Unidentified system index " + oid );
}
}
else
@@ -182,17 +182,16 @@
if ( suffixOnDisk == null )
{
add( cfg.getSuffix(),
- cfg.getNormalizedSuffix( factoryCfg.getGlobalRegistries().getMatchingRuleRegistry() ),
- cfg.getContextEntry() );
+ cfg.getNormalizedSuffix( factoryCfg.getGlobalRegistries().getMatchingRuleRegistry() ), cfg
+ .getContextEntry() );
}
}
-
+
// ------------------------------------------------------------------------
// Public Accessors - not declared in any interfaces just for this class
// ------------------------------------------------------------------------
-
/**
* Gets the DefaultSearchEngine used by this ContextPartition to search the
* Database.
@@ -209,7 +208,6 @@
// ContextPartition Interface Method Implementations
// ------------------------------------------------------------------------
-
public void delete( Name dn ) throws NamingException
{
BigInteger id = getEntryId( dn.toString() );
@@ -217,44 +215,47 @@
// don't continue if id is null
if ( id == null )
{
- throw new LdapNameNotFoundException( "Could not find entry at '"
- + dn + "' to delete it!");
+ throw new LdapNameNotFoundException( "Could not find entry at '" + dn + "' to delete it!" );
}
if ( getChildCount( id ) > 0 )
{
- LdapContextNotEmptyException cnee = new LdapContextNotEmptyException(
- "[66] Cannot delete entry " + dn + " it has children!" );
+ LdapContextNotEmptyException cnee = new LdapContextNotEmptyException( "[66] Cannot delete entry " + dn
+ + " it has children!" );
cnee.setRemainingName( dn );
throw cnee;
}
-
+
delete( id );
}
-
+
+
public abstract void add( String updn, Name dn, Attributes entry ) throws NamingException;
+
+
public abstract void modify( Name dn, int modOp, Attributes mods ) throws NamingException;
+
+
public abstract void modify( Name dn, ModificationItem[] mods ) throws NamingException;
public NamingEnumeration list( Name base ) throws NamingException
{
SearchResultEnumeration list;
- list = new BTreeSearchResultEnumeration( ArrayUtils.EMPTY_STRING_ARRAY,
- list( getEntryId( base.toString() ) ), this, attributeTypeRegistry );
+ list = new BTreeSearchResultEnumeration( ArrayUtils.EMPTY_STRING_ARRAY, list( getEntryId( base.toString() ) ),
+ this, attributeTypeRegistry );
return list;
}
-
-
- public NamingEnumeration search( Name base, Map env, ExprNode filter,
- SearchControls searchCtls )
+
+
+ public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
throws NamingException
{
- String [] attrIds = searchCtls.getReturningAttributes();
+ String[] attrIds = searchCtls.getReturningAttributes();
NamingEnumeration underlying = null;
-
+
underlying = searchEngine.search( base, env, filter, searchCtls );
-
+
return new BTreeSearchResultEnumeration( attrIds, underlying, this, attributeTypeRegistry );
}
@@ -265,7 +266,7 @@
}
- public Attributes lookup( Name dn, String [] attrIds ) throws NamingException
+ public Attributes lookup( Name dn, String[] attrIds ) throws NamingException
{
if ( attrIds == null || attrIds.length == 0 )
{
@@ -296,18 +297,27 @@
public abstract void modifyRn( Name dn, String newRdn, boolean deleteOldRdn ) throws NamingException;
+
+
public abstract void move( Name oldChildDn, Name newParentDn ) throws NamingException;
- public abstract void move( Name oldChildDn, Name newParentDn, String newRdn,
- boolean deleteOldRdn ) throws NamingException;
+
+
+ public abstract void move( Name oldChildDn, Name newParentDn, String newRdn, boolean deleteOldRdn )
+ throws NamingException;
public abstract void sync() throws NamingException;
+
+
public abstract void destroy();
+
+
public abstract boolean isInitialized();
+
public boolean isSuffix( Name dn ) throws NamingException
{
- return getSuffix( true ).equals( dn ) ;
+ return getSuffix( true ).equals( dn );
}
@@ -316,20 +326,27 @@
PartitionViewer viewer = new PartitionViewer( this, searchEngine );
viewer.execute();
}
-
+
+
////////////////////
// public abstract methods
-
+
// ------------------------------------------------------------------------
// Index Operations
// ------------------------------------------------------------------------
-
public abstract void addIndexOn( AttributeType attribute ) throws NamingException;
+
+
public abstract boolean hasUserIndexOn( String attribute );
+
+
public abstract boolean hasSystemIndexOn( String attribute );
+
+
public abstract Index getExistanceIndex();
+
/**
* Gets the Index mapping the BigInteger primary keys of parents to the
* BigInteger primary keys of their children.
@@ -337,7 +354,8 @@
* @return the hierarchy Index
*/
public abstract Index getHierarchyIndex();
-
+
+
/**
* Gets the Index mapping user provided distinguished names of entries as
* Strings to the BigInteger primary keys of entries.
@@ -346,6 +364,7 @@
*/
public abstract Index getUpdnIndex();
+
/**
* Gets the Index mapping the normalized distinguished names of entries as
* Strings to the BigInteger primary keys of entries.
@@ -354,6 +373,7 @@
*/
public abstract Index getNdnIndex();
+
/**
* Gets the alias index mapping parent entries with scope expanding aliases
* children one level below them; this system index is used to dereference
@@ -363,6 +383,7 @@
*/
public abstract Index getOneAliasIndex();
+
/**
* Gets the alias index mapping relative entries with scope expanding
* alias descendents; this system index is used to dereference aliases on
@@ -372,6 +393,7 @@
*/
public abstract Index getSubAliasIndex();
+
/**
* Gets the system index defined on the ALIAS_ATTRIBUTE which for LDAP would
* be the aliasedObjectName and for X.500 would be aliasedEntryName.
@@ -380,6 +402,7 @@
*/
public abstract Index getAliasIndex();
+
/**
* Sets the system index defined on the ALIAS_ATTRIBUTE which for LDAP would
* be the aliasedObjectName and for X.500 would be aliasedEntryName.
@@ -388,34 +411,39 @@
*/
public abstract void setAliasIndexOn( AttributeType attrType ) throws NamingException;
+
/**
* Sets the attribute existance Index.
*
* @param attrType the attribute existance Index
- */
+ */
public abstract void setExistanceIndexOn( AttributeType attrType ) throws NamingException;
+
/**
* Sets the hierarchy Index.
*
* @param attrType the hierarchy Index
- */
+ */
public abstract void setHierarchyIndexOn( AttributeType attrType ) throws NamingException;
+
/**
* Sets the user provided distinguished name Index.
*
* @param attrType the updn Index
- */
+ */
public abstract void setUpdnIndexOn( AttributeType attrType ) throws NamingException;
+
/**
* Sets the normalized distinguished name Index.
*
* @param attrType the ndn Index
- */
+ */
public abstract void setNdnIndexOn( AttributeType attrType ) throws NamingException;
-
+
+
/**
* Sets the alias index mapping parent entries with scope expanding aliases
* children one level below them; this system index is used to dereference
@@ -424,7 +452,8 @@
* @param attrType a one level alias index
*/
public abstract void setOneAliasIndexOn( AttributeType attrType ) throws NamingException;
-
+
+
/**
* Sets the alias index mapping relative entries with scope expanding
* alias descendents; this system index is used to dereference aliases on
@@ -433,13 +462,26 @@
* @param attrType a subtree alias index
*/
public abstract void setSubAliasIndexOn( AttributeType attrType ) throws NamingException;
+
+
public abstract Index getUserIndex( String attribute ) throws IndexNotFoundException;
+
+
public abstract Index getSystemIndex( String attribute ) throws IndexNotFoundException;
+
+
public abstract BigInteger getEntryId( String dn ) throws NamingException;
+
+
public abstract String getEntryDn( BigInteger id ) throws NamingException;
+
+
public abstract BigInteger getParentId( String dn ) throws NamingException;
+
+
public abstract BigInteger getParentId( BigInteger childId ) throws NamingException;
+
/**
* Gets the user provided distinguished name.
*
@@ -449,6 +491,7 @@
*/
public abstract String getEntryUpdn( BigInteger id ) throws NamingException;
+
/**
* Gets the user provided distinguished name.
*
@@ -457,16 +500,37 @@
* @throws NamingException if the updn and ndn indices cannot be accessed
*/
public abstract String getEntryUpdn( String dn ) throws NamingException;
+
+
public abstract Attributes lookup( BigInteger id ) throws NamingException;
+
+
public abstract void delete( BigInteger id ) throws NamingException;
+
+
public abstract NamingEnumeration list( BigInteger id ) throws NamingException;
+
+
public abstract int getChildCount( BigInteger id ) throws NamingException;
+
+
public abstract Attributes getSuffixEntry() throws NamingException;
+
+
public abstract void setProperty( String key, String value ) throws NamingException;
+
+
public abstract String getProperty( String key ) throws NamingException;
+
+
public abstract Iterator getUserIndices();
+
+
public abstract Iterator getSystemIndices();
+
+
public abstract Attributes getIndices( BigInteger id ) throws NamingException;
+
/**
* Gets the count of the total number of entries in the database.
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.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/BTreeSearchResult.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java Sun Feb 19 19:57:02 2006
@@ -37,13 +37,12 @@
/** the primary key used for the resultant entry */
private final BigInteger id;
-
-
+
+
// ------------------------------------------------------------------------
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
-
+
/**
* Creates a database search result.
*
@@ -52,14 +51,13 @@
* @param obj the object if any
* @param attrs the attributes of the entry
*/
- public BTreeSearchResult( BigInteger id, String name, Object obj,
- Attributes attrs )
+ public BTreeSearchResult(BigInteger id, String name, Object obj, Attributes attrs)
{
super( name, obj, attrs );
this.id = id;
}
-
+
/**
* Creates a database search result.
*
@@ -69,14 +67,13 @@
* @param attrs the attributes of the entry
* @param isRelative whether or not the name is relative to the base
*/
- public BTreeSearchResult( BigInteger id, String name, Object obj,
- Attributes attrs, boolean isRelative )
+ public BTreeSearchResult(BigInteger id, String name, Object obj, Attributes attrs, boolean isRelative)
{
super( name, obj, attrs, isRelative );
this.id = id;
}
-
+
/**
* Creates a database search result.
*
@@ -86,14 +83,13 @@
* @param obj the object if any
* @param attrs the attributes of the entry
*/
- public BTreeSearchResult( BigInteger id, String name, String className,
- Object obj, Attributes attrs )
+ public BTreeSearchResult(BigInteger id, String name, String className, Object obj, Attributes attrs)
{
super( name, className, obj, attrs );
this.id = id;
}
-
+
/**
* Creates a database search result.
*
@@ -104,14 +100,14 @@
* @param attrs the attributes of the entry
* @param isRelative whether or not the name is relative to the base
*/
- public BTreeSearchResult( BigInteger id, String name, String className,
- Object obj, Attributes attrs, boolean isRelative )
+ public BTreeSearchResult(BigInteger id, String name, String className, Object obj, Attributes attrs,
+ boolean isRelative)
{
super( name, className, obj, attrs, isRelative );
this.id = id;
}
-
-
+
+
/**
* Gets the unique row id of the entry into the master table.
*
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResult.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/BTreeSearchResultEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java Sun Feb 19 19:57:02 2006
@@ -45,7 +45,7 @@
/** Database used to lookup entries from */
private BTreeDirectoryPartition partition = null;
/** the attributes to return */
- private final String [] attrIds;
+ private final String[] attrIds;
/** underlying enumeration over IndexRecords */
private final NamingEnumeration underlying;
@@ -53,6 +53,7 @@
private boolean attrIdsHasPlus = false;
private AttributeTypeRegistry registry = null;
+
/**
* Creates an enumeration that returns entries packaged within SearchResults
* using the search parameters supplied to a search call.
@@ -60,10 +61,8 @@
* @param attrIds the returned attributes
* @param underlying the enumeration over IndexRecords
*/
- public BTreeSearchResultEnumeration( String [] attrIds,
- NamingEnumeration underlying,
- BTreeDirectoryPartition db,
- AttributeTypeRegistry registry )
+ public BTreeSearchResultEnumeration(String[] attrIds, NamingEnumeration underlying, BTreeDirectoryPartition db,
+ AttributeTypeRegistry registry)
{
this.partition = db;
this.attrIds = attrIds;
@@ -72,8 +71,8 @@
this.attrIdsHasPlus = containsPlus( attrIds );
this.registry = registry;
}
-
-
+
+
/**
* @see javax.naming.NamingEnumeration#close()
*/
@@ -82,7 +81,7 @@
underlying.close();
}
-
+
/**
* @see javax.naming.NamingEnumeration#hasMore()
*/
@@ -91,7 +90,7 @@
return underlying.hasMore();
}
-
+
/**
* @see javax.naming.NamingEnumeration#next()
*/
@@ -121,7 +120,7 @@
// add all listed attributes
for ( int ii = 0; ii < attrIds.length; ii++ )
{
- if ( attrIds[ii].equals( "+") )
+ if ( attrIds[ii].equals( "+" ) )
{
continue;
}
@@ -158,7 +157,7 @@
// add all listed operational attributes
for ( int ii = 0; ii < attrIds.length; ii++ )
{
- if ( attrIds[ii].equals( "*") )
+ if ( attrIds[ii].equals( "*" ) )
{
continue;
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.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/DefaultOptimizer.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java Sun Feb 19 19:57:02 2006
@@ -44,18 +44,18 @@
private static final BigInteger MAX = BigInteger.valueOf( Integer.MAX_VALUE );
/** the database this optimizer operates on */
private BTreeDirectoryPartition db;
-
-
+
+
/**
* Creates an optimizer on a database.
*
* @param db the database this optimizer works for.
*/
- public DefaultOptimizer( BTreeDirectoryPartition db )
+ public DefaultOptimizer(BTreeDirectoryPartition db)
{
this.db = db;
}
-
+
/**
* Annotates the expression tree to determine optimal evaluation order based
@@ -82,7 +82,7 @@
* This is conducted differently based on the type of the leaf node.
* Comments on each node type explain how each scan count is arrived at.
*/
-
+
if ( node instanceof ScopeNode )
{
count = getScopeScan( ( ScopeNode ) node );
@@ -95,66 +95,65 @@
* scan count is not specified by the implementation.
*/
}
- else if ( node.isLeaf() )
+ else if ( node.isLeaf() )
{
LeafNode leaf = ( LeafNode ) node;
-
- switch ( leaf.getAssertionType() )
+
+ switch ( leaf.getAssertionType() )
{
- case( LeafNode.APPROXIMATE ):
- /** Feature not implemented so we just use equality matching */
- count = getEqualityScan( ( SimpleNode ) leaf );
- break;
- case( LeafNode.EQUALITY ):
- count = getEqualityScan( ( SimpleNode ) leaf );
- break;
- case( LeafNode.EXTENSIBLE ):
- /** Cannot really say so we presume the total index count */
- count = getFullScan( leaf );
- break;
- case( LeafNode.GREATEREQ ):
- count = getGreaterLessScan( ( SimpleNode ) leaf, true );
- break;
- case( LeafNode.LESSEQ ):
- count = getGreaterLessScan( ( SimpleNode ) leaf, false );
- break;
- case( LeafNode.PRESENCE ):
- count = getPresenceScan( ( PresenceNode ) leaf );
- break;
- case( LeafNode.SUBSTRING ):
- /** Cannot really say so we presume the total index count */
- count = getFullScan( leaf );
- break;
- default:
- throw new IllegalArgumentException( "Unrecognized leaf node" );
+ case ( LeafNode.APPROXIMATE ):
+ /** Feature not implemented so we just use equality matching */
+ count = getEqualityScan( ( SimpleNode ) leaf );
+ break;
+ case ( LeafNode.EQUALITY ):
+ count = getEqualityScan( ( SimpleNode ) leaf );
+ break;
+ case ( LeafNode.EXTENSIBLE ):
+ /** Cannot really say so we presume the total index count */
+ count = getFullScan( leaf );
+ break;
+ case ( LeafNode.GREATEREQ ):
+ count = getGreaterLessScan( ( SimpleNode ) leaf, true );
+ break;
+ case ( LeafNode.LESSEQ ):
+ count = getGreaterLessScan( ( SimpleNode ) leaf, false );
+ break;
+ case ( LeafNode.PRESENCE ):
+ count = getPresenceScan( ( PresenceNode ) leaf );
+ break;
+ case ( LeafNode.SUBSTRING ):
+ /** Cannot really say so we presume the total index count */
+ count = getFullScan( leaf );
+ break;
+ default:
+ throw new IllegalArgumentException( "Unrecognized leaf node" );
}
- }
+ }
// --------------------------------------------------------------------
// H A N D L E B R A N C H N O D E S
// --------------------------------------------------------------------
- else
+ else
{
BranchNode bnode = ( BranchNode ) node;
- switch( bnode.getOperator() )
+ switch ( bnode.getOperator() )
{
- case( BranchNode.AND ):
- count = getConjunctionScan( bnode );
- break;
- case( BranchNode.NOT ):
- count = getNegationScan( bnode );
- break;
- case( BranchNode.OR ):
- count = getDisjunctionScan( bnode );
- break;
- default:
- throw new IllegalArgumentException(
- "Unrecognized branch node type" );
+ case ( BranchNode.AND ):
+ count = getConjunctionScan( bnode );
+ break;
+ case ( BranchNode.NOT ):
+ count = getNegationScan( bnode );
+ break;
+ case ( BranchNode.OR ):
+ count = getDisjunctionScan( bnode );
+ break;
+ default:
+ throw new IllegalArgumentException( "Unrecognized branch node type" );
}
}
// Protect against overflow when counting.
- if ( count.compareTo( BigInteger.ZERO ) < 0 )
+ if ( count.compareTo( BigInteger.ZERO ) < 0 )
{
count = MAX;
}
@@ -176,19 +175,19 @@
*/
private BigInteger getConjunctionScan( BranchNode node ) throws NamingException
{
- BigInteger count = BigInteger.valueOf( Integer.MAX_VALUE );
- ArrayList children = node.getChildren();
-
- for ( int ii = 0; ii < children.size(); ii++ )
+ BigInteger count = BigInteger.valueOf( Integer.MAX_VALUE );
+ ArrayList children = node.getChildren();
+
+ for ( int ii = 0; ii < children.size(); ii++ )
{
ExprNode child = ( ExprNode ) children.get( ii );
annotate( child );
count = ( ( BigInteger ) child.get( "count" ) ).min( count );
}
- return count;
+ return count;
}
-
+
/**
* Negation counts are estimated in one of two ways depending on its
@@ -207,22 +206,20 @@
private BigInteger getNegationScan( BranchNode node ) throws NamingException
{
ExprNode onlyChild = ( ExprNode ) node.getChildren().get( 0 );
-
+
annotate( onlyChild );
- if ( onlyChild.isLeaf()
- && ! ( onlyChild instanceof ScopeNode )
- && ! ( onlyChild instanceof AssertionNode )
- && ! ( onlyChild instanceof PresenceNode ) )
+ if ( onlyChild.isLeaf() && !( onlyChild instanceof ScopeNode ) && !( onlyChild instanceof AssertionNode )
+ && !( onlyChild instanceof PresenceNode ) )
{
LeafNode leaf = ( LeafNode ) onlyChild;
Index idx = db.getUserIndex( leaf.getAttribute() );
return BigInteger.valueOf( idx.count() );
- }
+ }
return BigInteger.valueOf( db.count() );
}
-
+
/**
* Disjunctions (OR) are the union of candidates across all subexpressions
@@ -237,17 +234,17 @@
{
ArrayList children = node.getChildren();
BigInteger total = BigInteger.ZERO;
-
- for ( int ii = 0; ii < children.size(); ii++ )
+
+ for ( int ii = 0; ii < children.size(); ii++ )
{
ExprNode child = ( ExprNode ) children.get( ii );
annotate( child );
total = total.add( ( BigInteger ) child.get( "count" ) );
}
- return total;
+ return total;
}
-
+
/**
* Gets the worst case scan count for all entries that satisfy the equality
@@ -257,8 +254,7 @@
* @return the worst case
* @throws NamingException if there is an error accessing an index
*/
- private BigInteger getEqualityScan( SimpleNode node )
- throws NamingException
+ private BigInteger getEqualityScan( SimpleNode node ) throws NamingException
{
if ( db.hasUserIndexOn( node.getAttribute() ) )
{
@@ -280,8 +276,7 @@
* @return the scan count of all nodes satisfying the AVA
* @throws NamingException if there is an error accessing an index
*/
- private BigInteger getGreaterLessScan( SimpleNode node,
- boolean isGreaterThan ) throws NamingException
+ private BigInteger getGreaterLessScan( SimpleNode node, boolean isGreaterThan ) throws NamingException
{
if ( db.hasUserIndexOn( node.getAttribute() ) )
{
@@ -304,8 +299,7 @@
* @return the worst case full scan count
* @throws NamingException if there is an error access database indices
*/
- private BigInteger getFullScan( LeafNode node )
- throws NamingException
+ private BigInteger getFullScan( LeafNode node ) throws NamingException
{
if ( db.hasUserIndexOn( node.getAttribute() ) )
{
@@ -313,7 +307,7 @@
int count = idx.count();
return BigInteger.valueOf( count );
}
-
+
return MAX;
}
@@ -334,7 +328,7 @@
int count = idx.count( node.getAttribute() );
return BigInteger.valueOf( count );
}
-
+
return MAX;
}
@@ -350,16 +344,15 @@
{
switch ( node.getScope() )
{
- case ( SearchControls.OBJECT_SCOPE ):
+ case ( SearchControls.OBJECT_SCOPE ):
return BigInteger.ONE;
- case ( SearchControls.ONELEVEL_SCOPE ):
+ case ( SearchControls.ONELEVEL_SCOPE ):
BigInteger id = db.getEntryId( node.getBaseDn() );
return BigInteger.valueOf( db.getChildCount( id ) );
- case ( SearchControls.SUBTREE_SCOPE ):
+ case ( SearchControls.SUBTREE_SCOPE ):
return BigInteger.valueOf( db.count() );
default:
- throw new IllegalArgumentException( "Unrecognized search scope "
- + "value for filter scope node" );
+ throw new IllegalArgumentException( "Unrecognized search scope " + "value for filter scope node" );
}
}
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.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/DefaultSearchEngine.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java Sun Feb 19 19:57:02 2006
@@ -50,20 +50,18 @@
private ExpressionEvaluator evaluator;
/** Enumerator flyweight that creates enumerations on filter expressions */
private ExpressionEnumerator enumerator;
-
+
// ------------------------------------------------------------------------
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
/**
* Creates a DefaultSearchEngine for searching a Database without setting
* up the database.
*/
- public DefaultSearchEngine( BTreeDirectoryPartition db,
- ExpressionEvaluator evaluator,
- ExpressionEnumerator enumerator )
+ public DefaultSearchEngine(BTreeDirectoryPartition db, ExpressionEvaluator evaluator,
+ ExpressionEnumerator enumerator)
{
this.db = db;
this.evaluator = evaluator;
@@ -81,13 +79,12 @@
{
return optimizer;
}
-
-
+
+
/**
* @see SearchEngine#search(Name, Map, ExprNode,SearchControls)
*/
- public NamingEnumeration search( Name base, Map env, ExprNode filter,
- SearchControls searchCtls )
+ public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls )
throws NamingException
{
Name effectiveBase = null;
@@ -95,18 +92,16 @@
String aliasedBase = ( String ) db.getAliasIndex().reverseLookup( baseId );
DerefAliasesEnum mode = DerefAliasesEnum.getEnum( env );
-
// --------------------------------------------------------------------
// Determine the eective base with aliases
// --------------------------------------------------------------------
-
/*
* If the base is not an alias or if alias dereerencing does not
* occur on finding the base then we set the effective base to the
* given base.
*/
- if ( null == aliasedBase || ! mode.derefFindingBase() )
+ if ( null == aliasedBase || !mode.derefFindingBase() )
{
effectiveBase = base;
}
@@ -129,8 +124,7 @@
// Add the scope node using the eective base to the ilter
BranchNode root = new BranchNode( AbstractExprNode.AND );
- ExprNode node = new ScopeNode( env, effectiveBase.toString(),
- searchCtls.getSearchScope() );
+ ExprNode node = new ScopeNode( env, effectiveBase.toString(), searchCtls.getSearchScope() );
root.getChildren().add( node );
root.getChildren().add( filter );
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.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/DisjunctionEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java Sun Feb 19 19:57:02 2006
@@ -37,7 +37,7 @@
public class DisjunctionEnumeration implements NamingEnumeration
{
/** The underlying child enumerations */
- private final NamingEnumeration [] children;
+ private final NamingEnumeration[] children;
/** LUT used to avoid returning duplicates */
private final Map candidates = new HashMap();
/** Index of current cursor used */
@@ -53,7 +53,6 @@
// ------------------------------------------------------------------------
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
/**
* Creates a DisjunctionEnumeration over a set of child NamingEnumerations.
@@ -63,26 +62,25 @@
* @param children array of child NamingInstances
* @throws NamingException if something goes wrong
*/
- public DisjunctionEnumeration( NamingEnumeration [] children )
- throws NamingException
+ public DisjunctionEnumeration(NamingEnumeration[] children) throws NamingException
{
this.children = children;
// Close this cursor if their are no children.
- if ( children.length <= 0 )
+ if ( children.length <= 0 )
{
hasMore = false;
return;
}
// Advance to the first cursor that has a candidate for us.
- while ( ! children[index].hasMore() )
+ while ( !children[index].hasMore() )
{
index++;
// Close and return if we exhaust the cursors without finding a
// valid candidate to return.
- if ( index >= children.length )
+ if ( index >= children.length )
{
close();
return;
@@ -99,7 +97,6 @@
// ------------------------------------------------------------------------
// java.util.Enumeration Implementation Methods
// ------------------------------------------------------------------------
-
/**
* @see java.util.Enumeration#nextElement()
@@ -115,8 +112,8 @@
throw new NoSuchElementException();
}
}
-
-
+
+
/**
* @see java.util.Enumeration#hasMoreElements()
*/
@@ -124,12 +121,11 @@
{
return hasMore();
}
-
+
// ------------------------------------------------------------------------
// NamingEnumeration Method Implementations
// ------------------------------------------------------------------------
-
/**
* Advances this Cursor one position. Duplicates are not returned so if
@@ -145,18 +141,18 @@
// Store the last prefetched candidate to return in candidate
candidate.copy( prefetched );
- do
+ do
{
// Advance to a Cursor that has the next valid candidate for us.
- while ( ! children[index].hasMore() )
+ while ( !children[index].hasMore() )
{
index++;
-
+
/* Close and return existing prefetched candidate if we
* have exhausted the underlying Cursors without finding a
* valid candidate to return.
*/
- if ( index >= children.length )
+ if ( index >= children.length )
{
close();
return candidate;
@@ -169,7 +165,8 @@
// Break through do/while if the candidate is seen for the first
// time, meaning we have not returned it already.
- } while ( candidates.containsKey( prefetched.getEntryId() ) );
+ }
+ while ( candidates.containsKey( prefetched.getEntryId() ) );
// Add candidate to LUT of encountered candidates.
candidates.put( candidate.getEntryId(), candidate.getEntryId() );
@@ -201,8 +198,8 @@
{
Throwable throwable = null;
hasMore = false;
-
- for ( int ii = 0; ii < children.length; ii++ )
+
+ for ( int ii = 0; ii < children.length; ii++ )
{
try
{
@@ -215,7 +212,7 @@
throwable = t;
}
}
-
+
if ( null != throwable && throwable instanceof NamingException )
{
throw ( NamingException ) throwable;
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DisjunctionEnumeration.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/DupsEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DupsEnumeration.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DupsEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DupsEnumeration.java Sun Feb 19 19:57:02 2006
@@ -67,7 +67,6 @@
// Constructor
// ------------------------------------------------------------------------
-
/**
* Creates a DupsEnumeration over a enumeration of Tuples holding TreeSets
* for values that have the same key.
@@ -75,17 +74,17 @@
* @param list the underlying enumeration
* @throws NamingException if there is a problem
*/
- public DupsEnumeration( NoDupsEnumeration list ) throws NamingException
+ public DupsEnumeration(NoDupsEnumeration list) throws NamingException
{
underlying = list;
// Protect against closed cursors
- if ( ! underlying.hasMore() )
+ if ( !underlying.hasMore() )
{
close();
return;
}
-
+
prefetch();
}
@@ -94,7 +93,6 @@
// NamingEnumeration Interface Method Implementations
// ------------------------------------------------------------------------
-
/**
* Returns the same Tuple every time but with different key/value pairs.
*
@@ -109,8 +107,8 @@
return returned;
}
-
-
+
+
/**
* Returns the same Tuple every time but with different key/value pairs.
*
@@ -154,7 +152,7 @@
*
* @see javax.naming.NamingEnumeration#close()
*/
- public void close()
+ public void close()
{
hasMore = false;
underlying.close();
@@ -164,7 +162,6 @@
// ------------------------------------------------------------------------
// Private/Package Friendly Methods
// ------------------------------------------------------------------------
-
/**
* Prefetches values into the prefetched Tuple taking into account that
@@ -184,22 +181,22 @@
* If the iterator over the values of the current key is null or is
* extinguished then we need to advance to the next key.
*/
- while ( null == dupIterator || ! dupIterator.hasNext() )
+ while ( null == dupIterator || !dupIterator.hasNext() )
{
/*
* If the underlying enumeration has more elements we get the next
* key/TreeSet Tuple to work with and get an iterator over it.
*/
- if ( underlying.hasMore() )
+ if ( underlying.hasMore() )
{
duplicates = ( Tuple ) underlying.next();
TreeSet set = ( TreeSet ) duplicates.getValue();
- if ( underlying.doAscendingScan() )
+ if ( underlying.doAscendingScan() )
{
dupIterator = set.iterator();
- }
- else
+ }
+ else
{
/*
* Need to reverse the list and iterate over the reversed
@@ -208,14 +205,14 @@
* TODO This can be optimized by using a ReverseIterator
* over the array list. I don't think there is a way to
* do this on the TreeSet.
- */
+ */
ArrayList list = new ArrayList( set.size() );
list.addAll( set );
Collections.reverse( list );
dupIterator = list.iterator();
}
- }
- else
+ }
+ else
{
close();
return;
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DupsEnumeration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DupsEnumeration.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/Enumerator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Enumerator.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/Evaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Evaluator.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/ExpressionEnumerator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java Sun Feb 19 19:57:02 2006
@@ -58,17 +58,15 @@
* @param db database used by this enumerator
* @param evaluator
*/
- public ExpressionEnumerator( BTreeDirectoryPartition db,
- AttributeTypeRegistry attributeTypeRegistry,
- ExpressionEvaluator evaluator )
+ public ExpressionEnumerator(BTreeDirectoryPartition db, AttributeTypeRegistry attributeTypeRegistry,
+ ExpressionEvaluator evaluator)
{
this.db = db;
this.evaluator = evaluator;
LeafEvaluator leafEvaluator = evaluator.getLeafEvaluator();
scopeEnumerator = new ScopeEnumerator( db, leafEvaluator.getScopeEvaluator() );
- substringEnumerator = new SubstringEnumerator( db, attributeTypeRegistry,
- leafEvaluator.getSubstringEvaluator() );
+ substringEnumerator = new SubstringEnumerator( db, attributeTypeRegistry, leafEvaluator.getSubstringEvaluator() );
}
@@ -90,58 +88,56 @@
}
else if ( node instanceof AssertionNode )
{
- throw new IllegalArgumentException( "Cannot produce enumeration "
- + "on an AssertionNode" );
+ throw new IllegalArgumentException( "Cannot produce enumeration " + "on an AssertionNode" );
}
- else if ( node.isLeaf() )
+ else if ( node.isLeaf() )
{
LeafNode leaf = ( LeafNode ) node;
- switch( leaf.getAssertionType() )
+ switch ( leaf.getAssertionType() )
{
- case( LeafNode.APPROXIMATE ):
- list = enumEquality( ( SimpleNode ) node );
- break;
- case( LeafNode.EQUALITY ):
- list = enumEquality( ( SimpleNode ) node );
- break;
- case( LeafNode.EXTENSIBLE ):
- // N O T I M P L E M E N T E D Y E T !
- throw new NotImplementedException();
- case( LeafNode.GREATEREQ ):
- list = enumGreater( ( SimpleNode ) node, true );
- break;
- case( LeafNode.LESSEQ ):
- list = enumGreater( ( SimpleNode ) node, false );
- break;
- case( LeafNode.PRESENCE ):
- list = enumPresence( ( PresenceNode ) node );
- break;
- case( LeafNode.SUBSTRING ):
- list = substringEnumerator.enumerate( leaf );
- break;
- default:
- throw new IllegalArgumentException( "Unknown leaf assertion" );
+ case ( LeafNode.APPROXIMATE ):
+ list = enumEquality( ( SimpleNode ) node );
+ break;
+ case ( LeafNode.EQUALITY ):
+ list = enumEquality( ( SimpleNode ) node );
+ break;
+ case ( LeafNode.EXTENSIBLE ):
+ // N O T I M P L E M E N T E D Y E T !
+ throw new NotImplementedException();
+ case ( LeafNode.GREATEREQ ):
+ list = enumGreater( ( SimpleNode ) node, true );
+ break;
+ case ( LeafNode.LESSEQ ):
+ list = enumGreater( ( SimpleNode ) node, false );
+ break;
+ case ( LeafNode.PRESENCE ):
+ list = enumPresence( ( PresenceNode ) node );
+ break;
+ case ( LeafNode.SUBSTRING ):
+ list = substringEnumerator.enumerate( leaf );
+ break;
+ default:
+ throw new IllegalArgumentException( "Unknown leaf assertion" );
}
- }
- else
+ }
+ else
{
BranchNode branch = ( BranchNode ) node;
-
- switch( branch.getOperator() )
+
+ switch ( branch.getOperator() )
{
- case( BranchNode.AND ):
- list = enumConj( branch );
- break;
- case( BranchNode.NOT ):
- list = enumNeg( branch );
- break;
- case( BranchNode.OR ):
- list = enumDisj( branch );
- break;
- default:
- throw new IllegalArgumentException(
- "Unknown branch logical operator" );
+ case ( BranchNode.AND ):
+ list = enumConj( branch );
+ break;
+ case ( BranchNode.NOT ):
+ list = enumNeg( branch );
+ break;
+ case ( BranchNode.OR ):
+ list = enumDisj( branch );
+ break;
+ default:
+ throw new IllegalArgumentException( "Unknown branch logical operator" );
}
}
@@ -157,7 +153,7 @@
private NamingEnumeration enumDisj( BranchNode node ) throws NamingException
{
ArrayList children = node.getChildren();
- NamingEnumeration[] childEnumerations = new NamingEnumeration [children.size()];
+ NamingEnumeration[] childEnumerations = new NamingEnumeration[children.size()];
// Recursively create NamingEnumerations for each child expression node
for ( int ii = 0; ii < childEnumerations.length; ii++ )
@@ -194,7 +190,6 @@
childEnumeration = idx.listIndices();
}
-
IndexAssertion assertion = new IndexAssertion()
{
public boolean assertCandidate( IndexRecord rec ) throws NamingException
@@ -202,7 +197,7 @@
// NOTICE THE ! HERE
// The candidate is valid if it does not pass assertion. A
// candidate that passes assertion is therefore invalid.
- return ! evaluator.evaluate( node.getChild(), rec );
+ return !evaluator.evaluate( node.getChild(), rec );
}
};
@@ -256,7 +251,7 @@
{
continue;
}
- else if ( ! evaluator.evaluate( child, rec ) )
+ else if ( !evaluator.evaluate( child, rec ) )
{
return false;
}
@@ -282,18 +277,17 @@
* @return an enumeration over the index records matching the AVA
* @throws NamingException if there is a failure while accessing the db
*/
- private NamingEnumeration enumPresence( final PresenceNode node )
- throws NamingException
+ private NamingEnumeration enumPresence( final PresenceNode node ) throws NamingException
{
if ( db.hasUserIndexOn( node.getAttribute() ) )
{
Index idx = db.getExistanceIndex();
return idx.listIndices( node.getAttribute() );
}
-
+
return nonIndexedScan( node );
}
-
+
/**
* Returns an enumeration over candidates that satisfy a simple greater than
@@ -304,18 +298,17 @@
* @return an enumeration over the index records matching the AVA
* @throws NamingException if there is a failure while accessing the db
*/
- private NamingEnumeration enumGreater( final SimpleNode node,
- final boolean isGreater ) throws NamingException
+ private NamingEnumeration enumGreater( final SimpleNode node, final boolean isGreater ) throws NamingException
{
if ( db.hasUserIndexOn( node.getAttribute() ) )
{
Index idx = db.getUserIndex( node.getAttribute() );
-
+
if ( isGreater )
{
return idx.listIndices( node.getValue(), true );
}
- else
+ else
{
return idx.listIndices( node.getValue(), false );
}
@@ -323,8 +316,8 @@
return nonIndexedScan( node );
}
-
-
+
+
/**
* Returns an enumeration over candidates that satisfy a simple equality
* attribute value assertion.
@@ -333,8 +326,7 @@
* @return an enumeration over the index records matching the AVA
* @throws NamingException if there is a failure while accessing the db
*/
- private NamingEnumeration enumEquality( final SimpleNode node )
- throws NamingException
+ private NamingEnumeration enumEquality( final SimpleNode node ) throws NamingException
{
if ( db.hasUserIndexOn( node.getAttribute() ) )
{
@@ -344,8 +336,8 @@
return nonIndexedScan( node );
}
-
-
+
+
/**
* Creates a scan over all entries in the database with an assertion to test
* for the correct evaluation of a filter expression on a LeafNode.
@@ -354,19 +346,17 @@
* @return the enumeration over all perspective candidates satisfying expr
* @throws NamingException if db access failures result
*/
- private NamingEnumeration nonIndexedScan( final LeafNode node )
- throws NamingException
+ private NamingEnumeration nonIndexedScan( final LeafNode node ) throws NamingException
{
NamingEnumeration underlying = db.getNdnIndex().listIndices();
IndexAssertion assertion = new IndexAssertion()
{
- public boolean assertCandidate( IndexRecord record )
- throws NamingException
+ public boolean assertCandidate( IndexRecord record ) throws NamingException
{
return evaluator.getLeafEvaluator().evaluate( node, record );
}
};
-
+
return new IndexAssertionEnumeration( underlying, assertion );
}
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.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/ExpressionEvaluator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java Sun Feb 19 19:57:02 2006
@@ -43,14 +43,13 @@
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
/**
* Creates a top level Evaluator where leaves are delegated to a leaf node
* evaluator which is already provided.
*
* @param leafEvaluator handles leaf node evaluation.
*/
- public ExpressionEvaluator( LeafEvaluator leafEvaluator )
+ public ExpressionEvaluator(LeafEvaluator leafEvaluator)
{
this.leafEvaluator = leafEvaluator;
}
@@ -64,18 +63,15 @@
* @param oidRegistry the oid reg used for attrID to oid resolution
* @param attributeTypeRegistry the attribtype reg used for value comparison
*/
- public ExpressionEvaluator( BTreeDirectoryPartition db,
- OidRegistry oidRegistry,
- AttributeTypeRegistry attributeTypeRegistry )
+ public ExpressionEvaluator(BTreeDirectoryPartition db, OidRegistry oidRegistry,
+ AttributeTypeRegistry attributeTypeRegistry)
{
ScopeEvaluator scopeEvaluator = null;
SubstringEvaluator substringEvaluator = null;
scopeEvaluator = new ScopeEvaluator( db );
- substringEvaluator = new SubstringEvaluator( db, oidRegistry,
- attributeTypeRegistry );
- leafEvaluator = new LeafEvaluator( db, oidRegistry,
- attributeTypeRegistry, scopeEvaluator, substringEvaluator );
+ substringEvaluator = new SubstringEvaluator( db, oidRegistry, attributeTypeRegistry );
+ leafEvaluator = new LeafEvaluator( db, oidRegistry, attributeTypeRegistry, scopeEvaluator, substringEvaluator );
}
@@ -94,59 +90,56 @@
// Evaluator.evaluate() implementation
// ------------------------------------------------------------------------
-
/**
* @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
{
- if ( node.isLeaf() )
+ if ( node.isLeaf() )
{
return leafEvaluator.evaluate( node, record );
}
BranchNode bnode = ( BranchNode ) node;
- switch( bnode.getOperator() )
+ switch ( bnode.getOperator() )
{
- case( BranchNode.OR ):
- Iterator children = bnode.getChildren().iterator();
-
- while ( children.hasNext() )
- {
- ExprNode child = ( ExprNode ) children.next();
-
- if ( evaluate( child, record ) )
+ case ( BranchNode.OR ):
+ Iterator children = bnode.getChildren().iterator();
+
+ while ( children.hasNext() )
{
- return true;
+ ExprNode child = ( ExprNode ) children.next();
+
+ if ( evaluate( child, record ) )
+ {
+ return true;
+ }
}
- }
- return false;
- case( BranchNode.AND ):
- children = bnode.getChildren().iterator();
- while ( children.hasNext() )
- {
- ExprNode child = ( ExprNode ) children.next();
+ return false;
+ case ( BranchNode.AND ):
+ children = bnode.getChildren().iterator();
+ while ( children.hasNext() )
+ {
+ ExprNode child = ( ExprNode ) children.next();
+
+ if ( !evaluate( child, record ) )
+ {
+ return false;
+ }
+ }
- if ( ! evaluate( child, record ) )
+ return true;
+ case ( BranchNode.NOT ):
+ if ( null != bnode.getChild() )
{
- return false;
+ return !evaluate( bnode.getChild(), record );
}
- }
- return true;
- case( BranchNode.NOT ):
- if ( null != bnode.getChild() )
- {
- return ! evaluate( bnode.getChild(), record );
- }
-
- throw new NamingException( "Negation has no child: " + node );
- default:
- throw new NamingException( "Unrecognized branch node operator: "
- + bnode.getOperator() );
+ throw new NamingException( "Negation has no child: " + node );
+ default:
+ throw new NamingException( "Unrecognized branch node operator: " + bnode.getOperator() );
}
}
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.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/Index.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java Sun Feb 19 19:57:02 2006
@@ -42,6 +42,7 @@
*/
AttributeType getAttribute();
+
/**
* Gets the normalized value for an attribute.
*
@@ -51,6 +52,7 @@
*/
Object getNormalized( Object attrVal ) throws NamingException;
+
/**
* Gets the total scan count for this index.
*
@@ -59,6 +61,7 @@
*/
int count() throws NamingException;
+
/**
* Gets the scan count for the occurance of a specific attribute value
* within the index.
@@ -69,57 +72,74 @@
*/
int count( Object attrVal ) throws NamingException;
+
int count( Object attrVal, boolean isGreaterThan ) throws NamingException;
- BigInteger forwardLookup( Object attrVal ) throws NamingException;
+
+ BigInteger forwardLookup( Object attrVal ) throws NamingException;
+
Object reverseLookup( BigInteger id ) throws NamingException;
+
void add( Object attrVal, BigInteger id ) throws NamingException;
+
void add( Attribute attr, BigInteger id ) throws NamingException;
+
void add( Attributes attrs, BigInteger id ) throws NamingException;
+
void drop( BigInteger entryId ) throws NamingException;
+
void drop( Object attrVal, BigInteger id ) throws NamingException;
-
+
+
/**
* If the Attribute does not have any values then this reduces to a
* drop(BigInteger) call.
*/
void drop( Attribute attr, BigInteger id ) throws NamingException;
-
+
+
/**
* If the Attribute for this index within the Attributes does not have any
* values then this reduces to a drop(BigInteger) call.
*/
void drop( Attributes attrs, BigInteger id ) throws NamingException;
-
+
+
IndexEnumeration listReverseIndices( BigInteger id ) throws NamingException;
+
IndexEnumeration listIndices() throws NamingException;
+
IndexEnumeration listIndices( Object attrVal ) throws NamingException;
- IndexEnumeration listIndices( Object attrVal, boolean isGreaterThan )
- throws NamingException;
+
+ IndexEnumeration listIndices( Object attrVal, boolean isGreaterThan ) throws NamingException;
+
IndexEnumeration listIndices( Pattern regex ) throws NamingException;
- IndexEnumeration listIndices( Pattern regex, String prefix )
- throws NamingException;
- boolean hasValue( Object attrVal, BigInteger id )
- throws NamingException;
+ IndexEnumeration listIndices( Pattern regex, String prefix ) throws NamingException;
+
+
+ boolean hasValue( Object attrVal, BigInteger id ) throws NamingException;
+
+
+ boolean hasValue( Object attrVal, BigInteger id, boolean isGreaterThan ) throws NamingException;
- boolean hasValue( Object attrVal, BigInteger id, boolean isGreaterThan )
- throws NamingException;
boolean hasValue( Pattern regex, BigInteger id ) throws NamingException;
+
void close() throws NamingException;
+
void sync() throws NamingException;
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/Index.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/IndexAssertion.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java Sun Feb 19 19:57:02 2006
@@ -42,6 +42,5 @@
* @throws NamingException if their are failures while asserting the
* condition
*/
- boolean assertCandidate( IndexRecord record )
- throws NamingException;
+ boolean assertCandidate( IndexRecord record ) throws NamingException;
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertion.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/IndexAssertionEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java Sun Feb 19 19:57:02 2006
@@ -32,8 +32,7 @@
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class IndexAssertionEnumeration
- implements NamingEnumeration
+public class IndexAssertionEnumeration implements NamingEnumeration
{
/** The prefetched candidate */
private final IndexRecord prefetched = new IndexRecord();
@@ -55,9 +54,7 @@
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
- public IndexAssertionEnumeration( NamingEnumeration underlying,
- IndexAssertion assertion ) throws NamingException
+ public IndexAssertionEnumeration(NamingEnumeration underlying, IndexAssertion assertion) throws NamingException
{
this.underlying = underlying;
candidates = null;
@@ -67,8 +64,7 @@
}
- public IndexAssertionEnumeration( NamingEnumeration underlying,
- IndexAssertion assertion, boolean enableDupCheck )
+ public IndexAssertionEnumeration(NamingEnumeration underlying, IndexAssertion assertion, boolean enableDupCheck)
throws NamingException
{
this.underlying = underlying;
@@ -83,7 +79,6 @@
// Enumeration Method Implementations
// ------------------------------------------------------------------------
-
/**
* @see java.util.Enumeration#nextElement()
*/
@@ -92,14 +87,14 @@
try
{
return next();
- }
+ }
catch ( NamingException e )
{
throw new NoSuchElementException();
- }
+ }
}
-
-
+
+
/**
* @see java.util.Enumeration#hasMoreElements()
*/
@@ -107,13 +102,12 @@
{
return hasMore;
}
-
-
+
+
// ------------------------------------------------------------------------
// NamingEnumeration Method Implementations
// ------------------------------------------------------------------------
-
/**
* @see javax.naming.NamingEnumeration#next()
*/
@@ -124,7 +118,7 @@
return candidate;
}
-
+
/**
* @see javax.naming.NamingEnumeration#hasMore()
*/
@@ -133,7 +127,7 @@
return hasMore;
}
-
+
/**
* @see javax.naming.NamingEnumeration#close()
*/
@@ -148,7 +142,6 @@
// Private and Protected Methods
// ------------------------------------------------------------------------
-
private void prefetch() throws NamingException
{
IndexRecord rec = null;
@@ -156,24 +149,24 @@
/*
* Scan underlying Cursor until we arrive at the next valid candidate
* if the cursor is exhuasted we clean up after completing the loop
- */
- while ( underlying.hasMore() )
+ */
+ while ( underlying.hasMore() )
{
rec = ( IndexRecord ) underlying.next();
// If value is valid then we set it as the next candidate to return
if ( assertion.assertCandidate( rec ) )
{
- if ( checkDups )
+ if ( checkDups )
{
boolean dup = candidates.containsKey( rec.getEntryId() );
-
+
if ( dup )
{
/*
* Dup checking is on and candidate is a duplicate that
* has already been seen so we need to skip it.
- */
+ */
continue;
}
else
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexAssertionEnumeration.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/IndexComparator.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java Sun Feb 19 19:57:02 2006
@@ -31,16 +31,17 @@
{
private static final long serialVersionUID = 3257283621751633459L;
- private static final SerializableComparator BIG_INTEGER_COMPARATOR =
- new SerializableComparator( "1.2.6.1.4.1.18060.1.1.1.2.2" )
- {
- private static final long serialVersionUID = 3690478030414165816L;
+ private static final SerializableComparator BIG_INTEGER_COMPARATOR = new SerializableComparator(
+ "1.2.6.1.4.1.18060.1.1.1.2.2" )
+ {
+ private static final long serialVersionUID = 3690478030414165816L;
+
- public int compare( Object o1, Object o2 )
- {
- return BigIntegerComparator.INSTANCE.compare( o1, o2 );
- }
- };
+ public int compare( Object o1, Object o2 )
+ {
+ return BigIntegerComparator.INSTANCE.compare( o1, o2 );
+ }
+ };
/** Whether or not the key/value is swapped */
private final boolean isForwardMap;
/** The key comparison to use */
@@ -54,7 +55,7 @@
* @param isForwardMap whether or not the comparator should swap the
* key value pair while conducting comparisons.
*/
- public IndexComparator( SerializableComparator keyComp, boolean isForwardMap )
+ public IndexComparator(SerializableComparator keyComp, boolean isForwardMap)
{
this.keyComp = keyComp;
this.isForwardMap = isForwardMap;
@@ -69,7 +70,7 @@
*/
public SerializableComparator getKeyComparator()
{
- if ( isForwardMap )
+ if ( isForwardMap )
{
return keyComp;
}
@@ -86,7 +87,7 @@
*/
public SerializableComparator getValueComparator()
{
- if ( isForwardMap )
+ if ( isForwardMap )
{
return BIG_INTEGER_COMPARATOR;
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexComparator.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/IndexEnumeration.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java?rev=379013&r1=379012&r2=379013&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java (original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java Sun Feb 19 19:57:02 2006
@@ -23,14 +23,14 @@
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
+
/**
* A NamingEnumeration over an Index which returns IndexRecords.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$
*/
-public class IndexEnumeration
- implements NamingEnumeration
+public class IndexEnumeration implements NamingEnumeration
{
/** */
private final Pattern re;
@@ -53,29 +53,25 @@
// C O N S T R U C T O R S
// ------------------------------------------------------------------------
-
- public IndexEnumeration( NamingEnumeration list ) throws NamingException
+ public IndexEnumeration(NamingEnumeration list) throws NamingException
{
this( list, false, null );
}
- public IndexEnumeration( NamingEnumeration list, boolean swapKeyVal )
- throws NamingException
+ public IndexEnumeration(NamingEnumeration list, boolean swapKeyVal) throws NamingException
{
this( list, swapKeyVal, null );
}
- public IndexEnumeration( NamingEnumeration list, boolean swapKeyVal,
- Pattern regex )
- throws NamingException
+ public IndexEnumeration(NamingEnumeration list, boolean swapKeyVal, Pattern regex) throws NamingException
{
re = regex;
underlying = list;
this.swapKeyVal = swapKeyVal;
- if ( ! underlying.hasMore() )
+ if ( !underlying.hasMore() )
{
hasMore = false;
return;
@@ -89,19 +85,17 @@
// NamingEnumeration Interface Methods
// ------------------------------------------------------------------------
-
/**
* @see javax.naming.NamingEnumeration#next()
*/
- public Object next()
- throws NamingException
+ public Object next() throws NamingException
{
returned.copy( prefetched );
prefetch();
return returned;
}
-
-
+
+
/**
* @see java.util.Enumeration#nextElement()
*/
@@ -150,18 +144,17 @@
// Private Methods
// ------------------------------------------------------------------------
-
private void prefetch() throws NamingException
{
- while ( underlying.hasMore() )
+ while ( underlying.hasMore() )
{
Tuple tuple = ( Tuple ) underlying.next();
- if ( swapKeyVal )
+ if ( swapKeyVal )
{
tmp.setSwapped( tuple, null );
- }
- else
+ }
+ else
{
tmp.setTuple( tuple, null );
}
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexEnumeration.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