From c0f0d5aee47b462a9fcec7b80ca9ef2a180e9b9d Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 08 Nov 2007 00:00:39 +0000
Subject: [PATCH] Update the code of the interactive installer to be consistent with dsconfig, setup and status command-lines in the formatting and in the format used to present certificates to the user.

---
 opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
index 8d16c30..3652723 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
@@ -40,6 +40,7 @@
 import org.opends.admin.ads.TopologyCache;
 import org.opends.admin.ads.TopologyCacheException;
 import org.opends.admin.ads.util.ApplicationTrustManager;
+import org.opends.admin.ads.util.ConnectionUtils;
 import org.opends.guitools.uninstaller.ui.ConfirmUninstallPanel;
 import org.opends.guitools.uninstaller.ui.LoginDialog;
 import org.opends.quicksetup.ui.*;
@@ -1362,6 +1363,7 @@
       getUninstallUserData().setReplicationServer(
           loginDialog.getHostName() + ":" +
           conf.getReplicationServerPort());
+      getUninstallUserData().setReferencedHostName(loginDialog.getHostName());
 
       BackgroundTask worker = new BackgroundTask()
       {
@@ -1890,6 +1892,9 @@
     {
       if (adsContext.hasAdminData() && (serverADSProperties != null))
       {
+        LOG.log(Level.INFO, "Unregistering server on ADS of server "+
+            ConnectionUtils.getHostPort(ctx)+".  Properties: "+
+            serverADSProperties);
         adsContext.unregisterServer(serverADSProperties);
       }
     }
@@ -1943,7 +1948,7 @@
           property = ServerDescriptor.ServerProperty.LDAP_PORT;
         }
         ArrayList ports = (ArrayList)server.getServerProperties().get(property);
-        if (ports == null)
+        if (ports != null)
         {
           isServerToUninstall = ports.contains(port);
         }
@@ -1957,7 +1962,7 @@
           }
           else
           {
-            adsProperty = ADSContext.ServerProperty.LDAPS_PORT;
+            adsProperty = ADSContext.ServerProperty.LDAP_PORT;
           }
           String v = (String)server.getAdsProperties().get(adsProperty);
           if (v != null)
@@ -1983,7 +1988,8 @@
       // TODO: the host name comparison made here does not necessarily work in
       // all environments...
       String hostName = server.getHostName();
-      boolean hostNameEquals = false;
+      boolean hostNameEquals =
+        getUninstallUserData().getReferencedHostName().equals(hostName);
       try
       {
         InetAddress localAddress = InetAddress.getLocalHost();
@@ -1992,6 +1998,12 @@
         {
           hostNameEquals = localAddress.equals(addresses[i]);
         }
+        if (!hostNameEquals)
+        {
+          hostNameEquals =
+            localAddress.getHostName().equalsIgnoreCase(hostName) ||
+            localAddress.getCanonicalHostName().equalsIgnoreCase(hostName);
+        }
       }
       catch (Throwable t)
       {

--
Gitblit v1.10.0