From d7a227add26ea9b1fa1ce5a8bf8838059d2f0c98 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Mon, 18 Dec 2006 13:33:24 +0000
Subject: [PATCH] Fix some issues with the dialog position when they were displayed.

---
 opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java |   38 ++++++++++----------------------------
 1 files changed, 10 insertions(+), 28 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java b/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
index 9fb8074..22d74b5 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
@@ -35,8 +35,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import javax.naming.NamingException;
-
 import org.opends.quicksetup.i18n.ResourceProvider;
 import org.opends.quicksetup.util.Utils;
 
@@ -201,36 +199,14 @@
   }
 
   /**
-   * Indicates whether there is the server is running in the localhost on the
-   * LDAP port specified in config.ldif file.  Note that this method performs
-   * LDAP requests which can be time consuming.
+   * Indicates whether there is the server is running.
    *
    * @return <CODE>true</CODE> if the server is running, or <CODE>false</CODE>
    *         if not.
    */
   public boolean isServerRunning()
   {
-    boolean isServerRunning = false;
-
-    try
-    {
-      Utils.createLdapContext(getLdapUrl(), null, null, 3000, null);
-      isServerRunning = true;
-    } catch (NamingException ne)
-    {
-      try
-      {
-        if (getSecurePort() != -1)
-        {
-          Utils.createLdapContext(getLdapsUrl(), null, null, 3000, null);
-          isServerRunning = true;
-        }
-      } catch (NamingException ne2)
-      {
-      }
-    }
-
-    return isServerRunning;
+    return Utils.isServerRunning(Utils.getInstallPathFromClasspath());
   }
 
   /**
@@ -242,7 +218,10 @@
   {
     if (ldapUrl == null)
     {
-      ldapUrl = "ldap://localhost:"+getPort();
+      if (getPort() != -1)
+      {
+        ldapUrl = "ldap://localhost:"+getPort();
+      }
     }
     return ldapUrl;
   }
@@ -257,7 +236,10 @@
   {
     if (ldapsUrl == null)
     {
-      ldapsUrl = "ldaps://localhost:"+getSecurePort();
+      if (getSecurePort() != -1)
+      {
+        ldapsUrl = "ldaps://localhost:"+getSecurePort();
+      }
     }
     return ldapsUrl;
   }

--
Gitblit v1.10.0