/** * Returns an ldap constraints object configured with the supplied request. * * @param request request containing configuration to create constraints * @return ldap constraints */ protected LDAPConstraints getLDAPConstraints(final Request request) { LDAPConstraints constraints = connection.getConstraints(); if (constraints == null) { constraints = new LDAPConstraints(); } if (request.getControls() != null) { constraints.setControls( config.getControlProcessor().processRequestControls(request.getControls())); } constraints.setReferralFollowing(request.getFollowReferrals()); return constraints; }
/** * Applies <code>LDAPConstraints</code> to the specified <code>LDAPConnection</code>. Implemented * to assign <code>timeLimit</code> and <code>referralFollowing</code> constraint values retrieved * from the currently assigned {@link LdapConnectionManagerConfig}. * * @param conn */ protected void applyConstraints(LDAPConnection conn) { int timeout = config.getOperationTimeout(); boolean followReferrals = config.isFollowReferrals(); if (M_log.isDebugEnabled()) { M_log.debug( "applyConstraints(): values [timeout = " + timeout + "][follow referrals = " + followReferrals + "]"); } LDAPConstraints constraints = new LDAPConstraints(); constraints.setTimeLimit(timeout); constraints.setReferralFollowing(followReferrals); conn.setConstraints(constraints); }