{
passwordGenerator.finalizePasswordGenerator();
}
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
// Get the class for the password generator. If the generator 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 generator is disabled, then instantiate the class
// and initialize and register it as a password generator.
String className = configuration.getJavaClass();
if (existingGenerator != null)
{
if (! className.equals(existingGenerator.getClass().getName()))
{
adminActionRequired = true;
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}
PasswordGenerator<? extends PasswordGeneratorCfg>
passwordGenerator = null;
try
{
passwordGenerator = loadGenerator(className, configuration, true);
}
catch (InitializationException ie)
{
if (resultCode == ResultCode.SUCCESS)
{
resultCode = DirectoryServer.getServerErrorResultCode();
}
messages.add(ie.getMessageObject());
}
if (resultCode == ResultCode.SUCCESS)
{
passwordGenerators.put(configuration.dn(), passwordGenerator);
DirectoryServer.registerPasswordGenerator(configuration.dn(),
passwordGenerator);
}
return new ConfigChangeResult(resultCode, adminActionRequired, messages);
}