org.apache.directory.server.xdbm.search.impl
Class SubtreeScopeEvaluator<E,ID>

java.lang.Object
  extended by org.apache.directory.server.xdbm.search.impl.SubtreeScopeEvaluator<E,ID>
All Implemented Interfaces:
Evaluator<org.apache.directory.shared.ldap.filter.ScopeNode,E,ID>

public class SubtreeScopeEvaluator<E,ID>
extends java.lang.Object
implements Evaluator<org.apache.directory.shared.ldap.filter.ScopeNode,E,ID>

Evaluates ScopeNode assertions with subtree scope on candidates using an entry database.

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

Constructor Summary
SubtreeScopeEvaluator(Store<E,ID> db, org.apache.directory.shared.ldap.filter.ScopeNode node)
          Creates a subtree scope node evaluator for search expressions.
 
Method Summary
 boolean evaluate(IndexEntry<?,E,ID> candidate)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 boolean evaluateEntry(E candidate)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 boolean evaluateId(ID id)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 ID getBaseId()
           
 org.apache.directory.shared.ldap.filter.ScopeNode getExpression()
          Gets the expression used by this expression Evaluator.
 boolean isDereferencing()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubtreeScopeEvaluator

public SubtreeScopeEvaluator(Store<E,ID> db,
                             org.apache.directory.shared.ldap.filter.ScopeNode node)
                      throws java.lang.Exception
Creates a subtree scope node evaluator for search expressions.

Parameters:
node - the scope node
db - the database used to evaluate scope node
Throws:
java.lang.Exception - on db access failure
Method Detail

evaluate

public boolean evaluate(IndexEntry<?,E,ID> candidate)
                 throws java.lang.Exception
Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.

Specified by:
evaluate in interface Evaluator<org.apache.directory.shared.ldap.filter.ScopeNode,E,ID>
Parameters:
candidate - the entry tested to see if it is in subtree scope
Returns:
true if the candidate is within one level scope whether or not alias dereferencing is enabled.
Throws:
java.lang.Exception - if the index lookups fail.
See Also:
Evaluator.evaluate(org.apache.directory.server.xdbm.IndexEntry)

evaluateId

public boolean evaluateId(ID id)
                   throws java.lang.Exception
Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.

Specified by:
evaluateId in interface Evaluator<org.apache.directory.shared.ldap.filter.ScopeNode,E,ID>
Parameters:
id - the id of the entry tested to see if it is in subtree scope
Returns:
true if the candidate is within one level scope whether or not alias dereferencing is enabled.
Throws:
java.lang.Exception - if the index lookups fail.
See Also:
Evaluator.evaluate(org.apache.directory.server.xdbm.IndexEntry)

evaluateEntry

public boolean evaluateEntry(E candidate)
                      throws java.lang.Exception
Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.

Specified by:
evaluateEntry in interface Evaluator<org.apache.directory.shared.ldap.filter.ScopeNode,E,ID>
Parameters:
candidate - the entry tested to see if it is in subtree scope
Returns:
true if the candidate is within one level scope whether or not alias dereferencing is enabled.
Throws:
java.lang.Exception - if the index lookups fail.
See Also:
Evaluator.evaluate(org.apache.directory.server.xdbm.IndexEntry)

getExpression

public org.apache.directory.shared.ldap.filter.ScopeNode getExpression()
Description copied from interface: Evaluator
Gets the expression used by this expression Evaluator.

Specified by:
getExpression in interface Evaluator<org.apache.directory.shared.ldap.filter.ScopeNode,E,ID>
Returns:
the AST for the expression

getBaseId

public ID getBaseId()

isDereferencing

public boolean isDereferencing()


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