From 9aca206b3757d8d7bccae4b2912f403eb67b3446 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 23 Aug 2006 16:44:33 +0000
Subject: [PATCH] Update the OpenDS setup process to add a "Please wait while the server initializes...." message at the beginning of the process which can make any delays introduced by the initial configuration and schema processing more palatable to the end user.

---
 opends/src/server/org/opends/server/tools/InstallDS.java       |    5 +++++
 opends/src/server/org/opends/server/messages/ToolMessages.java |   13 +++++++++++++
 opends/resource/setup.sh                                       |   27 ++++++++++++++++++++++-----
 3 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/opends/resource/setup.sh b/opends/resource/setup.sh
index b478561..c058c76 100755
--- a/opends/resource/setup.sh
+++ b/opends/resource/setup.sh
@@ -69,12 +69,29 @@
 
 
 # Determine whether the detected Java environment is acceptable for use.
-${JAVA_BIN} ${JAVA_ARGS} org.opends.server.tools.InstallDS -t
-if test $? -ne 0
+if test -z "${JAVA_ARGS}"
 then
-  echo "ERROR:  The detected Java version could not be used.  Please set "
-  echo "        JAVA_HOME to the root of a Java 5.0 installation."
-  exit 1
+  ${JAVA_BIN} -client org.opends.server.tools.InstallDS -t 2> /dev/null
+  if test $? -eq 0
+  then
+    JAVA_ARGS="-client"
+  else
+    ${JAVA_BIN} org.opends.server.tools.InstallDS -t 2> /dev/null
+    if test $? -ne 0
+    then
+      echo "ERROR:  The detected Java version could not be used.  Please set "
+      echo "        JAVA_HOME to the root of a Java 5.0 installation."
+      exit 1
+    fi
+  fi
+else
+  ${JAVA_BIN} ${JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
+  if test $? -ne 0
+  then
+    echo "ERROR:  The detected Java version could not be used.  Please set "
+    echo "        JAVA_HOME to the root of a Java 5.0 installation."
+    exit 1
+  fi
 fi
 
 
diff --git a/opends/src/server/org/opends/server/messages/ToolMessages.java b/opends/src/server/org/opends/server/messages/ToolMessages.java
index d1a52e0..d272716 100644
--- a/opends/src/server/org/opends/server/messages/ToolMessages.java
+++ b/opends/src/server/org/opends/server/messages/ToolMessages.java
@@ -5222,6 +5222,17 @@
 
 
   /**
+   * The message ID for the message that will be used if the user did not
+   * specify the path to the Directory Server configuration file.  This takes a
+   * single argument, which is the name of the command-line option that should
+   * be used to provide that information.
+   */
+  public static final int MSGID_INSTALLDS_INITIALIZING =
+       CATEGORY_MASK_TOOLS | SEVERITY_MASK_INFORMATIONAL | 534;
+
+
+
+  /**
    * Associates a set of generic messages with the message IDs defined in this
    * class.
    */
@@ -6851,6 +6862,8 @@
     registerMessage(MSGID_INSTALLDS_NO_CONFIG_FILE,
                     "ERROR:  No configuration file path was provided (use " +
                     "the %s argument).");
+    registerMessage(MSGID_INSTALLDS_INITIALIZING,
+                    "Please wait while the setup program initializes....");
     registerMessage(MSGID_INSTALLDS_CANNOT_INITIALIZE_JMX,
                     "An error occurred while attempting to initialize the " +
                     "Directory Server JMX subsystem based on the information " +
diff --git a/opends/src/server/org/opends/server/tools/InstallDS.java b/opends/src/server/org/opends/server/tools/InstallDS.java
index b131cd4..921e9bb 100644
--- a/opends/src/server/org/opends/server/tools/InstallDS.java
+++ b/opends/src/server/org/opends/server/tools/InstallDS.java
@@ -304,6 +304,11 @@
     if (! silentInstall.isPresent())
     {
       System.out.println(versionString);
+      System.out.println();
+
+      int    msgID   = MSGID_INSTALLDS_INITIALIZING;
+      String message = getMessage(msgID);
+      System.out.println(wrapText(message, MAX_LINE_WIDTH));
     }
 
 

--
Gitblit v1.10.0