/** * The time to wait before the search fails; the default is zero, meaning forever. * * @param searchTimeLimit the time limit for the search (in milliseconds). */ public void setSearchTimeLimit(int searchTimeLimit) { searchControls.setTimeLimit(searchTimeLimit); }
private SearchControls createSearchControl(String[] returningAttributes) { SearchControls controls = new SearchControls(); controls.setSearchScope(searchScope); controls.setTimeLimit(searchTimeLimit); controls.setReturningAttributes(returningAttributes); return controls; }
private SearchControls createSearchControls() { SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(searchScope); searchControls.setTimeLimit(identityMapping.searchTimeLimit); if (returningAttributes == null) { searchControls.setReturningAttributes(new String[]{}); } else { searchControls.setReturningAttributes(returningAttributes.toArray(new String[returningAttributes.size()])); } return searchControls; }
try { LdapContext ctx = new InitialLdapContext(env, null); ctx.setRequestControls(null); NamingEnumeration<?> namingEnum = ctx.search("ou=people,dc=example,dc=com", "(objectclass=user)", getSimpleSearchControls()); while (namingEnum.hasMore ()) { SearchResult result = (SearchResult) namingEnum.next (); Attributes attrs = result.getAttributes (); System.out.println(attrs.get("cn")); } namingEnum.close(); } catch (Exception e) { e.printStackTrace(); } private SearchControls getSimpleSearchControls() { SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); searchControls.setTimeLimit(30000); //String[] attrIDs = {"objectGUID"}; //searchControls.setReturningAttributes(attrIDs); return searchControls; }
controls.setTimeLimit(5000); // Sets the time limit of these SearchControls in milliseconds
SEARCH_CONTROLS.setTimeLimit(dirSearchTimeout);
this.controls.setTimeLimit( getTimeLimit() * 1000 );
public SearchControls getSearchControls() { SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); searchControls.setTimeLimit(30000); return searchControls; }
/** * The time to wait before the search fails; the default is zero, meaning forever. * * @param searchTimeLimit the time limit for the search (in milliseconds). */ public void setSearchTimeLimit(int searchTimeLimit) { searchControls.setTimeLimit(searchTimeLimit); }
/** * The time to wait before the search fails; the default is zero, meaning forever. * * @param searchTimeLimit the time limit for the search (in milliseconds). */ public void setSearchTimeLimit(int searchTimeLimit) { searchControls.setTimeLimit(searchTimeLimit); }
/** * The time to wait before the search fails; the default is zero, meaning forever. * * @param searchTimeLimit the time limit for the search (in milliseconds). */ public void setSearchTimeLimit(int searchTimeLimit) { searchControls.setTimeLimit(searchTimeLimit); }
/** * @see javax.naming.directory.SearchControls#setTimeLimit(int) * @param ms time limit in milliseconds * @deprecated */ @Deprecated public void setTimeLimit(final int ms) { this.searchControls.setTimeLimit(ms); }
protected SearchControls createSearchControls() { SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); searchControls.setTimeLimit(ldapConfigurator.getSearchTimeLimit()); return searchControls; }
private SearchControls createSearchControl(String[] returningAttributes) { SearchControls controls = new SearchControls(); controls.setSearchScope(searchScope); controls.setTimeLimit(searchTimeLimit); controls.setReturningAttributes(returningAttributes); return controls; }
private SearchControls createSearchControl(String[] returningAttributes) { SearchControls controls = new SearchControls(); controls.setSearchScope(searchScope); controls.setTimeLimit(searchTimeLimit); controls.setReturningAttributes(returningAttributes); return controls; }
protected SearchControls createSearchControls(LDAPConfiguration ldapConfigurator) { SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); searchControls.setTimeLimit(ldapConfigurator.getSearchTimeLimit()); return searchControls; }
private SearchControls createSearchControls() { SearchControls searchControls = new SearchControls(); searchControls.setSearchScope(searchScope); searchControls.setTimeLimit(identityMapping.searchTimeLimit); if (returningAttributes == null) { searchControls.setReturningAttributes(new String[]{}); } else { searchControls.setReturningAttributes(returningAttributes.toArray(new String[returningAttributes.size()])); } return searchControls; }
protected NamingEnumeration<?> rawSearchOneLevel(Name searchbase, String filter, int limit, int timeout, String returnAttributes[]) throws NamingException { SearchControls constraints = new SearchControls(); constraints.setSearchScope(1); constraints.setCountLimit(limit); constraints.setTimeLimit(timeout); constraints.setReturningAttributes(returnAttributes); NamingEnumeration<?> results = ctx.search(searchbase, filter, constraints); return results; }
private SearchControls getDefaultSearchControls(int searchScope, boolean returningObjFlag, String[] attrs) { SearchControls controls = new SearchControls(); controls.setSearchScope(searchScope); controls.setTimeLimit(defaultTimeLimit); controls.setCountLimit(defaultCountLimit); controls.setReturningObjFlag(returningObjFlag); controls.setReturningAttributes(attrs); return controls; }
private SearchControls getDefaultSearchControls(int searchScope, boolean returningObjFlag, String[] attrs) { SearchControls controls = new SearchControls(); controls.setSearchScope(searchScope); controls.setTimeLimit(defaultTimeLimit); controls.setCountLimit(defaultCountLimit); controls.setReturningObjFlag(returningObjFlag); controls.setReturningAttributes(attrs); return controls; }