in xdbm-partition/src/main/java/org/apache/directory/server/xdbm/search/impl/CursorBuilder.java [96:167]
public <T> long build( PartitionTxn partitionTxn, ExprNode node, PartitionSearchResult searchResult ) throws LdapException
{
Object count = node.get( DefaultOptimizer.COUNT_ANNOTATION );
if ( ( count != null ) && ( ( Long ) count ) == 0L )
{
return 0;
}
try
{
switch ( node.getAssertionType() )
{
/* ---------- LEAF NODE HANDLING ---------- */
case APPROXIMATE:
return computeApproximate( partitionTxn, ( ApproximateNode<T> ) node, searchResult );
case EQUALITY:
return computeEquality( partitionTxn, ( EqualityNode<T> ) node, searchResult );
case GREATEREQ:
return computeGreaterEq( partitionTxn, ( GreaterEqNode<T> ) node, searchResult );
case LESSEQ:
return computeLessEq( partitionTxn, ( LessEqNode<T> ) node, searchResult );
case PRESENCE:
return computePresence( partitionTxn, ( PresenceNode ) node, searchResult );
case SCOPE:
if ( ( ( ScopeNode ) node ).getScope() == SearchScope.ONELEVEL )
{
return computeOneLevelScope( partitionTxn, ( ScopeNode ) node, searchResult );
}
else
{
return computeSubLevelScope( partitionTxn, ( ScopeNode ) node, searchResult );
}
case SUBSTRING:
return computeSubstring( partitionTxn, ( SubstringNode ) node, searchResult );
/* ---------- LOGICAL OPERATORS ---------- */
case AND:
return computeAnd( partitionTxn, ( AndNode ) node, searchResult );
case NOT:
// Always return infinite, except if the resulting eva
return computeNot( ( NotNode ) node, searchResult );
case OR:
return computeOr( partitionTxn, ( OrNode ) node, searchResult );
/* ---------- NOT IMPLEMENTED ---------- */
case UNDEFINED:
return Long.MAX_VALUE;
case ASSERTION:
case EXTENSIBLE:
throw new NotImplementedException();
default:
throw new IllegalStateException( I18n.err( I18n.ERR_49026_UNKNOWN_ASSERTION_TYPE, node.getAssertionType() ) );
}
}
catch ( IndexNotFoundException | CursorException | IOException e )
{
throw new LdapOtherException( e.getMessage(), e );
}
}