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

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

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

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

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

Constructor Summary
SubtreeScopeEvaluator(Store<E> db, org.apache.directory.shared.ldap.filter.ScopeNode node)
          Creates a subtree scope node evaluator for search expressions.
 
Method Summary
 boolean evaluate(E candidate)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 boolean evaluate(IndexEntry<?,E> candidate)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 boolean evaluate(java.lang.Long id)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 java.lang.Long 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> 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> 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>
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)

evaluate

public boolean evaluate(java.lang.Long id)
                 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>
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)

evaluate

public boolean evaluate(E 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>
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>
Returns:
the AST for the expression

getBaseId

public java.lang.Long getBaseId()

isDereferencing

public boolean isDereferencing()


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