org.apache.directory.server.core.partition.impl.btree
Class ScopeEvaluator

java.lang.Object
  extended by org.apache.directory.server.core.partition.impl.btree.ScopeEvaluator
All Implemented Interfaces:
Evaluator

public class ScopeEvaluator
extends java.lang.Object
implements Evaluator

Evaluates ScopeNode assertions on candidates using a database.

Version:
$Rev: 434579 $
Author:
Apache Directory Project

Constructor Summary
ScopeEvaluator(BTreePartition db)
          Creates a scope node evaluator for search expressions.
 
Method Summary
 boolean assertOneLevelScope(org.apache.directory.shared.ldap.filter.ScopeNode node, java.math.BigInteger id)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 boolean assertSubtreeScope(org.apache.directory.shared.ldap.filter.ScopeNode node, java.math.BigInteger id)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 boolean evaluate(org.apache.directory.shared.ldap.filter.ExprNode node, IndexRecord record)
          Evaluates a candidate to determine if a filter expression selects it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScopeEvaluator

public ScopeEvaluator(BTreePartition db)
Creates a scope node evaluator for search expressions.

Parameters:
db - the database used to evaluate scope node
Method Detail

evaluate

public boolean evaluate(org.apache.directory.shared.ldap.filter.ExprNode node,
                        IndexRecord record)
                 throws javax.naming.NamingException
Description copied from interface: Evaluator
Evaluates a candidate to determine if a filter expression selects it.

Specified by:
evaluate in interface Evaluator
Parameters:
node - the filter expression to evaluate on the candidate
record - the index record of the entry to evaluate
Returns:
true if the filter selects the candidate false otherwise
Throws:
javax.naming.NamingException - if there is a database fault during evaluation
See Also:
Evaluator.evaluate(ExprNode, org.apache.directory.server.core.partition.impl.btree.IndexRecord)

assertSubtreeScope

public boolean assertSubtreeScope(org.apache.directory.shared.ldap.filter.ScopeNode node,
                                  java.math.BigInteger id)
                           throws javax.naming.NamingException
Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.

Parameters:
node - the scope node containing the base and alias handling mode
id - the candidate to assert which can be any db entry's id
Returns:
true if the candidate is within one level scope whether or not alias dereferencing is enabled.
Throws:
javax.naming.NamingException - if the index lookups fail.

assertOneLevelScope

public boolean assertOneLevelScope(org.apache.directory.shared.ldap.filter.ScopeNode node,
                                   java.math.BigInteger id)
                            throws javax.naming.NamingException
Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.

Parameters:
node - the scope node containing the base and alias handling mode
id - the candidate to assert which can be any db entry's id
Returns:
true if the candidate is within one level scope whether or not alias dereferencing is enabled.
Throws:
javax.naming.NamingException - if the index lookups fail.


Copyright © 2003-2010 Apache Software Foundation. All Rights Reserved.