org.apache.directory.server.xdbm.search.impl
Class OneLevelScopeEvaluator<E,ID extends Comparable<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.model.filter.ScopeNode,E,ID>

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

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

Author:
Apache Directory Project

Constructor Summary
OneLevelScopeEvaluator(Store<E,ID> db, org.apache.directory.shared.ldap.model.filter.ScopeNode node)
          Creates a one level scope node Evaluator for search expressions.
 
Method Summary
 boolean evaluate(IndexEntry<?,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.model.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.model.filter.ScopeNode node)
                       throws 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:
Exception - on db access failure
Method Detail

evaluateId

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

Parameters:
candidate - the candidate to assert
Returns:
true if the candidate is within one level scope
Throws:
Exception - if db lookups fail
See Also:
Evaluator.evaluate(IndexEntry)

evaluateEntry

public boolean evaluateEntry(E candidate)
                      throws 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 Entry Evaluates whether or not a candidate, satisfies the expression associated with this Evaluator .

Specified by:
evaluateEntry in interface Evaluator<org.apache.directory.shared.ldap.model.filter.ScopeNode,E,ID extends Comparable<ID>>
Parameters:
candidate - the candidate entry
Returns:
true if filter selects the candidate false otherwise
Throws:
Exception - if there are faults during evaluation

evaluate

public boolean evaluate(IndexEntry<?,ID> candidate)
                 throws 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.model.filter.ScopeNode,E,ID extends Comparable<ID>>
Parameters:
candidate - the candidate to assert
Returns:
true if the candidate is within one level scope
Throws:
Exception - if db lookups fail
See Also:
Evaluator.evaluate(IndexEntry)

getExpression

public org.apache.directory.shared.ldap.model.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.model.filter.ScopeNode,E,ID extends Comparable<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-2012 The Apache Software Foundation. All Rights Reserved.