Package org.opends.server.extensions
Class RandomPasswordGenerator
- java.lang.Object
-
- org.opends.server.api.PasswordGenerator<RandomPasswordGeneratorCfg>
-
- org.opends.server.extensions.RandomPasswordGenerator
-
- All Implemented Interfaces:
ConfigurationChangeListener<RandomPasswordGeneratorCfg>
public class RandomPasswordGenerator extends PasswordGenerator<RandomPasswordGeneratorCfg> implements ConfigurationChangeListener<RandomPasswordGeneratorCfg>
This class provides an implementation of a Directory Server password generator that will create random passwords based on fixed-length strings built from one or more character sets.
-
-
Constructor Summary
Constructors Constructor Description RandomPasswordGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationChange(RandomPasswordGeneratorCfg configuration)Applies the configuration changes to this change listener.voidfinalizePasswordGenerator()Performs any finalization work that may be necessary when this password generator is taken out of service.ByteStringgeneratePassword(Entry userEntry)Generates a password for the user whose account is contained in the specified entry.voidinitializePasswordGenerator(RandomPasswordGeneratorCfg configuration)Initializes this password generator based on the information in the provided configuration entry.booleanisConfigurationAcceptable(RandomPasswordGeneratorCfg configuration, List<LocalizableMessage> unacceptableReasons)Indicates whether the provided configuration is acceptable for this password generator.booleanisConfigurationChangeAcceptable(RandomPasswordGeneratorCfg configuration, List<LocalizableMessage> unacceptableReasons)Indicates whether the proposed change to the configuration is acceptable to this change listener.
-
-
-
Method Detail
-
initializePasswordGenerator
public void initializePasswordGenerator(RandomPasswordGeneratorCfg configuration) throws ConfigException, InitializationException
Description copied from class:PasswordGeneratorInitializes this password generator based on the information in the provided configuration entry.- Specified by:
initializePasswordGeneratorin classPasswordGenerator<RandomPasswordGeneratorCfg>- 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.
-
finalizePasswordGenerator
public void finalizePasswordGenerator()
Description copied from class:PasswordGeneratorPerforms any finalization work that may be necessary when this password generator is taken out of service.- Overrides:
finalizePasswordGeneratorin classPasswordGenerator<RandomPasswordGeneratorCfg>
-
generatePassword
public ByteString generatePassword(Entry userEntry)
Generates a password for the user whose account is contained in the specified entry.- Specified by:
generatePasswordin classPasswordGenerator<RandomPasswordGeneratorCfg>- 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.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(RandomPasswordGeneratorCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from class:PasswordGeneratorIndicates 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.- Overrides:
isConfigurationAcceptablein classPasswordGenerator<RandomPasswordGeneratorCfg>- 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:
trueif the provided configuration is acceptable for this password generator, orfalseif not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(RandomPasswordGeneratorCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<RandomPasswordGeneratorCfg>- Parameters:
configuration- The new configuration containing the changes.unacceptableReasons- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(RandomPasswordGeneratorCfg configuration)
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<RandomPasswordGeneratorCfg>- Parameters:
configuration- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
-