| | |
| | | */ |
| | | private void promptIfRequiredForPortData(UserData uData) |
| | | { |
| | | String hostName = promptForHostNameIfRequired(); |
| | | uData.setHostName(hostName); |
| | | |
| | | LinkedList<Integer> usedPorts = new LinkedList<Integer>(); |
| | | // Determine the LDAP port number. |
| | | int ldapPort = promptIfRequiredForPortData(argParser.ldapPortArg, |
| | |
| | | boolean prompt = true; |
| | | if (!argParser.baseDNArg.isPresent()) |
| | | { |
| | | println(); |
| | | try |
| | | { |
| | | prompt = confirmAction(INFO_INSTALLDS_PROVIDE_BASE_DN_PROMPT.get(), |
| | |
| | | { |
| | | securityOptions = SecurityOptions.createSelfSignedCertificateOptions( |
| | | enableSSL, enableStartTLS, ldapsPort); |
| | | String hostName = promptForHostNameIfRequired(); |
| | | uData.setHostName(hostName); |
| | | } |
| | | else if (argParser.useJavaKeyStoreArg.isPresent()) |
| | | { |
| | |
| | | } |
| | | if (certType == SELF_SIGNED) |
| | | { |
| | | String hostName = promptForHostNameIfRequired(); |
| | | uData.setHostName(hostName); |
| | | securityOptions = SecurityOptions.createSelfSignedCertificateOptions( |
| | | enableSSL, enableStartTLS, ldapsPort); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private String promptForHostNameIfRequired() throws UserDataException |
| | | private String promptForHostNameIfRequired() |
| | | { |
| | | String hostName = null; |
| | | if (argParser.hostNameArg.isPresent()) |
| | |
| | | } |
| | | else |
| | | { |
| | | int nTries = 0; |
| | | println(); |
| | | while (hostName == null) |
| | | { |
| | | if (nTries >= CONFIRMATION_MAX_TRIES) |
| | | { |
| | | throw new UserDataException(null, |
| | | ERR_TRIES_LIMIT_REACHED.get(CONFIRMATION_MAX_TRIES)); |
| | | } |
| | | |
| | | try |
| | | { |
| | | hostName = readInput(INFO_INSTALLDS_PROMPT_HOST_NAME.get(), |