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

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

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

Evaluates one level scope assertions on candidates using an entry database.

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

Constructor Summary
OneLevelScopeEvaluator(Store<E,ID> db, org.apache.directory.shared.ldap.filter.ScopeNode node)
          Creates a one level 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 candidate)
          Asserts whether or not a candidate has one level scope while taking alias dereferencing into account.
 ID getBaseId()
          Gets the id of the search base associated with the ScopeNode expression.
 org.apache.directory.shared.ldap.filter.ScopeNode getExpression()
          Gets the expression used by this expression Evaluator.
 boolean isDereferencing()
          Gets whether or not dereferencing is enabled for this evaluator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneLevelScopeEvaluator

public OneLevelScopeEvaluator(Store<E,ID> db,
                              org.apache.directory.shared.ldap.filter.ScopeNode node)
                       throws java.lang.Exception
Creates a one level 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

evaluateId

public boolean evaluateId(ID candidate)
                   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:
candidate - the candidate to assert
Returns:
true if the candidate is within one level scope
Throws:
java.lang.Exception - if db lookups fail
See Also:
Evaluator.evaluate(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. TODO - terribly inefficient - would benefit from exposing the id of an entry within the ServerEntry

Specified by:
evaluateEntry in interface Evaluator<org.apache.directory.shared.ldap.filter.ScopeNode,E,ID>
Parameters:
candidate - the candidate entry
Returns:
true if filter selects the candidate false otherwise
Throws:
java.lang.Exception - if there are faults during evaluation
See Also:
Evaluator#evaluate(Object)

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 candidate to assert
Returns:
true if the candidate is within one level scope
Throws:
java.lang.Exception - if db lookups fail
See Also:
Evaluator.evaluate(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()
Gets the id of the search base associated with the ScopeNode expression.

Returns:
identifier of the search base

isDereferencing

public boolean isDereferencing()
Gets whether or not dereferencing is enabled for this evaluator.

Returns:
true if dereferencing is enabled, false otherwise


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