this.searchBase, authType, this.username, this.password,
this.domain);
LOGGER
.config("Created LDAP connection settings object to obtain LDAP context "
+ ldapConnectionSettings);
LdapConnection ldapConnection = new LdapConnection(settings);
if (ldapConnection.getLdapContext() == null) {
Map<LdapConnectionError, String> errors = ldapConnection
.getErrors();
Iterator<Entry<LdapConnectionError, String>> iterator = errors
.entrySet().iterator();
StringBuffer errorMessage = new StringBuffer();
errorMessage.append(rb
.getString(SPConstants.LDAP_CONNECTVITY_ERROR));
while (iterator.hasNext()) {
Map.Entry<LdapConnectionError, String> entry = iterator.next();
errorMessage.append(SPConstants.SPACE + entry.getValue());
}
ed.set(SPConstants.LDAP_SERVER_HOST_ADDRESS,
errorMessage.toString());
return false;
}
if (ldapConnection.getLdapContext() == null) {
LOGGER
.log(Level.WARNING,
"Couldn't obtain context object to query LDAP (AD) directory server.");
ed.set(SPConstants.LDAP_SERVER_HOST_ADDRESS,
rb.getString(SPConstants.LDAP_CONNECTVITY_ERROR));
return false;
}
if (!checkForSearchBase(ldapConnection.getLdapContext(), searchBase,
ed)) {
return false;
}
LOGGER
.log(Level.CONFIG,