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

jvergara
18.36.2008 3baf38c823e31bddf3c2905e8781653404ab995c
opends/src/guitools/org/opends/guitools/controlpanel/task/Task.java
@@ -681,8 +681,32 @@
   */
  protected List<String> getConnectionCommandLineArguments()
  {
    return getConnectionCommandLineArguments(true, false);
  }
  /**
   * Returns the list of arguments related to the connection (host, port, bind
   * DN, etc.).
   * @param useAdminConnector use the administration connector to generate
   * the command line.
   * @param addConnectionTypeParameters add the connection type parameters
   * (--useSSL or --useStartTLS parameters: for ldapadd, ldapdelete, etc.).
   * @return the list of arguments related to the connection.
   */
  protected List<String> getConnectionCommandLineArguments(
      boolean useAdminConnector, boolean addConnectionTypeParameters)
  {
    ArrayList<String> args = new ArrayList<String>();
    InitialLdapContext ctx = getInfo().getDirContext();
    InitialLdapContext ctx;
    if (useAdminConnector)
    {
      ctx = getInfo().getDirContext();
    }
    else
    {
      ctx = getInfo().getUserDataDirContext();
    }
    if (isServerRunning() && (ctx != null))
    {
      String hostName = ConnectionUtils.getHostName(ctx);
@@ -703,6 +727,14 @@
      {
        args.add("--trustAll");
      }
      if (isSSL && addConnectionTypeParameters)
      {
        args.add("--useSSL");
      }
      else if (isStartTLS && addConnectionTypeParameters)
      {
        args.add("--useStartTLS");
      }
    }
    return args;
  }
@@ -769,25 +801,27 @@
   * Prints the equivalent modify command line in the progress dialog.
   * @param dn the dn of the modified entry.
   * @param mods the modifications.
   * @param useAdminCtx use the administration connector.
   */
  protected void printEquivalentCommandToModify(DN dn,
      Collection<ModificationItem> mods)
      Collection<ModificationItem> mods, boolean useAdminCtx)
  {
    printEquivalentCommandToModify(dn.toString(), mods);
    printEquivalentCommandToModify(dn.toString(), mods, useAdminCtx);
  }
  /**
   * Prints the equivalent modify command line in the progress dialog.
   * @param dn the dn of the modified entry.
   * @param mods the modifications.
   * @param useAdminCtx use the administration connector.
   */
  protected void printEquivalentCommandToModify(String dn,
      Collection<ModificationItem> mods)
      Collection<ModificationItem> mods, boolean useAdminCtx)
  {
    ArrayList<String> args = new ArrayList<String>();
    args.add(getCommandLinePath("ldapmodify"));
    args.addAll(getObfuscatedCommandLineArguments(
        getConnectionCommandLineArguments()));
        getConnectionCommandLineArguments(useAdminCtx, true)));
    StringBuilder sb = new StringBuilder();
    for (String arg : args)
    {
@@ -875,13 +909,15 @@
   * Prints the equivalent rename command line in the progress dialog.
   * @param oldDN the old DN of the entry.
   * @param newDN the new DN of the entry.
   * @param useAdminCtx use the administration connector.
   */
  protected void printEquivalentRenameCommand(DN oldDN, DN newDN)
  protected void printEquivalentRenameCommand(DN oldDN, DN newDN,
      boolean useAdminCtx)
  {
    ArrayList<String> args = new ArrayList<String>();
    args.add(getCommandLinePath("ldapmodify"));
    args.addAll(getObfuscatedCommandLineArguments(
        getConnectionCommandLineArguments()));
        getConnectionCommandLineArguments(useAdminCtx, true)));
    StringBuilder sb = new StringBuilder();
    for (String arg : args)
    {