Package org.apache.ldap.common.filter

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


    // ------------------------------------------------------------------------


    public void addNamingListener( Name name, int scope, NamingListener namingListener ) throws NamingException
    {
        ExprNode filter = new PresenceNode( "objectClass" );
        SearchControls controls = new SearchControls();
        controls.setSearchScope( scope );
        ( ( DirectoryPartitionNexusProxy ) this.nexusProxy )
                .addNamingListener( this, buildTarget( name ), filter, controls, namingListener );
        listeners.add( namingListener );
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

         * 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

        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

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

        LdapName target = buildTarget( name );

        try
        {
View Full Code Here

    public void addNamingListener( Name name, String filterStr, SearchControls searchControls,
                                   NamingListener namingListener )
            throws NamingException
    {
        ExprNode filter;

        try
        {
            filter = filterParser.parse( filterStr );
        }
View Full Code Here

        Iterator suffixes = nexus.listSuffixes( true );
        while ( suffixes.hasNext() )
        {
            String suffix = ( String ) suffixes.next();
            Name baseDn = new LdapName( suffix );
            ExprNode filter = new SimpleNode( OC_ATTR, ACSUBENTRY_OC, SimpleNode.EQUALITY );
            SearchControls ctls = new SearchControls();
            ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
            NamingEnumeration results = nexus.search( baseDn, env, filter, ctls );
            while ( results.hasMore() )
            {
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.