Examples of BaseEntryFilteringCursor


Examples of org.apache.directory.server.core.api.filtering.BaseEntryFilteringCursor

        // We let other mechanisms filter out operational attributes.
        // -----------------------------------------------------------
        if ( ( ids == null ) || ( ids.size() == 0 ) )
        {
            Entry rootDse = getRootDse( null );
            return new BaseEntryFilteringCursor( new SingletonCursor<Entry>( rootDse ), searchContext,
                directoryService.getSchemaManager() );
        }

        // -----------------------------------------------------------
        // Collect all the real attributes besides 1.1, +, and * and
        // note if we've seen these special attributes as well.
        // -----------------------------------------------------------

        Set<String> realIds = new HashSet<String>();
        boolean allUserAttributes = searchContext.isAllUserAttributes();
        boolean allOperationalAttributes = searchContext.isAllOperationalAttributes();
        boolean noAttribute = searchContext.isNoAttributes();

        for ( AttributeTypeOptions id : ids )
        {
            try
            {
                realIds.add( id.getAttributeType().getOid() );
            }
            catch ( Exception e )
            {
                realIds.add( id.getAttributeType().getName() );
            }
        }

        // return nothing
        if ( noAttribute )
        {
            Entry serverEntry = new DefaultEntry( schemaManager, Dn.ROOT_DSE );
            return new BaseEntryFilteringCursor( new SingletonCursor<Entry>( serverEntry ), searchContext,
                directoryService.getSchemaManager() );
        }

        // return everything
        if ( allUserAttributes && allOperationalAttributes )
        {
            Entry rootDse = getRootDse( null );
            return new BaseEntryFilteringCursor( new SingletonCursor<Entry>( rootDse ), searchContext,
                directoryService.getSchemaManager() );
        }

        Entry serverEntry = new DefaultEntry( schemaManager, Dn.ROOT_DSE );

        Entry rootDse = getRootDse( new GetRootDseOperationContext( searchContext.getSession() ) );

        for ( Attribute attribute : rootDse )
        {
            AttributeType type = schemaManager.lookupAttributeTypeRegistry( attribute.getUpId() );

            if ( realIds.contains( type.getOid() ) )
            {
                serverEntry.put( attribute );
            }
            else if ( allUserAttributes && ( type.getUsage() == UsageEnum.USER_APPLICATIONS ) )
            {
                serverEntry.put( attribute );
            }
            else if ( allOperationalAttributes && ( type.getUsage() != UsageEnum.USER_APPLICATIONS ) )
            {
                serverEntry.put( attribute );
            }
        }

        return new BaseEntryFilteringCursor( new SingletonCursor<Entry>( serverEntry ), searchContext,
            directoryService.getSchemaManager() );
    }
View Full Code Here

Examples of org.apache.directory.server.core.api.filtering.BaseEntryFilteringCursor

                return searchRootDse( searchContext );
            }
            else
            {
                // Nothing to return in this case
                return new BaseEntryFilteringCursor( new EmptyCursor<Entry>(), searchContext,
                    directoryService.getSchemaManager() );
            }
        }
        else if ( isOnelevelScope )
        {
View Full Code Here

Examples of org.apache.directory.server.core.api.filtering.BaseEntryFilteringCursor

    public EntryFilteringCursor search( SearchOperationContext searchContext ) throws LdapException
    {
        MockCursor cursor = new MockCursor( count );
        cursor.setSchemaManager( searchContext.getSession().getDirectoryService().getSchemaManager() );
        return new BaseEntryFilteringCursor( cursor, searchContext, cursor.schemaManager );
    }
View Full Code Here

Examples of org.apache.directory.server.core.filtering.BaseEntryFilteringCursor

            ( ( SearchOperationContext ) opContext ).setTypesOnlytypesOnly );
           
            if ( result )
            {
                ServerEntry emptyEntry = new DefaultServerEntry( service.getSchemaManager(), DN.EMPTY_DN );
                return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>( emptyEntry ), (SearchOperationContext)opContext );
            }
            else
            {
                return new BaseEntryFilteringCursor( new EmptyCursor<ServerEntry>(), (SearchOperationContext)opContext );
            }
        }
        else
        {
            // It's a Search
View Full Code Here

Examples of org.apache.directory.server.core.filtering.BaseEntryFilteringCursor

        // We let other mechanisms filter out operational attributes.
        // -----------------------------------------------------------
        if ( ( ids == null ) || ( ids.length == 0 ) )
        {
            ServerEntry rootDSE = (ServerEntry)getRootDSE( null ).clone();
            return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>( rootDSE ), searchOperationContext );
        }
       
        // -----------------------------------------------------------
        // Collect all the real attributes besides 1.1, +, and * and
        // note if we've seen these special attributes as well.
        // -----------------------------------------------------------

        Set<String> realIds = new HashSet<String>();
        boolean allUserAttributes = searchOperationContext.isAllUserAttributes();
        boolean allOperationalAttributes = searchOperationContext.isAllOperationalAttributes();
        boolean noAttribute = searchOperationContext.isNoAttributes();

        for ( String id:ids )
        {
            String idTrimmed = id.trim();
           
            try
            {
                realIds.add( schemaManager.getAttributeTypeRegistry().getOidByName( idTrimmed ) );
            }
            catch ( Exception e )
            {
                realIds.add( idTrimmed );
            }
        }

        // return nothing
        if ( noAttribute )
        {
            ServerEntry serverEntry = new DefaultServerEntry( schemaManager, DN.EMPTY_DN );
            return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>( serverEntry ), searchOperationContext );
        }
       
        // return everything
        if ( allUserAttributes && allOperationalAttributes )
        {
            ServerEntry rootDSE = (ServerEntry)getRootDSE( null ).clone();
            return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>( rootDSE ), searchOperationContext );
        }
       
        ServerEntry serverEntry = new DefaultServerEntry( schemaManager, DN.EMPTY_DN );
       
        ServerEntry rootDSE = getRootDSE( new GetRootDSEOperationContext( searchOperationContext.getSession() ) );
       
        for ( EntryAttribute attribute:rootDSE )
        {
            AttributeType type = schemaManager.lookupAttributeTypeRegistry( attribute.getUpId() );
           
            if ( realIds.contains( type.getOid() ) )
            {
                serverEntry.put( attribute );
            }
            else if ( allUserAttributes && ( type.getUsage() == UsageEnum.USER_APPLICATIONS ) )
            {
                serverEntry.put( attribute );
            }
            else if ( allOperationalAttributes && ( type.getUsage() != UsageEnum.USER_APPLICATIONS ) )
            {
                serverEntry.put( attribute );
            }
        }

        return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>( serverEntry ), searchOperationContext );
    }
View Full Code Here

Examples of org.apache.directory.server.core.filtering.BaseEntryFilteringCursor

            {
                return searchRootDSE( opContext );
            }
            else if ( isObjectScope && ( ! isSearchAll ) )
            {
                return new BaseEntryFilteringCursor( new EmptyCursor<ServerEntry>(), opContext );
            }
            else if( isOnelevelScope )
            {
                List<EntryFilteringCursor> cursors = new ArrayList<EntryFilteringCursor>();
                for ( Partition p : partitions.values() )
View Full Code Here

Examples of org.apache.directory.server.core.filtering.BaseEntryFilteringCursor

    public abstract void modify( ModifyOperationContext opContext ) throws Exception;


    public EntryFilteringCursor list( ListOperationContext opContext ) throws Exception
    {
        return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor<ID>( this, list( getEntryId( opContext
            .getDn().getNormName() ) ) ), opContext );
    }
View Full Code Here

Examples of org.apache.directory.server.core.filtering.BaseEntryFilteringCursor

        IndexCursor<ID, ServerEntry, ID> underlying;

        underlying = searchEngine.cursor( opContext.getDn(), opContext.getAliasDerefMode(), opContext.getFilter(),
            searchCtls );

        return new BaseEntryFilteringCursor( new ServerEntryCursorAdaptor<ID>( this, underlying ), opContext );
    }
View Full Code Here

Examples of org.apache.directory.server.core.filtering.BaseEntryFilteringCursor


    public EntryFilteringCursor search( SearchOperationContext opContext )
        throws NamingException
    {
        return new BaseEntryFilteringCursor( new MockCursor( count ), opContext );
    }
View Full Code Here

Examples of org.apache.directory.server.core.filtering.BaseEntryFilteringCursor

    }


    public EntryFilteringCursor search( SearchOperationContext opContext, Collection<String> bypass ) throws NamingException
    {
        return new BaseEntryFilteringCursor( new MockCursor( count ), opContext );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.