environment = new Hashtable<String, Object>();
}
if (ldapFactory != null && !"".equals(ldapFactory.trim())) {
environment.put(Context.INITIAL_CONTEXT_FACTORY, ldapFactory);
} else {
throw new DCSecurityException("no ldap factory class specified");
}
if (serverUrl != null && !"".equals(serverUrl.trim())) {
environment.put(Context.PROVIDER_URL, serverUrl);
} else {
throw new DCSecurityException("no ldap server url specified");
}
if (baseDn != null && !"".equals(baseDn.trim())) {
environment.put(Context.SECURITY_PRINCIPAL, baseDn);
} else {
throw new DCSecurityException("no ldap server base dn specified");
}
if (protocol != null && !"".equals(protocol.trim())) {
environment.put(Context.SECURITY_PROTOCOL, protocol);
}