lc = getConnection(); LDAPSearchConstraints cons = new LDAPSearchConstraints(); cons.setMaxResults(0); // no limit LDAPSearchResults searchResults = null; if (attributeList == null || attributeList.size() == 0) {
/** * Returns a set of LDAPSearchConstraints to apply globally * to all LDAP searches. * * @return * A LDAPSearchConstraints object containing constraints * to be applied to all LDAP search operations. * * @throws GuacamoleException * If guacamole.properties cannot be parsed. */ public LDAPSearchConstraints getLDAPSearchConstraints() throws GuacamoleException { LDAPSearchConstraints constraints = new LDAPSearchConstraints(); constraints.setMaxResults(getMaxResults()); constraints.setDereference(getDereferenceAliases().DEREF_VALUE); return constraints; }
/** * Specifies how results are returned during a search operation. * * @see <a href="../../../../api/com/novell/ldap/LDAPSearchConstraints.html#setBatchSize(int)"> com.novell.ldap.LDAPSearchConstraints.setBatchSize(int)</a> */ public void setBatchSize(int batchSize) { cons.setBatchSize(batchSize); return; }
new com.novell.ldap.LDAPSearchConstraints(); cons.setServerTimeLimit(serverTimeLimit); cons.setDereference(dereference); cons.setMaxResults(maxResults); cons.setBatchSize(batchSize); return;
LDAPSearchConstraints constraints = new LDAPSearchConstraints(); if (isSearchAliases()) { constraints.setDereference(LDAPSearchConstraints.DEREF_ALWAYS); } else { constraints.setDereference(LDAPSearchConstraints.DEREF_NEVER); constraints.setTimeLimit(operationTimeout); constraints.setReferralFollowing(followReferrals); // TODO: Do we want to make an explicit set optional? constraints.setBatchSize(0); constraints.setMaxResults(maxResults);
LDAPSearchConstraints constraints = new LDAPSearchConstraints(this.connection.getConstraints()); constraints.setTimeLimit(getTimeout(context)); constraints.setMaxResults(getMaxResults(context)); constraints.setReferralFollowing(true); constraints.setReferralHandler(new LDAPPluginReferralHandler(loginDN, password, context)); this.connection.setConstraints(constraints);
(LDAPSearchConstraints)defSearchCons.clone(); newCons.setHopLimit(cons.getHopLimit()); newCons.setTimeLimit(cons.getTimeLimit()); newCons.setReferralHandler(cons.getReferralHandler()); newCons.setReferralFollowing(cons.getReferralFollowing()); LDAPControl[] lsc = cons.getControls(); if( lsc != null) { newCons.setControls( lsc); Hashtable lp = newCons.getProperties(); if( lp != null) { newCons.setProperties( lp);
/** * Constructs an LDAPConstraints object, using the default * option values. * * @see <a href="../../../../api/com/novell/ldap/LDAPConstraints.html#LDAPConstraints()"> com.novell.ldap.LDAPConstraints.LDAPConstraints()</a> */ public LDAPConstraints() { cons = new com.novell.ldap.LDAPSearchConstraints(); return; }
private LDAPSearchConstraints defSearchCons = new LDAPSearchConstraints(); private LDAPControl[] responseCtls = null; attrs, cons.getDereference(), cons.getMaxResults(), cons.getServerTimeLimit(), typesOnly, cons.getControls()); MessageAgent agent; LDAPSearchQueue myqueue = queue; agent.sendMessage( conn, msg, cons.getTimeLimit(), myqueue, null); } catch(LDAPException lex) { throw lex;
searchconstraints = new LDAPSearchConstraints(); } else { searchconstraints = constraints; searchconstraints.setControls(psCtrl);
searchCons.setControls( (LDAPControl[]) controls.toArray( new LDAPControl[controls.size()])); (String[]) attributeNames.toArray( new String[attributeNames.size()]), searchCons.getDereference(), searchCons.getMaxResults(), searchCons.getServerTimeLimit(), typesOnly, searchCons.getControls()); } else { message = (String[]) attributeNames.toArray( new String[attributeNames.size()]), searchCons.getDereference(), searchCons.getMaxResults(), searchCons.getServerTimeLimit(), typesOnly,
/** * Sets the maximum number of search results to be returned; 0 means no * limit. The default is 1000. * * @see <a href="../../../../api/com/novell/ldap/LDAPSearchConstraints.html#setMaxResults(int)"> com.novell.ldap.LDAPSearchConstraints.setMaxResults(int)</a> */ public void setMaxResults(int maxResults) { cons.setMaxResults(maxResults); return; }
/** * Sets a preference indicating whether or not aliases should be * dereferenced, and if so, when. * * @see <a href="../../../../api/com/novell/ldap/LDAPSearchConstraints.html#setDereference(int)"> com.novell.ldap.LDAPSearchConstraints.setDereference(int)</a> */ public void setDereference(int dereference) { cons.setDereference(dereference); return; }
} else { cons = (LDAPSearchConstraints)cons.clone(); cons.setBatchSize(0); // Must wait until all results arrive LDAPSearchResults toReturn = lconn.search(toGet.getDN(), toGet.getScope(), toGet.getFilter(), toGet.getAttributeArray(),
lc.connect( ldapHost, ldapPort ); lc.bind( ldapVersion, loginDN, password.getBytes("UTF8")); LDAPControl ldapCtrl = new LDAPControl("1.3.6.1.4.1.637.81.2.10.10", false, null); LDAPSearchConstraints cons = lc.getSearchConstraints(); cons.setControls( ldapCtrl ); lc.setConstraints(cons); LDAPSearchResults searchResults = lc.search("",LDAPConnection.SCOPE_BASE, "(objectclass=*)", returnedAttributes,attributeOnly , cons); LDAPControl[] controls = searchResults.getResponseControls();
/** * Constructs a com.novell.ldap.LDAPConstraints object from an * LDAPConstraints object */ /* package */ LDAPConstraints( LDAPConstraints cons) { // Set base constraints with defaults for search parameters this( cons.getTimeLimit(), cons.getReferralFollowing(), null, cons.getHopLimit()); refHandler = cons.getReferralHandler(); if( cons instanceof LDAPSearchConstraints) { // Set search constraints values, if present LDAPSearchConstraints inCons = (LDAPSearchConstraints)cons; com.novell.ldap.LDAPSearchConstraints outCons = (com.novell.ldap.LDAPSearchConstraints)this.cons; outCons.setServerTimeLimit(inCons.getServerTimeLimit()); outCons.setDereference(inCons.getDereference()); outCons.setMaxResults(inCons.getMaxResults()); outCons.setBatchSize(inCons.getBatchSize()); } return; }
/** * Constructs an LDAPSearchConstraints object using the default values for * the search constraints. * * @see <a href="../../../../api/com/novell/ldap/LDAPSearchConstraints.html#LDAPSearchConstraints()"> com.novell.ldap.LDAPSearchConstraints.LDAPSearchConstraints()</a> */ public LDAPSearchConstraints() { super( new com.novell.ldap.LDAPSearchConstraints()); cons = (com.novell.ldap.LDAPSearchConstraints)super.getWrappedObject(); return; }
/** * Constructs an LDAPSearchConstraints object using the values from * an existing Constraints object. * * @see <a href="../../../../api/com/novell/ldap/LDAPSearchConstraints.html#LDAPSearchConstraints(com.novell.ldap.LDAPConstraints)"> com.novell.ldap.LDAPSearchConstraints.LDAPSearchConstraints(LDAPConstraints)</a> */ public LDAPSearchConstraints( LDAPConstraints cons) { super( new com.novell.ldap.LDAPSearchConstraints( cons.getWrappedObject())); this.cons = (com.novell.ldap.LDAPSearchConstraints)super.getWrappedObject(); return; }
searchCons = new LDAPSearchConstraints(timeLimit, timeLimit,
/** * Constructs a new LDAPConstraints object, using the specified * operational constraints for waiting, referrals, LDAPBindHandler * object, and hop limit. * * @see com.novell.ldap.LDAPConstraints#LDAPConstraints( int,boolean,LDAPReferralHandler,int) * @see <a href="../../../../api/com/novell/ldap/LDAPConstraints.html#LDAPConstraints(int, boolean, com.novell.ldap.LDAPReferralHandler, int)"> com.novell.ldap.LDAPConstraints.LDAPConstraints(int, boolean, LDAPReferralHandler, int)</a> */ public LDAPConstraints(int msLimit, boolean doReferrals, LDAPReferralHandler handler, int hop_limit) { // Set defaults for search parameters this.cons = new com.novell.ldap.LDAPSearchConstraints(); // Set values for base constraints this.cons.setTimeLimit( msLimit); this.cons.setReferralFollowing( doReferrals); this.cons.setHopLimit( hop_limit); setReferralHandler( handler); return; }