Examples of PagedResultsControl


Examples of javax.naming.ldap.PagedResultsControl

    public void test_reconnect() throws Exception {
        Hashtable<Object, Object> env = new Hashtable<Object, Object>();
        env
        .put("java.naming.ldap.control.connect",
                new Control[] { new PagedResultsControl(10,
                        Control.NONCRITICAL) });

        MockLdapClient client = new MockLdapClient();
        context = new LdapContextImpl(client, env, "cn=test");
       
View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

    private List<SearchResult> pagedSearch(LdapContext ldapContext, String searchFilter) throws Exception {
        List<SearchResult> data = new ArrayList<SearchResult>();

        log.trace("Using paged ldap search, pageSize={}", pageSize);

        Control[] requestControls = new Control[]{new PagedResultsControl(pageSize, Control.CRITICAL)};
        ldapContext.setRequestControls(requestControls);
        do {
            List<SearchResult> pageResult = simpleSearch(ldapContext, searchFilter);
            data.addAll(pageResult);
            log.trace("Page returned {} entries", pageResult.size());
View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

        }

        if (cookie == null) {
            return false;
        } else {
            ldapContext.setRequestControls(new Control[]{new PagedResultsControl(pageSize, cookie, Control.CRITICAL)});
            return true;
        }
    }
View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

    private List<SearchResult> pagedSearch(LdapContext ldapContext, String searchFilter) throws Exception {
        List<SearchResult> data = new ArrayList<SearchResult>();

        log.trace("Using paged ldap search, pageSize={}", pageSize);

        Control[] requestControls = new Control[]{new PagedResultsControl(pageSize, Control.CRITICAL)};
        ldapContext.setRequestControls(requestControls);
        do {
            List<SearchResult> pageResult = simpleSearch(ldapContext, searchFilter);
            data.addAll(pageResult);
            log.trace("Page returned {} entries", pageResult.size());
View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

        }

        if (cookie == null) {
            return false;
        } else {
            ldapContext.setRequestControls(new Control[]{new PagedResultsControl(pageSize, cookie, Control.CRITICAL)});
            return true;
        }
    }
View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

      System.out.println("#################SEARCH BY QUERY FILTER##########################");
      SearchControls searchControls = new SearchControls();
      searchControls.setCountLimit(5);
      searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE);
      Control[] requestControls =
         {new PagedResultsControl(3, Control.CRITICAL), new SortControl(new String[]{"cn"}, Control.NONCRITICAL)};
      ctx.setRequestControls(requestControls);
      results = ctx.search(DEVELOPER_UNIT_DN, "(objectclass=person)", searchControls);
      while (results.hasMoreElements())
      {
         SearchResult sr = (SearchResult)results.nextElement();
View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

   * <p>Here we are testing if this method constructs a control to set the number of entries to be returned per page of results.</p>
   * <p>The expected result is an instance of this class.</p>
   */
  public void testPagedResultsControlIntBoolean001() {
    try {
      PagedResultsControl prc=new PagedResultsControl(0,false);
      assertNotNull(prc);
    } catch (IOException e) {
      fail("Failed with:"+e);
    }

View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

   * <p>Here we are testing if this method constructs a control to set the number of entries to be returned per page of results.</p>
   * <p>The expected result is an instance of this class.</p>
   */
  public void testPagedResultsControlIntBoolean002() {
    try {
      PagedResultsControl prc=new PagedResultsControl(0,true);
      assertNotNull(prc);
    } catch (IOException e) {
      fail("Failed with:"+e);
    }

View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

   * <p>Here we are testing if this method constructs a control to set the number of entries to be returned per page of results.</p>
   * <p>The expected result is an instance of this class.</p>
   */
  public void testPagedResultsControlIntBoolean003() {
    try {
      PagedResultsControl prc=new PagedResultsControl(100,false);
      assertNotNull(prc);
    } catch (IOException e) {
      fail("Failed with:"+e);
    }

View Full Code Here

Examples of javax.naming.ldap.PagedResultsControl

   * <p>Here we are testing if this method constructs a control to set the number of entries to be returned per page of results.</p>
   * <p>The expected result is an instance of this class.</p>
   */
  public void testPagedResultsControlIntBoolean004() {
    try {
      PagedResultsControl prc=new PagedResultsControl(100,true);
      assertNotNull(prc);
    } catch (IOException e) {
      fail("Failed with:"+e);
    }

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.