Package org.apache.ldap.common.filter

Examples of org.apache.ldap.common.filter.ExprNode


        ArrayList children = node.getChildren();
        BigInteger total = BigInteger.ZERO;
       
        for ( int ii = 0; ii < children.size(); ii++ )
        {
            ExprNode child = ( ExprNode ) children.get( ii );
            annotate( child );
            total = total.add( ( BigInteger ) child.get( "count" ) );
        }

        return total;   
    }
View Full Code Here


     *      java.lang.String, javax.naming.directory.SearchControls)
     */
    public NamingEnumeration search( Name name, String filter, SearchControls cons )
            throws NamingException
    {
        ExprNode filterNode = null;

        LdapName target = buildTarget( name );

        if ( filter == null && getEnvironment().containsKey( "__filter__" ) )
        {
View Full Code Here

         * expression.
         */
        final ArrayList children = node.getChildren();
        for ( int ii = 0; ii < children.size(); ii++ )
        {
            ExprNode child = ( ExprNode ) children.get( ii );
            value = ( ( BigInteger ) child.get( "count" ) ).intValue();
            minValue = Math.min( minValue, value );

            if ( minValue == value )
            {
                minIndex = ii;
            }
        }

        // Once found we build the child enumeration & the wrapping enum
        final ExprNode minChild = ( ExprNode ) children.get( minIndex );
        IndexAssertion assertion = new IndexAssertion()
        {
            public boolean assertCandidate( IndexRecord rec ) throws NamingException
            {
                for ( int ii = 0; ii < children.size(); ii++ )
                {
                    ExprNode child = ( ExprNode ) children.get( ii );

                    // Skip the child (with min scan count) chosen for enum
                    if ( child == minChild )
                    {
                        continue;
View Full Code Here

            effectiveBase = base;
        }

        // Add the scope node using the eective base to the ilter
        BranchNode root = new BranchNode( AbstractExprNode.AND );
        ExprNode node = new ScopeNode( env, effectiveBase.toString(),
            searchCtls.getSearchScope() );
        root.getChildren().add( node );
        root.getChildren().add( filter );

        // Annotate the node with the optimizer and return search enumeration.
View Full Code Here

        BigInteger count = BigInteger.valueOf( Integer.MAX_VALUE )
        ArrayList children = node.getChildren();
       
        for ( int ii = 0; ii < children.size(); ii++ )
        {
            ExprNode child = ( ExprNode ) children.get( ii );
            annotate( child );
            count = ( ( BigInteger ) child.get( "count" ) ).min( count );
        }

        return count;   
    }
View Full Code Here

     * @return the scan count
     * @throws NamingException if there is an error
     */
    private BigInteger getNegationScan( BranchNode node ) throws NamingException
    {
        ExprNode onlyChild = ( ExprNode ) node.getChildren().get( 0 );
       
        annotate( onlyChild );

        if ( onlyChild.isLeaf()
            && ! ( onlyChild instanceof ScopeNode )
            && ! ( onlyChild instanceof AssertionNode
            && ! ( onlyChild instanceof PresenceNode ) )
        {
            LeafNode leaf = ( LeafNode ) onlyChild;
View Full Code Here

        ArrayList children = node.getChildren();
        BigInteger total = BigInteger.ZERO;
       
        for ( int ii = 0; ii < children.size(); ii++ )
        {
            ExprNode child = ( ExprNode ) children.get( ii );
            annotate( child );
            total = total.add( ( BigInteger ) child.get( "count" ) );
        }

        return total;   
    }
View Full Code Here

        case( BranchNode.OR ):
            Iterator children = bnode.getChildren().iterator();
           
            while ( children.hasNext() )
            {
                ExprNode child = ( ExprNode ) children.next();
               
                if ( evaluate( child, record ) )
                {
                    return true;
                }
            }

            return false;
        case( BranchNode.AND ):
            children = bnode.getChildren().iterator();
            while ( children.hasNext() )
            {
                ExprNode child = ( ExprNode ) children.next();

                if ( ! evaluate( child, record ) )
                {
                    return false;
                }
View Full Code Here

            BranchNode branch = ( BranchNode ) exprNode;
            ArrayList exprNodes = branch.getChildren();
            for ( int ii = 0; ii < exprNodes.size(); ii++ )
            {
                ExprNode child = ( ExprNode ) exprNodes.get(ii);
                children.add( new ASTNode( this, child ) );
            }
        }
        catch( Exception e )
        {
View Full Code Here

            + "with scope '" + scope + "' and a return limit of '" + limit
            + "'" );
        }

        FilterParser parser = new FilterParserImpl();
        ExprNode root = null;

        try
        {
            root = parser.parse( filter );
        }
View Full Code Here

TOP

Related Classes of org.apache.ldap.common.filter.ExprNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.