Package org.springframework.ldap.control

Examples of org.springframework.ldap.control.PagedResultsCookie


        NamingEnumeration<SearchResult> results = null;
        PagedResultsDirContextProcessor processor = null;
        boolean noExceptions = false;
        try
        {
            PagedResultsCookie cookie = null;
            int index = 0;
            boolean doNext = true;
            if (handler.getMaxCount() > 0 && controls.getCountLimit() <= 0 || handler.getMaxCount()+1 < controls.getCountLimit())
            {
                controls.setCountLimit(handler.getMaxCount()+1);
            }
            int pageSize = handler.getSearchPageSize() < 0 ? this.pageSize : handler.getSearchPageSize();
            if (pageSize > 0)
            {
                do
                {
                    processor = new PagedResultsDirContextProcessor(pageSize, cookie);
                    processor.preProcess(ctx);
                    results = base != null ? ctx.search(base, filter, controls) : ctx.search(baseName, filter, controls);
                    int pageIndex = 0;
                    while (doNext && results.hasMore())
                    {
                        doNext = handler.handleSearchResult(results.next(), pageSize, pageIndex++, index++);
                    }               
                    processor.postProcess(ctx);
                    cookie = processor.getCookie();
                }
                while (doNext && cookie != null && cookie.getCookie() != null && cookie.getCookie().length != 0);
            }
            else
            {
                results = base != null ? ctx.search(base, filter, controls) : ctx.search(baseName, filter, controls);
                int pageIndex = 0;
View Full Code Here


        NamingEnumeration<SearchResult> results = null;
        PagedResultsDirContextProcessor processor = null;
        boolean noExceptions = false;
        try
        {
            PagedResultsCookie cookie = null;
            int index = 0;
            boolean doNext = true;
            if (handler.getMaxCount() > 0 && controls.getCountLimit() <= 0 || handler.getMaxCount()+1 < controls.getCountLimit())
            {
                controls.setCountLimit(handler.getMaxCount()+1);
            }
            int pageSize = handler.getSearchPageSize() < 0 ? this.pageSize : handler.getSearchPageSize();
            if (pageSize > 0)
            {
                do
                {
                    processor = new PagedResultsDirContextProcessor(pageSize, cookie);
                    processor.preProcess(ctx);
                    results = base != null ? ctx.search(base, filter, controls) : ctx.search(baseName, filter, controls);
                    int pageIndex = 0;
                    while (doNext && results.hasMore())
                    {
                        doNext = handler.handleSearchResult(results.next(), pageSize, pageIndex++, index++);
                    }               
                    processor.postProcess(ctx);
                    cookie = processor.getCookie();
                }
                while (doNext && cookie != null && cookie.getCookie() != null && cookie.getCookie().length != 0);
            }
            else
            {
                results = base != null ? ctx.search(base, filter, controls) : ctx.search(baseName, filter, controls);
                int pageIndex = 0;
View Full Code Here

TOP

Related Classes of org.springframework.ldap.control.PagedResultsCookie

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.