| | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.messages.UtilityMessages.*; |
| | | import static org.opends.quicksetup.util.Utils.getFirstValue; |
| | | import static org.opends.quicksetup.util.Utils.getThrowableMsg; |
| | | |
| | |
| | | String bindDn1 = argParser.getBindDn1(); |
| | | String pwd1 = argParser.getBindPassword1(); |
| | | |
| | | initializeGlobalArguments(host1, port1, useSSL1, |
| | | useStartTLS1, adminUid, bindDn1, (pwd1 != null) ? pwd1 : adminPwd); |
| | | String pwd = null; |
| | | if (pwd1 != null) |
| | | { |
| | | pwd = pwd1; |
| | | } |
| | | else if (bindDn1 != null) |
| | | { |
| | | pwd = null; |
| | | } |
| | | else |
| | | { |
| | | pwd = adminPwd; |
| | | } |
| | | |
| | | initializeGlobalArguments(host1, port1, useSSL1, useStartTLS1, adminUid, |
| | | bindDn1, pwd); |
| | | InitialLdapContext ctx1 = null; |
| | | |
| | | while ((ctx1 == null) && !cancelled) |
| | |
| | | useStartTLS1 = ci.useStartTLS(); |
| | | host1 = ci.getHostName(); |
| | | port1 = ci.getPortNumber(); |
| | | adminUid = ci.getAdministratorUID(); |
| | | if (adminUid != null) |
| | | if (ci.getProvidedAdminUID() != null) |
| | | { |
| | | adminPwd = ci.getBindPassword(); |
| | | adminUid = ci.getProvidedAdminUID(); |
| | | if (ci.getProvidedBindDN() == null) |
| | | { |
| | | // If the explicitit bind DN is not null, the password corresponds |
| | | // to that bind DN. We are in the case where the user provides |
| | | // bind DN on first server and admin UID globally. |
| | | adminPwd = ci.getBindPassword(); |
| | | } |
| | | } |
| | | bindDn1 = ci.getBindDN(); |
| | | pwd1 = ci.getBindPassword(); |
| | |
| | | useStartTLS2 = argParser.useStartTLS2(); |
| | | bindDn2 = argParser.getBindDn2(); |
| | | pwd2 = argParser.getBindPassword2(); |
| | | String pwd; |
| | | if (pwd2 != null) |
| | | { |
| | | pwd = pwd2; |
| | |
| | | useStartTLS2 = ci.useStartTLS(); |
| | | host2 = ci.getHostName(); |
| | | port2 = ci.getPortNumber(); |
| | | adminUid = ci.getAdministratorUID(); |
| | | if (ci.getProvidedAdminUID() != null) |
| | | { |
| | | adminUid = ci.getProvidedAdminUID(); |
| | | adminPwd = ci.getBindPassword(); |
| | | } |
| | | bindDn2 = ci.getBindDN(); |
| | | pwd2 = ci.getBindPassword(); |
| | | |
| | |
| | | useStartTLS = ci.useStartTLS(); |
| | | host = ci.getHostName(); |
| | | port = ci.getPortNumber(); |
| | | bindDn = ci.getBindDN(); |
| | | adminUid = ci.getAdministratorUID(); |
| | | bindDn = ci.getProvidedBindDN(); |
| | | adminUid = ci.getProvidedAdminUID(); |
| | | adminPwd = ci.getBindPassword(); |
| | | |
| | | ctx = createInitialLdapContextInteracting(ci); |
| | |
| | | argParser.getSecureArgsList().hostNameArg.addValue(hostName); |
| | | argParser.getSecureArgsList().hostNameArg.setPresent(true); |
| | | } |
| | | // resetConnectionArguments does not clear the values for the port |
| | | argParser.getSecureArgsList().portArg.clearValues(); |
| | | if (port != -1) |
| | | { |
| | | argParser.getSecureArgsList().portArg.addValue(String.valueOf(port)); |
| | |
| | | } |
| | | else |
| | | { |
| | | argParser.getSecureArgsList().portArg.clearValues(); |
| | | // This is done to be able to call IntegerArgument.getIntValue() |
| | | argParser.getSecureArgsList().portArg.addValue( |
| | | argParser.getSecureArgsList().portArg.getDefaultValue()); |