mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
20.42.2016 61b9eb1be03fc03a9f4bb0013a08ff44a1059503
opendj-server-legacy/src/main/java/org/opends/server/extensions/RandomPasswordGenerator.java
@@ -50,7 +50,6 @@
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
  /** The current configuration for this password validator. */
  private RandomPasswordGeneratorCfg currentConfig;
@@ -63,10 +62,7 @@
  /** The total length of the password that will be generated. */
  private int totalLength;
  /**
   * The numbers of characters of each type that should be used to generate the
   * passwords.
   */
  /** The numbers of characters of each type that should be used to generate the passwords. */
  private int[] characterCounts;
  /** The character sets that should be used to generate the passwords. */
@@ -81,9 +77,6 @@
  /** The character set format string for this password generator. */
  private String formatString;
  /** {@inheritDoc} */
  @Override
  public void initializePasswordGenerator(
      RandomPasswordGeneratorCfg configuration)
@@ -132,7 +125,6 @@
      throw new InitializationException(message, e);
    }
    // Get the value that describes which character set(s) and how many
    // characters from each should be used.
@@ -206,17 +198,12 @@
    currentConfig = configuration;
  }
  /** {@inheritDoc} */
  @Override
  public void finalizePasswordGenerator()
  {
    currentConfig.removeRandomChangeListener(this);
  }
  /**
   * Generates a password for the user whose account is contained in the
   * specified entry.
@@ -246,9 +233,6 @@
    return ByteString.valueOfUtf8(buffer);
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationAcceptable(PasswordGeneratorCfg configuration,
                                           List<LocalizableMessage> unacceptableReasons)
@@ -258,9 +242,6 @@
    return isConfigurationChangeAcceptable(config, unacceptableReasons);
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationChangeAcceptable(
      RandomPasswordGeneratorCfg configuration,
@@ -308,7 +289,6 @@
      return false;
    }
    // Get the value that describes which character set(s) and how many
    // characters from each should be used.
    try
@@ -351,21 +331,16 @@
      return false;
    }
    // If we've gotten here, then everything looks OK.
    return true;
  }
  /** {@inheritDoc} */
  @Override
  public ConfigChangeResult applyConfigurationChange(
      RandomPasswordGeneratorCfg configuration)
  {
    final ConfigChangeResult ccr = new ConfigChangeResult();
    // Get the character sets for use in generating the password.  At least one
    // must have been provided.
    SortedSet<String> newEncodedCharacterSets = null;
@@ -408,7 +383,6 @@
      ccr.setResultCodeIfSuccess(DirectoryServer.getServerErrorResultCode());
    }
    // Get the value that describes which character set(s) and how many
    // characters from each should be used.
    ArrayList<NamedCharacterSet> newSetList = new ArrayList<>();
@@ -459,7 +433,6 @@
      ccr.setResultCodeIfSuccess(DirectoryServer.getServerErrorResultCode());
    }
    // If everything looks OK, then apply the changes.
    if (ccr.getResultCode() == ResultCode.SUCCESS)
    {