Package org.apache.directory.server.xdbm.search.cursor

Examples of org.apache.directory.server.xdbm.search.cursor.ChildrenCursor


        IndexEntry<ParentIdAndRdn, String> startingPos = new IndexEntry<ParentIdAndRdn, String>();
        startingPos.setKey( new ParentIdAndRdn( node.getBaseId(), ( Rdn[] ) null ) );
        rdnCursor.before( startingPos );

        Cursor<IndexEntry<String, String>> scopeCursor = new ChildrenCursor( db, node.getBaseId(), rdnCursor );
        Set<String> candidateSet = searchResult.getCandidateSet();

        // Fetch all the UUIDs if we have an index
        // And loop on it
        while ( scopeCursor.next() )
        {
            IndexEntry<String, String> indexEntry = scopeCursor.get();

            String uuid = indexEntry.getId();

            // If the entry is an alias, and we asked for it to be dereferenced,
            // we will dereference the alias
            if ( searchResult.isDerefAlways() || searchResult.isDerefInSearching() )
            {
                Dn aliasedDn = db.getAliasIndex().reverseLookup( uuid );

                if ( aliasedDn != null )
                {
                    aliasedDn.apply( evaluatorBuilder.getSchemaManager() );
                    String aliasedId = db.getEntryId( aliasedDn );

                    // This is an alias. Add it to the set of candidates to process, if it's not already
                    // present in the candidate set
                    if ( !candidateSet.contains( aliasedId ) )
                    {
                        candidateSet.add( aliasedId );
                        nbResults++;
                    }
                }
                else
                {
                    // This is not an alias
                    if ( !candidateSet.contains( uuid ) )
                    {
                        // The UUID is not present in the Set, we add it
                        candidateSet.add( uuid );
                        nbResults++;
                    }
                }
            }
            else
            {
                if ( !candidateSet.contains( uuid ) )
                {
                    // The UUID is not present in the Set, we add it
                    candidateSet.add( uuid );
                    nbResults++;
                }
            }
        }

        scopeCursor.close();

        return nbResults;
    }
View Full Code Here


        IndexEntry<ParentIdAndRdn, String> startingPos = new IndexEntry<ParentIdAndRdn, String>();
        startingPos.setKey( new ParentIdAndRdn( node.getBaseId(), ( Rdn[] ) null ) );
        rdnCursor.before( startingPos );

        Cursor<IndexEntry<String, String>> scopeCursor = new ChildrenCursor( db, node.getBaseId(), rdnCursor );
        Set<String> candidateSet = searchResult.getCandidateSet();

        // Fetch all the UUIDs if we have an index
        // And loop on it
        while ( scopeCursor.next() )
        {
            IndexEntry<String, String> indexEntry = scopeCursor.get();

            String uuid = indexEntry.getId();

            // If the entry is an alias, and we asked for it to be dereferenced,
            // we will dereference the alias
            if ( searchResult.isDerefAlways() || searchResult.isDerefInSearching() )
            {
                Dn aliasedDn = db.getAliasIndex().reverseLookup( uuid );

                if ( aliasedDn != null )
                {
                    aliasedDn.apply( evaluatorBuilder.getSchemaManager() );
                    String aliasedId = db.getEntryId( aliasedDn );

                    // This is an alias. Add it to the set of candidates to process, if it's not already
                    // present in the candidate set
                    if ( !candidateSet.contains( aliasedId ) )
                    {
                        candidateSet.add( aliasedId );
                        nbResults++;
                    }
                }
                else
                {
                    // This is not an alias
                    if ( !candidateSet.contains( uuid ) )
                    {
                        // The UUID is not present in the Set, we add it
                        candidateSet.add( uuid );
                        nbResults++;
                    }
                }
            }
            else
            {
                if ( !candidateSet.contains( uuid ) )
                {
                    // The UUID is not present in the Set, we add it
                    candidateSet.add( uuid );
                    nbResults++;
                }
            }
        }

        scopeCursor.close();

        return nbResults;
    }
View Full Code Here

        IndexEntry<ParentIdAndRdn, String> startingPos = new IndexEntry<ParentIdAndRdn, String>();
        startingPos.setKey( new ParentIdAndRdn( node.getBaseId(), ( Rdn[] ) null ) );
        rdnCursor.before( startingPos );

        Cursor<IndexEntry<String, String>> scopeCursor = new ChildrenCursor( db, node.getBaseId(), rdnCursor );
        Set<String> candidateSet = searchResult.getCandidateSet();

        // Fetch all the UUIDs if we have an index
        // And loop on it
        while ( scopeCursor.next() )
        {
            IndexEntry<String, String> indexEntry = scopeCursor.get();

            String uuid = indexEntry.getId();

            // If the entry is an alias, and we asked for it to be dereferenced,
            // we will dereference the alias
            if ( searchResult.isDerefAlways() || searchResult.isDerefInSearching() )
            {
                Dn aliasedDn = db.getAliasIndex().reverseLookup( uuid );

                if ( aliasedDn != null )
                {
                    aliasedDn.apply( evaluatorBuilder.getSchemaManager() );
                    String aliasedId = db.getEntryId( aliasedDn );

                    // This is an alias. Add it to the set of candidates to process, if it's not already
                    // present in the candidate set
                    if ( !candidateSet.contains( aliasedId ) )
                    {
                        candidateSet.add( aliasedId );
                        nbResults++;
                    }
                }
                else
                {
                    // This is not an alias
                    if ( !candidateSet.contains( uuid ) )
                    {
                        // The UUID is not present in the Set, we add it
                        candidateSet.add( uuid );
                        nbResults++;
                    }
                }
            }
            else
            {
                if ( !candidateSet.contains( uuid ) )
                {
                    // The UUID is not present in the Set, we add it
                    candidateSet.add( uuid );
                    nbResults++;
                }
            }
        }

        scopeCursor.close();

        return nbResults;
    }
View Full Code Here

            dumpRdnIdx();

            PartitionSearchResult searchResult = new PartitionSearchResult( schemaManager );
            Set<IndexEntry<String, String>> resultSet = new HashSet<IndexEntry<String, String>>();

            Cursor<IndexEntry<String, String>> childrenCursor = new ChildrenCursor( this, id, cursor );

            return childrenCursor;
        }
        catch ( Exception e )
        {
View Full Code Here

            dumpRdnIdx();

            PartitionSearchResult searchResult = new PartitionSearchResult( schemaManager );
            Set<IndexEntry<String, String>> resultSet = new HashSet<IndexEntry<String, String>>();

            Cursor<IndexEntry<String, String>> childrenCursor = new ChildrenCursor( this, id, cursor );

            while ( childrenCursor.next() )
            {
                IndexEntry<String, String> element = childrenCursor.get();
                resultSet.add( element );
            }

            searchResult.setResultSet( resultSet );
            searchResult.setEvaluator( new PassThroughEvaluator( this ) );
View Full Code Here

        IndexEntry<ParentIdAndRdn, String> startingPos = new IndexEntry<ParentIdAndRdn, String>();
        startingPos.setKey( new ParentIdAndRdn( node.getBaseId(), ( Rdn[] ) null ) );
        rdnCursor.before( startingPos );

        Cursor<IndexEntry<String, String>> scopeCursor = new ChildrenCursor( db, node.getBaseId(), rdnCursor );
        Set<String> candidateSet = searchResult.getCandidateSet();

        // Fetch all the UUIDs if we have an index
        // And loop on it
        while ( scopeCursor.next() )
        {
            IndexEntry<String, String> indexEntry = scopeCursor.get();

            String uuid = indexEntry.getId();

            // If the entry is an alias, and we asked for it to be dereferenced,
            // we will dereference the alias
            if ( searchResult.isDerefAlways() || searchResult.isDerefInSearching() )
            {
                String aliasedDn = db.getAliasIndex().reverseLookup( uuid );

                if ( aliasedDn != null )
                {
                    String aliasedId = db.getEntryId( new Dn( searchResult.getSchemaManager(), aliasedDn ) );

                    // This is an alias. Add it to the set of candidates to process, if it's not already
                    // present in the candidate set
                    if ( !candidateSet.contains( aliasedId ) )
                    {
                        candidateSet.add( aliasedId );
                        nbResults++;
                    }
                }
                else
                {
                    // This is not an alias
                    if ( !candidateSet.contains( uuid ) )
                    {
                        // The UUID is not present in the Set, we add it
                        candidateSet.add( uuid );
                        nbResults++;
                    }
                }
            }
            else
            {
                if ( !candidateSet.contains( uuid ) )
                {
                    // The UUID is not present in the Set, we add it
                    candidateSet.add( uuid );
                    nbResults++;
                }
            }
        }

        scopeCursor.close();

        return nbResults;
    }
View Full Code Here

        IndexEntry<ParentIdAndRdn, String> startingPos = new IndexEntry<ParentIdAndRdn, String>();
        startingPos.setKey( new ParentIdAndRdn( node.getBaseId(), ( Rdn[] ) null ) );
        rdnCursor.before( startingPos );

        Cursor<IndexEntry<String, String>> scopeCursor = new ChildrenCursor( db, node.getBaseId(), rdnCursor );
        Set<String> candidateSet = searchResult.getCandidateSet();

        // Fetch all the UUIDs if we have an index
        // And loop on it
        while ( scopeCursor.next() )
        {
            IndexEntry<String, String> indexEntry = scopeCursor.get();

            String uuid = indexEntry.getId();

            // If the entry is an alias, and we asked for it to be dereferenced,
            // we will dereference the alias
            if ( searchResult.isDerefAlways() || searchResult.isDerefInSearching() )
            {
                String aliasedDn = db.getAliasIndex().reverseLookup( uuid );

                if ( aliasedDn != null )
                {
                    String aliasedId = db.getEntryId( new Dn( searchResult.getSchemaManager(), aliasedDn ) );

                    // This is an alias. Add it to the set of candidates to process, if it's not already
                    // present in the candidate set
                    if ( !candidateSet.contains( aliasedId ) )
                    {
                        candidateSet.add( aliasedId );
                        nbResults++;
                    }
                }
                else
                {
                    // This is not an alias
                    if ( !candidateSet.contains( uuid ) )
                    {
                        // The UUID is not present in the Set, we add it
                        candidateSet.add( uuid );
                        nbResults++;
                    }
                }
            }
            else
            {
                if ( !candidateSet.contains( uuid ) )
                {
                    // The UUID is not present in the Set, we add it
                    candidateSet.add( uuid );
                    nbResults++;
                }
            }
        }

        scopeCursor.close();

        return nbResults;
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.xdbm.search.cursor.ChildrenCursor

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.