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

jvergara
17.45.2009 2ad60cfec2ff93847fc648a335a9a8dced5060cd
Update some messages to avoid using the term 'OpenDS'.  This helps to make productization easier.
Change the name of the return code CANCELLED to CANCELED to be consistent with the rest of the code..
When we start the server, use the administration port to connect to the server instead of the LDAP port, since we know that there is always an administration port but not necessarily an LDAP port.
15 files modified
135 ■■■■■ changed files
opends/src/messages/messages/quicksetup.properties 1 ●●●● patch | view | raw | blame | history
opends/src/messages/messages/tools.properties 38 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/Configuration.java 41 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/Launcher.java 6 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java 2 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/ReturnCode.java 6 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java 4 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java 2 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java 4 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/MigrationManager.java 4 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/ReversionIssueNotifier.java 2 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java 4 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeIssueNotifier.java 2 ●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 6 ●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java 13 ●●●● patch | view | raw | blame | history
opends/src/messages/messages/quicksetup.properties
@@ -551,6 +551,7 @@
INFO_INITIALIZE_PROGRESS_WITH_UNPROCESSED=%s remaining to be processed.
INFO_INSTALL_SERVER_MUST_BE_TEMPORARILY_STARTED=The Server will be \
 temporarily started.
INFO_INSTALL_CANCELED=Setup canceled.
INFO_INSTALLANDUPGRADE_WELCOME_PANEL_INSTRUCTIONS=The OpenDS QuickSetup tool \
 can either install and configure a new server instance or upgrade an existing \
 server instance. In either case, QuickSetup will use the latest weekly build, \
opends/src/messages/messages/tools.properties
@@ -925,7 +925,7 @@
 while attempting to create the base LDIF file:  %s
INFO_INSTALLDS_STATUS_IMPORTING_LDIF_519=Importing the LDIF data into the \
 Directory Server database...
INFO_INSTALLDS_STATUS_SUCCESS_520=The OpenDS setup process has completed \
INFO_INSTALLDS_STATUS_SUCCESS_520=The server setup process has completed \
 successfully
INFO_INSTALLDS_PROMPT_VALUE_YES_521=yes
INFO_INSTALLDS_PROMPT_VALUE_NO_522=no
@@ -1430,21 +1430,21 @@
SEVERE_ERR_TOOL_ERROR_MESSAGE_811=Additional Information:  %s
SEVERE_ERR_TOOL_MATCHED_DN_812=Matched DN:  %s
SEVERE_ERR_WINDOWS_SERVICE_NOT_FOUND_813=Could not find the service name for \
 OpenDS
 the server
SEVERE_ERR_WINDOWS_SERVICE_START_ERROR_814=An unexpected error occurred \
 starting OpenDS as a windows service
 starting the server as a windows service
SEVERE_ERR_WINDOWS_SERVICE_STOP_ERROR_815=An unexpected error occurred \
 stopping the OpenDS windows service
 stopping the server windows service
INFO_CONFIGURE_WINDOWS_SERVICE_TOOL_DESCRIPTION_816=This utility can be used \
 to configure OpenDS as a Windows service
 to configure the server as a Windows service
INFO_CONFIGURE_WINDOWS_SERVICE_DESCRIPTION_SHOWUSAGE_817=Display this usage \
 information
INFO_CONFIGURE_WINDOWS_SERVICE_DESCRIPTION_ENABLE_818=Enables OpenDS as a \
INFO_CONFIGURE_WINDOWS_SERVICE_DESCRIPTION_ENABLE_818=Enables the server as a \
 Windows service
INFO_CONFIGURE_WINDOWS_SERVICE_DESCRIPTION_DISABLE_819=Disables OpenDS as a \
 Windows service and stops the server
INFO_CONFIGURE_WINDOWS_SERVICE_DESCRIPTION_DISABLE_819=Disables the server as \
 a Windows service and stops the server
INFO_CONFIGURE_WINDOWS_SERVICE_DESCRIPTION_STATE_820=Provides information \
 about the state of OpenDS as a Windows service
 about the state of the server as a Windows service
SEVERE_ERR_CONFIGURE_WINDOWS_SERVICE_TOO_MANY_ARGS_823=You can only provide \
 one of the following arguments:\nenableService, disableService, serviceState \
 or cleanupService
@@ -1472,7 +1472,7 @@
 for deletion as a Windows Service
SEVERE_ERR_WINDOWS_SERVICE_DISABLE_ERROR_834=An unexpected error occurred \
 trying to disable the server as a Windows service%nCheck that you have \
 administrator rights (only Administrators can disable OpenDS as a Windows \
 administrator rights (only Administrators can disable the server as a Windows \
 Service)
INFO_WINDOWS_SERVICE_ENABLED_835=The server is enabled as a Windows service.  \
 The service name for the server is: %s
@@ -1486,14 +1486,14 @@
 which the command will write the output
SEVERE_WARN_WAIT4DEL_CANNOT_OPEN_OUTPUT_FILE_840=WARNING:  Unable to open \
 output file %s for writing:  %s
INFO_INSTALLDS_ENABLING_WINDOWS_SERVICE_841=Enabling OpenDS as a Windows \
INFO_INSTALLDS_ENABLING_WINDOWS_SERVICE_841=Enabling the server as a Windows \
 service...
INFO_INSTALLDS_PROMPT_ENABLE_SERVICE_842=Enable OpenDS to run as a Windows \
INFO_INSTALLDS_PROMPT_ENABLE_SERVICE_842=Enable the server to run as a Windows \
 Service?
INFO_INSTALLDS_DESCRIPTION_ENABLE_WINDOWS_SERVICE_843=Enable OpenDS to run as \
 a Windows Service
INFO_INSTALLDS_DESCRIPTION_ENABLE_WINDOWS_SERVICE_843=Enable the server to run \
 as a Windows Service
INFO_CONFIGURE_WINDOWS_SERVICE_DESCRIPTION_CLEANUP_844=Allows to disable the \
 OpenDS service and to clean up the windows registry information associated \
 server service and to clean up the windows registry information associated \
 with the provided service name
INFO_WINDOWS_SERVICE_CLEANUP_SUCCESS_845=Clean up of service %s was \
 successful
@@ -1814,7 +1814,7 @@
SEVERE_ERR_PWPSTATE_CANNOT_CONNECT_1189=ERROR:  Cannot establish a connection to \
 the Directory Server %s.  Verify that the server is running and that \
 the provided credentials are valid.  Details:  %s
INFO_UPGRADE_DESCRIPTION_FILE_1190=Specifies an existing OpenDS package \
INFO_UPGRADE_DESCRIPTION_FILE_1190=Specifies an existing server package \
 (.zip) file to which the current build will be upgraded using the command \
 line version of this tool
INFO_UPGRADE_DESCRIPTION_NO_PROMPT_1191=Use non-interactive mode.  Prompt for \
@@ -2206,11 +2206,11 @@
SEVERE_ERR_INSTALLDS_TOO_MANY_KEYSTORE_PASSWORD_TRIES_1485=The maximum number \
 of tries to provide the certificate key store PIN is %s.  Install canceled
INFO_JAVAPROPERTIES_TOOL_DESCRIPTION_1486=This utility can be used to change \
 the java arguments and java home that are used by the different OpenDS \
 the java arguments and java home that are used by the different server \
 commands.%n%nBefore launching the command, edit the properties file located \
 in %s to specify the java arguments and java home. When you have edited the \
 properties file, run this command for the changes to be taken into account.\
 %n%nNote that the changes will only apply to this OpenDS installation. No \
 %n%nNote that the changes will only apply to this server installation. No \
 modifications will be made to your environment variables
INFO_JAVAPROPERTIES_DESCRIPTION_SILENT_1487=Run the tool in quiet mode.  Quiet \
 mode will not output progress information to standard output
@@ -2229,7 +2229,7 @@
INFO_JAVAPROPERTIES_SUCCESSFUL_NON_DEFAULT_1494=The script file %s was \
 successfully created.  For the command-lines to use the java properties \
 specified on %s you must copy the created script file to %s
INFO_JAVAPROPERTIES_SUCCESSFUL_1495=The operation was successful.  The OpenDS \
INFO_JAVAPROPERTIES_SUCCESSFUL_1495=The operation was successful.  The server \
 commands will use the java arguments and java home specified in the \
 properties file located in %s
INFO_DESCRIPTION_TEST_IF_OFFLINE_1496=When this is set test if the command \
opends/src/quicksetup/org/opends/quicksetup/Configuration.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup;
@@ -96,6 +96,18 @@
  }
  /**
   * Provides the administration port as is specified in the config.ldif file.
   *
   * @return the administration port specified in the config.ldif file.
   * @throws IOException if there were problems reading the information from
   * the configuration file.
   */
  public int getAdminConnectorPort() throws IOException
  {
    return getAdminConnectorPort("ds-cfg-listen-port");
  }
  /**
   * Tells whether this server is configured as a replication server or not.
   * @return <CODE>true</CODE> if the server is configured as a Replication
   * Server and <CODE>false</CODE> otherwise.
@@ -182,6 +194,33 @@
    return port;
  }
  private int getAdminConnectorPort(String portAttr) throws IOException {
    int port = -1;
    String contents = getLowerCaseContents();
    int index = contents.indexOf("cn=administration connector");
    if (index != -1) {
      String attrWithPoints = portAttr + ":";
      int index1 = contents.indexOf(attrWithPoints, index);
      if (index1 != -1) {
        int index2 =
                contents.indexOf(Constants.LINE_SEPARATOR, index1);
        if (index2 != -1) {
          String sPort =
                  contents.substring(attrWithPoints.length() +
                          index1,
                          index2).trim();
          try {
            port = Integer.parseInt(sPort);
          } catch (NumberFormatException nfe) {
            // do nothing;
          }
        }
      }
    }
    return port;
  }
  /**
   * Indicates whether the config.ldif file has been modified (compared to what
   * we had in the zip file). This is used to know if we have configured the
opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup;
@@ -296,9 +296,9 @@
      printUsage(true);
      System.exit(ReturnCode.USER_DATA_ERROR.getReturnCode());
    }
    else if (returnValue.equals(ReturnCode.CANCELLED))
    else if (returnValue.equals(ReturnCode.CANCELED))
    {
      System.exit(ReturnCode.CANCELLED.getReturnCode());
      System.exit(ReturnCode.CANCELED.getReturnCode());
    }
    else if (returnValue.equals(ReturnCode.USER_INPUT_ERROR))
    {
opends/src/quicksetup/org/opends/quicksetup/QuickSetupCli.java
@@ -135,7 +135,7 @@
      else
      {
        // User cancelled operation.
        returnValue = ReturnCode.CANCELLED;
        returnValue = ReturnCode.CANCELED;
      }
    }
    catch (UserDataException uude)
opends/src/quicksetup/org/opends/quicksetup/ReturnCode.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup;
@@ -38,9 +38,9 @@
  public static final ReturnCode SUCCESSFUL = new ReturnCode(0);
  /**
   * Return code: User Cancelled uninstall.
   * Return code: User Cancelled operation.
   */
  public static final ReturnCode CANCELLED = new ReturnCode(0);
  public static final ReturnCode CANCELED = new ReturnCode(0);
  /**
   * Return code: User provided invalid data.
opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -2136,8 +2136,8 @@
      setCurrentProgressStep(InstallProgressStep.CANCELING);
      notifyListeners(null);
      throw new ApplicationException(
          ReturnCode.CANCELLED,
            INFO_UPGRADE_CANCELED.get(), null);
          ReturnCode.CANCELED,
          INFO_INSTALL_CANCELED.get(), null);
    }
  }
opends/src/quicksetup/org/opends/quicksetup/installer/offline/OfflineInstaller.java
@@ -227,7 +227,7 @@
    } catch (ApplicationException ex)
    {
      LOG.log(Level.SEVERE, "Caught exception: "+ex, ex);
      if (ReturnCode.CANCELLED.equals(ex.getType())) {
      if (ReturnCode.CANCELED.equals(ex.getType())) {
        uninstall();
        setCurrentProgressStep(InstallProgressStep.FINISHED_CANCELED);
        notifyListeners(null);
opends/src/quicksetup/org/opends/quicksetup/installer/webstart/WebStartInstaller.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.installer.webstart;
@@ -269,7 +269,7 @@
    } catch (ApplicationException ex)
    {
      if (ReturnCode.CANCELLED.equals(ex.getType())) {
      if (ReturnCode.CANCELED.equals(ex.getType())) {
        uninstall(downloadedBits);
        setCurrentProgressStep(InstallProgressStep.FINISHED_CANCELED);
opends/src/quicksetup/org/opends/quicksetup/upgrader/MigrationManager.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.upgrader;
@@ -374,7 +374,7 @@
            // do nothing; will retry;
          } else {
            throw new ApplicationException(
                ReturnCode.CANCELLED,
                ReturnCode.CANCELED,
                INFO_UPGRADE_CANCELED.get(), firstException);
          }
        } else {
opends/src/quicksetup/org/opends/quicksetup/upgrader/ReversionIssueNotifier.java
@@ -151,7 +151,7 @@
                    new Message[]{cont, cancel},
                    defaultAction))) {
              throw new ApplicationException(
                  ReturnCode.CANCELLED,
                  ReturnCode.CANCELED,
                      INFO_REVERSION_CANCELED.get(), null);
            }
          }
opends/src/quicksetup/org/opends/quicksetup/upgrader/Reverter.java
@@ -541,7 +541,7 @@
                new Message[] { cont, cancel },
                cont))) {
          throw new ApplicationException(
              ReturnCode.CANCELLED,
              ReturnCode.CANCELED,
              INFO_REVERSION_CANCELED.get(), null);
        }
      }
@@ -641,7 +641,7 @@
                Message.raw(e.getLocalizedMessage()), e);
      } else {
        runError = (ApplicationException)e;
        abort = ReturnCode.CANCELLED.equals(
        abort = ReturnCode.CANCELED.equals(
                ((ApplicationException)e).getType());
      }
    } finally {
opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeIssueNotifier.java
@@ -152,7 +152,7 @@
                    new Message[]{cont, cancel},
                    defaultAction))) {
              throw new ApplicationException(
                  ReturnCode.CANCELLED,
                  ReturnCode.CANCELED,
                      INFO_UPGRADE_CANCELED.get(), null);
            }
          }
opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -851,7 +851,7 @@
                    || (response.toLowerCase().equals(no.toLowerCase()))
                    || (response.length() == 0))
                {
                  System.exit(ReturnCode.CANCELLED.getReturnCode());
                  System.exit(ReturnCode.CANCELED.getReturnCode());
                }
                else if (response.toLowerCase().equals(yes.toLowerCase()))
                {
@@ -1317,7 +1317,7 @@
      // We don't consider a  user cancelation exception
      // to be an error.
      if (ae.getType() != ReturnCode.CANCELLED) {
      if (ae.getType() != ReturnCode.CANCELED) {
        this.runError = ae;
      } else {
        this.abort = true;
@@ -1497,7 +1497,7 @@
   */
  public void checkAbort() throws ApplicationException {
    if (abort) throw new ApplicationException(
        ReturnCode.CANCELLED,
        ReturnCode.CANCELED,
            INFO_UPGRADE_CANCELED.get(), null);
  }
opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -426,7 +426,7 @@
           */
          boolean connected = false;
          Configuration config = installation.getCurrentConfiguration();
          int port = config.getPort();
          int port = config.getAdminConnectorPort();
          String hostName = null;
          if (application != null)
          {
@@ -437,7 +437,7 @@
            hostName = "localhost";
          }
          hostName = ConnectionUtils.getHostNameForLdapUrl(hostName);
          String ldapUrl = "ldap://"+hostName+":" + port;
          String ldapUrl = "ldaps://"+hostName+":" + port;
          // See if the application has prompted for credentials.  If
          // not we'll just try to connect anonymously.
@@ -459,20 +459,20 @@
            {
              // Try with local host.  This might be necessary in certain
              // network configurations.
              ldapUrl = "ldap://localhost:" + port;
              ldapUrl = "ldaps://localhost:" + port;
            }
            if (i == 15)
            {
              // Try with 0.0.0.0.  This might be necessary in certain
              // network configurations.
              ldapUrl = "ldap://0.0.0.0:" + port;
              ldapUrl = "ldaps://0.0.0.0:" + port;
            }
            try
            {
              ctx = Utils.createLdapContext(
              ctx = Utils.createLdapsContext(
                  ldapUrl,
                  userDn, userPw, ConnectionUtils.getDefaultLDAPTimeout(),
                  null);
                  null, null);
              connected = true;
            }
            catch (NamingException ne)
@@ -523,7 +523,6 @@
            }
          }
        }
      } catch (IOException ioe)
      {
        throw new ApplicationException(