Class PasswordGenerator<T extends PasswordGeneratorCfg>

  • 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 Detail

      • PasswordGenerator

        public PasswordGenerator()
    • 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, or false 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.