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

jvergara
20.11.2007 8d835516c552ffa67333e3f6200a386159be9cdb
opendj-sdk/opends/src/server/org/opends/server/tools/ConfigureDS.java
@@ -28,7 +28,9 @@
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import org.opends.server.api.ConfigHandler;
import org.opends.server.config.BooleanConfigAttribute;
@@ -329,6 +331,54 @@
      return 1;
    }
    try
    {
      Set<Integer> ports = new HashSet<Integer>();
      if (ldapPort.isPresent())
      {
        ports.add(ldapPort.getIntValue());
      }
      if (ldapsPort.isPresent())
      {
        if (ports.contains(ldapsPort.getIntValue()))
        {
          int    msgID   = MSGID_CONFIGDS_PORT_ALREADY_SPECIFIED;
          String message = getMessage(msgID,
              String.valueOf(ldapsPort.getIntValue()));
          System.err.println(wrapText(message, MAX_LINE_WIDTH));
          System.err.println(argParser.getUsage());
          return 1;
        }
        else
        {
          ports.add(ldapsPort.getIntValue());
        }
      }
      if (jmxPort.isPresent())
      {
        if (ports.contains(jmxPort.getIntValue()))
        {
          int    msgID   = MSGID_CONFIGDS_PORT_ALREADY_SPECIFIED;
          String message = getMessage(msgID,
              String.valueOf(jmxPort.getIntValue()));
          System.err.println(wrapText(message, MAX_LINE_WIDTH));
          System.err.println(argParser.getUsage());
          return 1;
        }
        else
        {
          ports.add(jmxPort.getIntValue());
        }
      }
    }
    catch (ArgumentException ae)
    {
      int    msgID   = MSGID_CANNOT_INITIALIZE_ARGS;
      String message = getMessage(msgID, ae.getMessage());
      System.err.println(wrapText(message, MAX_LINE_WIDTH));
      return 1;
    }
    // Initialize the Directory Server configuration handler using the
    // information that was provided.