From b671de6dbf50ca89cb0b9e4d7da6c81ae3017c82 Mon Sep 17 00:00:00 2001
From: Violette Roche-Montane <violette.roche-montane@forgerock.com>
Date: Tue, 18 Feb 2014 14:19:36 +0000
Subject: [PATCH] Checkpoint OPENDJ-1343 Migrate dsconfig / OPENDJ-1303 "opendj-cli" - org.opends.server.util.cli.[*] calls replaced by equivalent CLI sdk's classes. - fixed upgrade cli -> <string<.equals(LocalizedMessaged) - moved methods from console application to ReplicationMainCli.

---
 opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/DSConfig.java |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/DSConfig.java b/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/DSConfig.java
index d7ed9f1..0f9ca72 100644
--- a/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/DSConfig.java
+++ b/opendj3-server-dev/src/server/org/opends/server/tools/dsconfig/DSConfig.java
@@ -36,6 +36,9 @@
 import static org.opends.server.tools.dsconfig.ArgumentExceptionFactory.*;
 import static org.opends.server.util.ServerConstants.PROPERTY_SCRIPT_NAME;
 import static org.opends.server.util.StaticUtils.*;
+import static com.forgerock.opendj.cli.Utils.formatDateTimeStringForEquivalentCommand;
+import static com.forgerock.opendj.cli.Utils.SHELL_COMMENT_SEPARATOR;
+import static com.forgerock.opendj.cli.Utils.getCurrentOperationDateMessage;
 
 import java.io.BufferedWriter;
 import java.io.File;
@@ -44,6 +47,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -74,6 +78,7 @@
 import org.opends.server.util.EmbeddedUtils;
 import org.opends.server.util.ServerConstants;
 import org.opends.server.util.StaticUtils;
+
 import com.forgerock.opendj.cli.ArgumentException;
 import com.forgerock.opendj.cli.BooleanArgument;
 import com.forgerock.opendj.cli.StringArgument;
@@ -81,13 +86,12 @@
 import com.forgerock.opendj.cli.SubCommandArgumentParser;
 import com.forgerock.opendj.cli.ArgumentGroup;
 import com.forgerock.opendj.cli.ClientException;
-import org.opends.server.util.cli.CommandBuilder;
-import org.opends.server.util.cli.ConsoleApplication;
-import org.opends.server.util.cli.Menu;
-import org.opends.server.util.cli.MenuBuilder;
-import org.opends.server.util.cli.MenuCallback;
-import org.opends.server.util.cli.MenuResult;
-import org.opends.server.util.cli.OutputStreamConsoleApplication;
+import com.forgerock.opendj.cli.CommandBuilder;
+import com.forgerock.opendj.cli.ConsoleApplication;
+import com.forgerock.opendj.cli.Menu;
+import com.forgerock.opendj.cli.MenuBuilder;
+import com.forgerock.opendj.cli.MenuCallback;
+import com.forgerock.opendj.cli.MenuResult;
 
 
 
@@ -430,7 +434,7 @@
    */
   private DSConfig(InputStream in, OutputStream out, OutputStream err,
       ManagementContextFactory factory) {
-    super(in, out, err);
+    super(new PrintStream(out), new PrintStream(err));
 
     this.parser = new SubCommandArgumentParser(this.getClass().getName(),
         INFO_CONFIGDS_TOOL_DESCRIPTION.get(), false);
@@ -862,8 +866,8 @@
 
   // Run the top-level interactive console.
   private int runInteractiveMode() {
-    // In interactive mode, redirect all output to stdout.
-    ConsoleApplication app = new OutputStreamConsoleApplication(this);
+
+    ConsoleApplication app = this;
 
     // Build menu structure.
     Comparator<RelationDefinition<?, ?>> c =
@@ -1256,7 +1260,7 @@
           fileArguments[ii] = fileArguments[ii].replace("##", " ");
         }
 
-        printlnBatchProgress(displayCommand);
+        errPrintln(LocalizableMessage.raw(displayCommand));
 
         // Append initial arguments to the file line
         List<String> allArguments = new ArrayList<String>();
@@ -1270,7 +1274,7 @@
           reader.close();
           System.exit(filterExitCode(exitCode));
         }
-        printlnBatchProgress("");
+        errPrintln();
       }
       reader.close();
 

--
Gitblit v1.10.0