/** * Returns an ldap constraints object configured with the supplied controls. * * @param controls to sets in the constraints * @return ldap constraints */ protected LDAPConstraints getLDAPConstraints(final RequestControl[] controls) { LDAPConstraints constraints = connection.getConstraints(); if (constraints == null) { constraints = new LDAPConstraints(); } if (controls != null) { constraints.setControls(config.getControlProcessor().processRequestControls(controls)); } return constraints; }
/** * 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; }
/** {@inheritDoc} */ @Override public void abandon(final RequestControl[] controls) throws LdapException { try { LDAPConstraints constraints = connection.getConstraints(); if (constraints == null) { constraints = new LDAPConstraints(); } if (controls != null) { constraints.setControls(config.getControlProcessor().processRequestControls(controls)); } connection.abandon(messageQueue, constraints); } catch (LDAPException e) { processLDAPException(e); } }
/** * 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); }