Package org.apache.directory.server.core.filtering

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


                return normalizerList;
            }

            LOG.debug( "{} schema: loading normalizers", schema.getSchemaName() );

            EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn ) );

            while ( list.next() )
            {
                ClonedServerEntry entry = list.get();

                normalizerList.add( entry );
            }
        }
View Full Code Here


                return objectClassList;
            }

            LOG.debug( "{} schema: loading objectClasses", schema.getSchemaName() );

            EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn ) );

            while ( list.next() )
            {
                ClonedServerEntry entry = list.get();

                objectClassList.add( entry );
            }
        }
View Full Code Here

                return syntaxList;
            }

            LOG.debug( "{} schema: loading syntaxes", schema.getSchemaName() );

            EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn ) );

            while ( list.next() )
            {
                ServerEntry entry = list.get();

                syntaxList.add( entry );
            }
        }
View Full Code Here

                return syntaxCheckerList;
            }

            LOG.debug( "{} schema: loading syntaxCsheckers", schema.getSchemaName() );

            EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn ) );

            while ( list.next() )
            {
                ServerEntry entry = list.get();

                syntaxCheckerList.add( entry );
            }
        }
View Full Code Here

        {
            PagedSearchContext oldContext = pagedSearchContexts.put( context.getCookieValue(), context );
           
            if ( oldContext != null )
            {
                EntryFilteringCursor cursor = oldContext.getCursor();
               
                if ( cursor != null )
                {
                    try
                    {
                        cursor.close();
                    }
                    catch ( Exception e )
                    {
                        LOG.error( I18n.err( I18n.ERR_172, e.getLocalizedMessage() ) );
                    }
View Full Code Here

     * @throws Exception if there are problems while searching the directory
     */
    public static ServerEntry findPrincipalEntry( CoreSession session, DN searchBaseDn, String principal )
        throws Exception
    {
        EntryFilteringCursor cursor = null;
       
        try
        {
            SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
            cursor = session.search( searchBaseDn, SearchScope.SUBTREE,
                getFilter( schemaManager, principal ), AliasDerefMode.DEREF_ALWAYS, null );
   
            cursor.beforeFirst();
            if ( cursor.next() )
            {
                ServerEntry entry = cursor.get();
                LOG.debug( "Found entry {} for kerberos principal name {}", entry, principal );
               
                while ( cursor.next() )
                {
                    LOG.error( I18n.err( I18n.ERR_149, principal, cursor.next() ) );
                }
               
                return entry;
            }
            else
            {
                LOG.warn( "No server entry found for kerberos principal name {}", principal );
                return null;
            }
        }
        finally
        {
            if ( cursor != null )
            {
                cursor.close();
            }
        }
    }
View Full Code Here

        searchCtx.setDn( dn );
        ExprNode filter = FilterParser.parse( "(ObjectClass=domain)" );
        searchCtx.setFilter( filter );
        searchCtx.setScope( SearchScope.SUBTREE );
       
        EntryFilteringCursor cursor = partition.search( searchCtx );
       
        assertNotNull( cursor );
       
        Set<String> expectedDns = new HashSet<String>();
        expectedDns.add( entry1.getDn().getNormName() );
        expectedDns.add( entry2.getDn().getNormName() );
        expectedDns.add( entry3.getDn().getNormName() );
       
        cursor.beforeFirst();
        int nbRes = 0;
       
        while ( cursor.next() )
        {
            Entry entry = cursor.get();
            assertNotNull( entry );
            nbRes++;
           
            expectedDns.remove( entry.getDn().getNormName() );
        }
View Full Code Here

            DN suffixDn = new DN( suffix );
            suffixDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
           
            SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffixDn, referralFilter, searchControl );
            searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
            EntryFilteringCursor cursor = nexus.search( searchOperationContext );
           
            // Move to the first entry in the cursor
            cursor.beforeFirst();
           
            while ( cursor.next() )
            {
                ServerEntry entry = cursor.get();

                // Lock the referralManager
                lockWrite();
               
                // Add it at the right place
View Full Code Here

        // We will store each entry's DN into the Referral tree
        SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffix,
            referralFilter, searchControl );
        searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
        EntryFilteringCursor cursor = nexus.search( searchOperationContext );
       
        // Move to the first entry in the cursor
        cursor.beforeFirst();
       
        while ( cursor.next() )
        {
            ServerEntry entry = cursor.get();
           
            // Add it at the right place
            removeReferral( entry );
        }
    }
View Full Code Here

     * @see org.apache.directory.server.core.schema.SchemaPartitionDao#getSchemas()
     */
    public Map<String, Schema> getSchemas() throws Exception
    {
        Map<String, Schema> schemas = new HashMap<String, Schema>();
        EntryFilteringCursor list = listSchemas();

        while ( list.next() )
        {
            ServerEntry sr = list.get();
            Schema schema = factory.getSchema( sr );
            schemas.put( schema.getSchemaName(), schema );
        }

        return schemas;
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.filtering.EntryFilteringCursor

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.