Package org.opends.server.api
Class PasswordGenerator<T extends PasswordGeneratorCfg>
- java.lang.Object
-
- org.opends.server.api.PasswordGenerator<T>
-
- Type Parameters:
T
- The type of configuration handled by this password generator.
- Direct Known Subclasses:
RandomPasswordGenerator
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=true, mayInvoke=false) public abstract class PasswordGenerator<T extends PasswordGeneratorCfg> extends Object
This class defines a set of methods and structures that must be implemented by a Directory Server module that may be used to generate user passwords. The password generator is included as part of a password policy, and is used by the password modify extended operation to construct a new password for the user if that option is chosen.
-
-
Constructor Summary
Constructors Constructor Description PasswordGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
finalizePasswordGenerator()
Performs any finalization work that may be necessary when this password generator is taken out of service.abstract ByteString
generatePassword(Entry userEntry)
Generates a password for the user whose account is contained in the specified entry.abstract void
initializePasswordGenerator(T configuration)
Initializes this password generator based on the information in the provided configuration entry.boolean
isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this password generator.
-
-
-
Method Detail
-
initializePasswordGenerator
public abstract void initializePasswordGenerator(T configuration) throws ConfigException, InitializationException
Initializes this password generator based on the information in the provided configuration entry.- Parameters:
configuration
- The configuration to use to initialize this password validator.- Throws:
ConfigException
- If an unrecoverable problem arises in the process of performing the initialization.InitializationException
- If a problem occurs during initialization that is not related to the server configuration.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this password generator. It should be possible to call this method on an uninitialized password generator instance in order to determine whether the password generator would be able to use the provided configuration.- Parameters:
configuration
- The password generator configuration for which to make the determination.unacceptableReasons
- A list that may be used to hold the reasons that the provided configuration is not acceptable.- Returns:
true
if the provided configuration is acceptable for this password generator, orfalse
if not.
-
finalizePasswordGenerator
public void finalizePasswordGenerator()
Performs any finalization work that may be necessary when this password generator is taken out of service.
-
generatePassword
public abstract ByteString generatePassword(Entry userEntry) throws LdapException
Generates a password for the user whose account is contained in the specified entry.- Parameters:
userEntry
- The entry for the user for whom the password is to be generated.- Returns:
- The password that has been generated for the user.
- Throws:
LdapException
- If a problem occurs while attempting to generate the password.
-
-