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

jcduff
23.04.2008 f73b655466092169abac34833fb628fce1fcdebe
opends/src/quicksetup/org/opends/quicksetup/UserData.java
@@ -55,6 +55,8 @@
  private int serverPort;
  private int adminConnectorPort;
  private String directoryManagerDn;
  private String directoryManagerPwd;
@@ -117,6 +119,13 @@
      setServerPort(defaultPort);
    }
//  See what we can propose as port
    defaultPort = getDefaultAdminConnectorPort();
    if (defaultPort != -1)
    {
      setAdminConnectorPort(defaultPort);
    }
    setHostName(getDefaultHostName());
    setDirectoryManagerDn(Constants.DIRECTORY_MANAGER_DN);
@@ -195,6 +204,24 @@
  }
  /**
   * Sets the admin connector port.
   * @param adminConnectorPort the new admin connector port.
   */
  public void setAdminConnectorPort(int adminConnectorPort)
  {
    this.adminConnectorPort = adminConnectorPort;
  }
  /**
   * Returns the admin connector port.
   * @return the admin connector port.
   */
  public int getAdminConnectorPort()
  {
    return adminConnectorPort;
  }
  /**
   * Sets the server JMX port.
   * @param serverJMXPort the new server JMX port.
   */
@@ -560,6 +587,29 @@
  }
  /**
   * Provides the administration port that will be proposed to the user in the
   * second page of the installation wizard. It will check whether we can use
   * ports of type X444 and if not it will return -1.
   *
   * @return the free port of type x444 if it is available and we can use and -1
   * if not.
   */
  static public int getDefaultAdminConnectorPort()
  {
    int defaultPort = -1;
    for (int i=0;i<10000 && (defaultPort == -1);i+=1000)
    {
      int port = i + 4444;
      if (Utils.canUseAsPort(port))
      {
        defaultPort = port;
      }
    }
    return defaultPort;
  }
  /**
   * Provides the port that will be proposed to the user in the security dialog
   *  of the installation wizard. It will check whether we can use ports of type
   * X636 and if not it will return -1.