From fb4283af8d6b52a99199e88b4db0adc84739ae93 Mon Sep 17 00:00:00 2001
From: david_page <david_page@localhost>
Date: Sat, 01 Sep 2007 04:19:31 +0000
Subject: [PATCH] Issue 466 partial.

---
 opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java b/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
index 9995e93..f26e545 100644
--- a/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
+++ b/opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -1867,9 +1867,9 @@
   protected void updateADS() throws ApplicationException
   {
     DataReplicationOptions repl = getUserData().getReplicationOptions();
-    boolean remoteServer =
+    boolean isRemoteServer =
             repl.getType() == DataReplicationOptions.Type.IN_EXISTING_TOPOLOGY;
-    AuthenticationData auth = (remoteServer) ? repl.getAuthenticationData()
+    AuthenticationData auth = (isRemoteServer) ? repl.getAuthenticationData()
                                              : null;
     InitialLdapContext remoteCtx = null; // Bound to remote ADS host (if any).
     InitialLdapContext localCtx = null; // Bound to local server.
@@ -1879,7 +1879,7 @@
        ADSContextException to ApplicationException and clean up JNDI contexts.*/
     try
     {
-      if (remoteServer)
+      if (isRemoteServer)
       {
         /* In case the user specified an existing topology... */
         String ldapUrl = getLdapUrl(auth);
@@ -1921,7 +1921,7 @@
       /* Act on local server depending on if using remote or local ADS */
       notifyListeners(getFormattedWithPoints(INFO_PROGRESS_CREATING_ADS.get()));
       localCtx = createLocalContext();
-      if (remoteServer)
+      if (isRemoteServer)
       {
         /* Create an empty ADS suffix on the local server. */
         ADSContext localAdsContext = new ADSContext(localCtx);
@@ -1938,14 +1938,16 @@
       /* Register new server in ADS. */
       ServerDescriptor server = ServerDescriptor.createStandalone(localCtx);
       server.updateAdsPropertiesWithServerProperties();
-      if (0 != adsContext.registerOrUpdateServer(server.getAdsProperties()))
-      {
+      if (0 == adsContext.registerOrUpdateServer(server.getAdsProperties())) {
+        if (isRemoteServer) registeredNewServerOnRemote = true;
+      } else {
         LOG.log(Level.WARNING, "Server was already registered. Updating " +
                 "server registration.");
       }
-      else if (remoteServer)
+      if (isRemoteServer)
       {
-        registeredNewServerOnRemote = true;
+        ServerDescriptor.seedAdsTrustStore(localCtx,
+                                           adsContext.getTrustedCertificates());
       }
       notifyListeners(getFormattedDone());
       notifyListeners(getLineBreak());
@@ -1960,7 +1962,7 @@
                   INFO_PROGRESS_CREATING_ADMINISTRATOR.get()));
           adsContext.createAdministrator(getAdministratorProperties(
                   getUserData()));
-          if (remoteServer && !createdRemoteAds) createdAdministrator = true;
+          if (isRemoteServer && !createdRemoteAds) createdAdministrator = true;
           notifyListeners(getFormattedDone());
           notifyListeners(getLineBreak());
           checkAbort();
@@ -1982,7 +1984,7 @@
     }
     catch (NoPermissionException ne)
     {
-      if (remoteServer)
+      if (isRemoteServer)
       {
         throw new ApplicationException(
                 ReturnCode.CONFIGURATION_ERROR,
@@ -2001,7 +2003,7 @@
     }
     catch (NamingException ne)
     {
-      if (remoteServer)
+      if (isRemoteServer)
       {
         throw new ApplicationException(
                 ReturnCode.CONFIGURATION_ERROR,
@@ -2019,7 +2021,7 @@
     {
       throw new ApplicationException(
               ReturnCode.CONFIGURATION_ERROR,
-              ((remoteServer)
+              ((isRemoteServer)
                       ? INFO_REMOTE_ADS_EXCEPTION.get(
                       getHostDisplay(auth), ace.getReason())
                       : INFO_ADS_EXCEPTION.get(ace.toString())), ace);

--
Gitblit v1.10.0