mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
03.35.2007 2406449c5f0309525bfd5d86de417b32bcc7c1b3
opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
@@ -108,8 +108,6 @@
  private ProgressDialog startProgressDlg;
  private MessageBuilder startProgressDetails = new MessageBuilder();
  private UninstallData conf;
  private String replicationServerHostPort;
  /**
   * Default constructor.
   */
@@ -828,12 +826,14 @@
      }
    } catch (ApplicationException ex) {
      LOG.log(Level.SEVERE, "Error: "+ex, ex);
      ue = ex;
      status = UninstallProgressStep.FINISHED_WITH_ERROR;
      Message msg = getFormattedError(ex, true);
      notifyListeners(msg);
    }
    catch (Throwable t) {
      LOG.log(Level.SEVERE, "Error: "+t, t);
      ue = new ApplicationException(
              ReturnCode.BUG,
              getThrowableMsg(INFO_BUG_MSG.get(), t), t);
@@ -1348,7 +1348,6 @@
    {
      getUninstallUserData().setAdminUID(loginDialog.getAdministratorUid());
      getUninstallUserData().setAdminPwd(loginDialog.getAdministratorPwd());
      getUninstallUserData().setReferencedHostName(loginDialog.getHostName());
      final InitialLdapContext ctx = loginDialog.getContext();
      try
      {
@@ -1360,8 +1359,9 @@
        LOG.log(Level.WARNING, "Could not find local server: "+ne, ne);
        getUninstallUserData().setLocalServerUrl("ldap://localhost:389");
      }
      replicationServerHostPort = loginDialog.getHostName() + ":" +
      conf.getReplicationServerPort();
      getUninstallUserData().setReplicationServer(
          loginDialog.getHostName() + ":" +
          conf.getReplicationServerPort());
      BackgroundTask worker = new BackgroundTask()
      {
@@ -1449,6 +1449,7 @@
    /* Check the exceptions and see if we throw them or not. */
    for (TopologyCacheException e : exceptions)
    {
      LOG.log(Level.INFO, "Analyzing exception: "+e, e);
      if (stopProcessing)
      {
        break;
@@ -1641,6 +1642,7 @@
      LOG.log(Level.WARNING, "The server ADS properties for the server to "+
          "uninstall could not be found.");
    }
    for (ServerDescriptor server : servers)
    {
      if (server.getAdsProperties() != serverADSProperties)
@@ -1652,8 +1654,7 @@
  /**
   * This method updates the replication in the remote server represented by
   * a given ServerProperty object.  It does not thrown any exception and works
   * in a best effort mode.
   * a given ServerProperty object.
   * It also tries to delete the server registration entry from the remote ADS
   * servers if the serverADSProperties object passed is not null.
   * @param server the ServerDescriptor object representing the server where
@@ -1681,7 +1682,8 @@
      {
        for (Object o : replicationServers)
        {
          if (replicationServerHostPort.equalsIgnoreCase((String)o))
          if (getUninstallUserData().getReplicationServer().equalsIgnoreCase(
              (String)o))
          {
            hasReferences = true;
            break;
@@ -1698,7 +1700,8 @@
        {
          for (Object o : replica.getReplicationServers())
          {
            if (replicationServerHostPort.equalsIgnoreCase((String)o))
            if (getUninstallUserData().getReplicationServer().equalsIgnoreCase(
                (String)o))
            {
              hasReferences = true;
              break;
@@ -1799,7 +1802,8 @@
          String replServer = null;
          for (String o : replServers)
          {
            if (replicationServerHostPort.equalsIgnoreCase(o))
            if (getUninstallUserData().getReplicationServer().equalsIgnoreCase(
                o))
            {
              replServer = o;
              break;
@@ -1836,7 +1840,8 @@
            String replServer = null;
            for (String o : replServers)
            {
              if (replicationServerHostPort.equalsIgnoreCase(o))
              if (getUninstallUserData().getReplicationServer().
                  equalsIgnoreCase(o))
              {
                replServer = o;
                break;
@@ -1938,7 +1943,28 @@
          property = ServerDescriptor.ServerProperty.LDAP_PORT;
        }
        ArrayList ports = (ArrayList)server.getServerProperties().get(property);
        isServerToUninstall = ports.contains(port);
        if (ports == null)
        {
          isServerToUninstall = ports.contains(port);
        }
        else
        {
          // This occurs if the instance could not be loaded.
          ADSContext.ServerProperty adsProperty;
          if (isSecure)
          {
            adsProperty = ADSContext.ServerProperty.LDAPS_PORT;
          }
          else
          {
            adsProperty = ADSContext.ServerProperty.LDAPS_PORT;
          }
          String v = (String)server.getAdsProperties().get(adsProperty);
          if (v != null)
          {
            isServerToUninstall = v.equals(String.valueOf(port));
          }
        }
      }
      catch (Throwable t)
      {