{
passwordValidator.finalizePasswordValidator();
}
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
// Get the class for the password validator. If the validator is already
// enabled, then we shouldn't do anything with it although if the class has
// changed then we'll at least need to indicate that administrative action
// is required. If the validator is disabled, then instantiate the class
// and initialize and register it as a password validator.
String className = configuration.getJavaClass();
if (existingValidator != null)
{
if (! className.equals(existingValidator.getClass().getName()))
{
adminActionRequired = true;
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
PasswordValidator<? extends PasswordValidatorCfg>
passwordValidator = null;
try
{
passwordValidator = loadValidator(className, configuration, true);
}
catch (InitializationException ie)
{
if (resultCode == ResultCode.SUCCESS)
{
resultCode = DirectoryServer.getServerErrorResultCode();
}
messages.add(ie.getMessageObject());
}
if (resultCode == ResultCode.SUCCESS)
{
passwordValidators.put(configuration.dn(), passwordValidator);
DirectoryServer.registerPasswordValidator(configuration.dn(),
passwordValidator);
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}