/** * 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; }