From 2173aa3140a1a35176921dfb8f2f9278b6973d73 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 12 Nov 2007 04:26:49 +0000
Subject: [PATCH] Update the dsreplication command-line to be consistent with dsconfig in the use of menus and in the order that questions to connect to the servers. Update the upgrade to use the same menus as the other command-lines. Do some minor changes in the uninstall command-line in order to be more consistent with dsconfig in the order where the connection parameters are provided. Fix a bug in ApplicationTrustManager related to the accepted certificates when there is a mismatch between the certificate and the host name. Do some refactorization of the code and remove the CliApplicationHelper class so that we use ConsoleApplication everywhere.

---
 opends/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java b/opends/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java
index 5d28633..961dadf 100644
--- a/opends/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java
+++ b/opends/src/server/org/opends/server/admin/client/cli/SecureConnectionCliArgs.java
@@ -30,6 +30,7 @@
 import static org.opends.server.admin.client.cli.DsFrameworkCliReturnCode.*;
 import static org.opends.server.loggers.debug.DebugLogger.debugEnabled;
 import static org.opends.server.loggers.debug.DebugLogger.getTracer;
+import static org.opends.messages.AdminToolMessages.*;
 import static org.opends.messages.ToolMessages.*;
 import org.opends.messages.Message;
 import org.opends.messages.MessageBuilder;
@@ -54,6 +55,7 @@
 
 import org.opends.admin.ads.util.ApplicationKeyManager;
 import org.opends.admin.ads.util.ApplicationTrustManager;
+import org.opends.quicksetup.Constants;
 import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.types.DebugLogLevel;
 import org.opends.server.util.PasswordReader;
@@ -85,11 +87,16 @@
   public IntegerArgument portArg = null;
 
   /**
-   * The 'binDN' global argument.
+   * The 'bindDN' global argument.
    */
   public StringArgument bindDnArg = null;
 
   /**
+   * The 'adminUID' global argument.
+   */
+  public StringArgument adminUidArg = null;
+
+  /**
    * The 'bindPasswordFile' global argument.
    */
   public FileBasedArgument bindPasswordFileArg = null;
@@ -205,6 +212,35 @@
   }
 
   /**
+   * Get the admin UID which has to be used for the command.
+   *
+   * @return The admin UID specified by the command line argument, or the
+   *         default value, if not specified.
+   */
+  public String getAdministratorUID()
+  {
+    if (adminUidArg.isPresent())
+    {
+      return adminUidArg.getValue();
+    }
+    else
+    {
+      return adminUidArg.getDefaultValue();
+    }
+  }
+
+  /**
+   * Tells whether this parser uses the Administrator UID (instead of the
+   * bind DN) or not.
+   * @return <CODE>true</CODE> if this parser uses the Administrator UID and
+   * <CODE>false</CODE> otherwise.
+   */
+  public boolean useAdminUID()
+  {
+    return !adminUidArg.isHidden();
+  }
+
+  /**
    * Get the bindDN which has to be used for the command.
    *
    * @return The bindDN specified by the command line argument, or the
@@ -414,6 +450,16 @@
     bindDnArg.setPropertyName(OPTION_LONG_BINDDN);
     argList.add(bindDnArg);
 
+    // It is up to the classes that required admin UID to make this argument
+    // visible
+    adminUidArg = new StringArgument("adminUID", 'I',
+        "adminUID", false, false, true, "adminUID",
+        Constants.GLOBAL_ADMIN_UID, null,
+        INFO_DESCRIPTION_ADMIN_UID.get());
+    adminUidArg.setPropertyName("adminUID");
+    adminUidArg.setHidden(true);
+    argList.add(adminUidArg);
+
     bindPasswordArg = new StringArgument("bindPassword",
         OPTION_SHORT_BINDPWD, OPTION_LONG_BINDPWD, false, false, true,
         OPTION_VALUE_BINDPWD, null, null, INFO_DESCRIPTION_BINDPASSWORD.get());

--
Gitblit v1.10.0