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

Examples of org.apache.directory.server.core.api.filtering.EntryFilteringCursor.beforeFirst()


        ExprNode filter = new PresenceNode( SchemaConstants.OBJECT_CLASS_AT );

        EntryFilteringCursor cursor = session.search( partition.getSuffixDn(), SearchScope.SUBTREE, filter,
            AliasDerefMode.NEVER_DEREF_ALIASES, MANDATORY_ENTRY_ATOP_AT );
        cursor.beforeFirst();

        List<Modification> mods = new ArrayList<Modification>();

        while ( cursor.next() )
        {
View Full Code Here


        {
            // No cursor : do a search.
            cursor = session.getCoreSession().search( req );

            // Position the cursor at the beginning
            cursor.beforeFirst();

            // This is a new search. We have a special case when the paged size
            // is above the server size limit : in this case, we default to a
            // standard search
            if ( pagedLimit > sizeLimit )
View Full Code Here

        // Check that we have a cursor or not.
        // No cursor : do a search.
        EntryFilteringCursor cursor = session.getCoreSession().search( req );

        // Position the cursor at the beginning
        cursor.beforeFirst();

        /*
         * Iterate through all search results building and sending back responses
         * for each search result returned.
         */
 
View Full Code Here

            SearchOperationContext searchContext = new SearchOperationContext( deleteContext.getSession(),
                searchRequest );

            EntryFilteringCursor cursor = wrapped.search( searchContext );

            cursor.beforeFirst();
            int nbEntry = 0;

            while ( cursor.next() && ( nbEntry < 2 ) )
            {
                nbEntry++;
View Full Code Here

            int newId = messageId.incrementAndGet();

            searchRequest.setMessageId( newId );

            EntryFilteringCursor entryCursor = session.search( searchRequest );
            entryCursor.beforeFirst();

            //TODO enforce the size and time limits, similar in the way SearchHandler does
            return new EntryToResponseCursor( newId, entryCursor );
        }
        catch ( Exception e )
View Full Code Here

        {
            SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
            cursor = session.search( searchBaseDn, SearchScope.SUBTREE,
                getFilter( schemaManager, principal ), AliasDerefMode.DEREF_ALWAYS, "*" );

            cursor.beforeFirst();

            if ( cursor.next() )
            {
                Entry entry = cursor.get();
                LOG.debug( "Found entry {} for kerberos principal name {}", entry.getDn(), principal );
View Full Code Here

                .search( base, scope, exprNode, aliasDerefMode );

            // advancing the cursor forward and backward must give the same result
            for ( int count = 1; count < 20; count++ )
            {
                cursor.beforeFirst();

                List<String> nextResults = new ArrayList<String>();

                while ( nextResults.size() < count && cursor.next() )
                {
View Full Code Here

        List<String> nextResults = new ArrayList<String>();

        ExprNode exprNode = FilterParser.parse( getService().getSchemaManager(), filter );
        EntryFilteringCursor cursor = getService().getAdminSession().search( new Dn( base ), scope, exprNode,
            aliasDerefMode );
        cursor.beforeFirst();

        while ( cursor.next() )
        {
            nextResults.add( cursor.get().getDn().getName() );
        }
View Full Code Here

        // Check that we have a cursor or not.
        // No cursor : do a search.
        EntryFilteringCursor cursor = session.getCoreSession().search( req );

        // Position the cursor at the beginning
        cursor.beforeFirst();

        /*
         * Iterate through all search results building and sending back responses
         * for each search result returned.
         */
 
View Full Code Here

                try
                {
                    cursor = directoryService.getAdminSession()
                        .search( base, SearchScope.SUBTREE, filter, AliasDerefMode.DEREF_ALWAYS, null );

                    cursor.beforeFirst();
                    if ( cursor.next() ) // there should be only one!
                    {
                        LOG.debug( "Class {} found under {} search context.", name, base );
                        Entry classEntry = cursor.get();
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.