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

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


        Cursor<IndexEntry<ParentIdAndRdn, String>> cursor = new SingletonIndexCursor<ParentIdAndRdn>(
            indexEntry );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( this, baseId, parentId, cursor );

        // Then, if there are some children, move then to the new place
        try
        {
            while ( scopeCursor.next() )
            {
                IndexEntry<String, String> entry = scopeCursor.get();

                // except the parent entry add the rest of entries
                if ( entry.getId() != entryIdOld )
                {
                    addEntry( fetch( entry.getId() ) );
                }
            }

            scopeCursor.close();
        }
        catch ( Exception e )
        {
            throw new LdapOperationException( e.getMessage(), e );
        }
View Full Code Here


        Cursor<IndexEntry<ParentIdAndRdn, String>> rdnCursor = new SingletonIndexCursor<ParentIdAndRdn>(
            startingPos );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( db, baseId, parentId, 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++;

                        ScopeNode newScopeNode = new ScopeNode(
                            node.getDerefAliases(),
                            aliasedDn,
                            aliasedId,
                            node.getScope() );

                        nbResults += computeSubLevelScope( newScopeNode, searchResult );
                    }
                }
                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

        Cursor<IndexEntry<ParentIdAndRdn, String>> rdnCursor = new SingletonIndexCursor<ParentIdAndRdn>(
            startingPos );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( db, baseId, parentId, 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++;

                        ScopeNode newScopeNode = new ScopeNode(
                            node.getDerefAliases(),
                            aliasedDn,
                            aliasedId,
                            node.getScope() );

                        nbResults += computeSubLevelScope( newScopeNode, searchResult );
                    }
                }
                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

        Cursor<IndexEntry<ParentIdAndRdn, String>> rdnCursor = new SingletonIndexCursor<ParentIdAndRdn>(
            startingPos );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( db, baseId, parentId, 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++;

                        ScopeNode newScopeNode = new ScopeNode(
                            node.getDerefAliases(),
                            aliasedDn,
                            aliasedId,
                            node.getScope() );

                        nbResults += computeSubLevelScope( newScopeNode, searchResult );
                    }
                }
                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

        Cursor<IndexEntry<ParentIdAndRdn, String>> rdnCursor = new SingletonIndexCursor<ParentIdAndRdn>(
            startingPos );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( db, baseId, parentId, 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++;

                        ScopeNode newScopeNode = new ScopeNode(
                            node.getDerefAliases(),
                            new Dn( searchResult.getSchemaManager(), aliasedDn ),
                            aliasedId,
                            node.getScope() );

                        nbResults += computeSubLevelScope( newScopeNode, searchResult );
                    }
                }
                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

        Cursor<IndexEntry<ParentIdAndRdn, String>> cursor = new SingletonIndexCursor<ParentIdAndRdn>(
            indexEntry );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( this, baseId, parentId, cursor );

        // Then, if there are some children, move then to the new place
        try
        {
            while ( scopeCursor.next() )
            {
                IndexEntry<String, String> entry = scopeCursor.get();

                // except the parent entry add the rest of entries
                if ( entry.getId() != entryIdOld )
                {
                    addEntry( lookup( entry.getId() ) );
                }
            }

            scopeCursor.close();
        }
        catch ( Exception e )
        {
            throw new LdapOperationException( e.getMessage(), e );
        }
View Full Code Here

        Cursor<IndexEntry<ParentIdAndRdn, String>> cursor = new SingletonIndexCursor<ParentIdAndRdn>(
            indexEntry );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( this, baseId, parentId, cursor );

        // Then, if there are some children, move then to the new place
        try
        {
            while ( scopeCursor.next() )
            {
                IndexEntry<String, String> entry = scopeCursor.get();

                // except the parent entry add the rest of entries
                if ( entry.getId() != entryIdOld )
                {
                    addEntry( fetch( entry.getId() ) );
                }
            }

            scopeCursor.close();
        }
        catch ( Exception e )
        {
            throw new LdapOperationException( e.getMessage(), e );
        }
View Full Code Here

        Cursor<IndexEntry<ParentIdAndRdn, String>> rdnCursor = new SingletonIndexCursor<ParentIdAndRdn>(
            startingPos );
        String parentId = parentIdAndRdn.getParentId();

        Cursor<IndexEntry<String, String>> scopeCursor = new DescendantCursor( db, baseId, parentId, 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++;

                        ScopeNode newScopeNode = new ScopeNode(
                            node.getDerefAliases(),
                            new Dn( searchResult.getSchemaManager(), aliasedDn ),
                            aliasedId,
                            node.getScope() );

                        nbResults += computeSubLevelScope( newScopeNode, searchResult );
                    }
                }
                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.DescendantCursor

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.