// Iterate through the child entries and process them as password policy
// configuration entries.
for (String passwordPolicyName : passwordPoliciesName)
{
PasswordPolicyCfg passwordPolicyConfiguration =
rootConfiguration.getPasswordPolicy(passwordPolicyName);
try
{
PasswordPolicy policy = new PasswordPolicy(passwordPolicyConfiguration);
PasswordPolicyConfig config = new PasswordPolicyConfig(policy);
DirectoryServer.registerPasswordPolicy(
passwordPolicyConfiguration.dn(), config);
passwordPolicyConfiguration.addChangeListener(config);
}
catch (ConfigException ce)
{
Message message = ERR_CONFIG_PWPOLICY_INVALID_POLICY_CONFIG.get(
String.valueOf(passwordPolicyConfiguration.dn()), ce.getMessage());
throw new ConfigException(message, ce);
}
catch (InitializationException ie)
{
Message message = ERR_CONFIG_PWPOLICY_INVALID_POLICY_CONFIG.get(
String.valueOf(passwordPolicyConfiguration.dn()), ie.getMessage());
throw new InitializationException(message, ie);
}
catch (Exception e)
{
Message message = ERR_CONFIG_PWPOLICY_INVALID_POLICY_CONFIG.
get(String.valueOf(passwordPolicyConfiguration.dn()),
stackTraceToSingleLineString(e));
throw new InitializationException(message, e);
}
}