Package org.apache.directory.shared.ldap.filter

Examples of org.apache.directory.shared.ldap.filter.ExprNode


        // - NOT

        if ( node instanceof NotNode )
        {
            // Manage the NOT
            ExprNode child = node.getFirstChild();

            ExprNode result = ( ExprNode ) visit( child );

            if ( result == null )
            {
                return null;
            }
            else if ( result instanceof BranchNode )
            {
                List<ExprNode> newChildren = new ArrayList<ExprNode>( 1 );
                newChildren.add( result );
                node.setChildren( newChildren );
                return node;
            }
            else if ( result instanceof LeafNode )
            {
                List<ExprNode> newChildren = new ArrayList<ExprNode>( 1 );
                newChildren.add( result );
                node.setChildren( newChildren );
                return node;
            }
        }
        else
        {
            // Manage AND and OR nodes.
            BranchNode branchNode = node;
            List<ExprNode> children = node.getChildren();

            // For AND and OR, we may have more than one children.
            // We may have to remove some of them, so let's create
            // a new handler to store the correct nodes.
            List<ExprNode> newChildren = new ArrayList<ExprNode>( children.size() );

            // Now, iterate through all the children
            for ( int i = 0; i < children.size(); i++ )
            {
                ExprNode child = children.get( i );

                ExprNode result = ( ExprNode ) visit( child );

                if ( result != null )
                {
                    // As the node is correct, add it to the children
                    // list.
View Full Code Here


        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
        String spUnitName = StoredProcUtils.extractStoredProcUnitName( fullSPName );
       
        AttributeType at = session.getDirectoryService()
            .getSchemaManager().lookupAttributeTypeRegistry( "storedProcUnitName" );
        ExprNode filter = new EqualityNode<String>( "storedProcUnitName", new StringValue( at, spUnitName ) );
        DN dn = new DN( storedProcContainer );
        EntryFilteringCursor results = session.search( dn, SearchScope.SUBTREE, filter,
            AliasDerefMode.DEREF_ALWAYS, EMPTY_ATTRIBS );
        if ( results.first() )
        {
View Full Code Here

     * {@inheritDoc}
     */
    public EntryFilteringCursor search( DN dn, String filter, boolean ignoreReferrals ) throws Exception
    {
        OperationManager operationManager = directoryService.getOperationManager();
        ExprNode filterNode = FilterParser.parse( filter );
       
        SearchOperationContext searchOperationContext = new SearchOperationContext( this, dn, SearchScope.OBJECT,
            filterNode, null );
        searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
        setReferralHandling( searchOperationContext, ignoreReferrals );
View Full Code Here

        Set<String> suffixes = nexus.listSuffixes( null );

        for ( String suffix:suffixes )
        {
            DN baseDn = parseNormalized( session.getDirectoryService().getSchemaManager(), suffix );
            ExprNode filter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
                new StringValue( SchemaConstants.ACCESS_CONTROL_SUBENTRY_OC ) );
            SearchControls ctls = new SearchControls();
            ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
           
            SearchOperationContext searchOperationContext = new SearchOperationContext( session,
View Full Code Here

        SearchOperationContext searchCtx = new SearchOperationContext( session );

        DN dn = new DN( "dc=test,ou=test,ou=system" );
        dn.normalize( schemaManager.getNormalizerMapping() );
        searchCtx.setDn( dn );
        ExprNode filter = FilterParser.parse( "(ObjectClass=domain)" );
        searchCtx.setFilter( filter );
        searchCtx.setScope( SearchScope.SUBTREE );
       
        EntryFilteringCursor cursor = partition.search( searchCtx );
       
View Full Code Here

        {
            LOG.debug( "Search attempt using filter '" + filter + "' " + "with scope '" + scope
                + "' and a return limit of '" + limit + "'" );
        }

        ExprNode root;

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

    }


    public boolean doAnnotate( String filter ) throws Exception
    {
        ExprNode root;

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

    /**
     * {@inheritDoc}
     */
    public void init( DirectoryService directoryService, String... suffixes ) throws Exception
    {
        ExprNode referralFilter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
            new StringValue( SchemaConstants.REFERRAL_OC ) );

        // Lookup for each entry with the ObjectClass = Referral value
        SearchControls searchControl = new SearchControls();
        searchControl.setReturningObjFlag( false );
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void remove( DirectoryService directoryService, DN suffix ) throws Exception
    {
        ExprNode referralFilter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
            new StringValue( SchemaConstants.REFERRAL_OC ) );

        // Lookup for each entry with the ObjectClass = Referral value
        SearchControls searchControl = new SearchControls();
        searchControl.setReturningObjFlag( false );
View Full Code Here

        Set<String> suffixes = nexus.listSuffixes( null );
       
        for ( String suffix:suffixes )
        {
            DN baseDn = new DN( suffix );
            ExprNode filter = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT,
                    new StringValue( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRY_OC ) );
            SearchControls ctls = new SearchControls();
            ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
           
            DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
View Full Code Here

TOP

Related Classes of org.apache.directory.shared.ldap.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.