| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.naming.NamingException; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.LdapException; |
| | | import org.opends.admin.ads.util.ConnectionWrapper; |
| | | import org.opends.admin.ads.util.PreferredConnection.Type; |
| | | import org.opends.quicksetup.Application; |
| | | import org.opends.quicksetup.ApplicationException; |
| | | import org.opends.quicksetup.Configuration; |
| | | import org.opends.quicksetup.Installation; |
| | | import org.opends.quicksetup.ReturnCode; |
| | | import org.opends.quicksetup.installer.InstallerHelper; |
| | | import org.opends.server.types.HostPort; |
| | | import org.opends.server.util.SetupUtils; |
| | | |
| | | import com.forgerock.opendj.cli.CliConstants; |
| | |
| | | import static com.forgerock.opendj.cli.Utils.*; |
| | | import static com.forgerock.opendj.util.OperatingSystem.*; |
| | | |
| | | import static org.opends.admin.ads.util.PreferredConnection.Type.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.server.util.CollectionUtils.*; |
| | | |
| | |
| | | |
| | | for (int i=0; i<50 && !connected; i++) |
| | | { |
| | | String hostName = getHostName(i); |
| | | String ldapUrl = "ldaps://"+hostName+":" + port; |
| | | try |
| | | int timeout = CliConstants.DEFAULT_LDAP_CONNECT_TIMEOUT; |
| | | if (application != null && application.getUserData() != null) |
| | | { |
| | | int timeout = CliConstants.DEFAULT_LDAP_CONNECT_TIMEOUT; |
| | | if (application != null && application.getUserData() != null) |
| | | { |
| | | timeout = application.getUserData().getConnectTimeout(); |
| | | } |
| | | try (ConnectionWrapper conn = |
| | | new ConnectionWrapper(ldapUrl, Type.LDAPS, userDn, userPw, timeout, null)) |
| | | { |
| | | return; |
| | | } |
| | | timeout = application.getUserData().getConnectTimeout(); |
| | | } |
| | | catch (NamingException ne) |
| | | HostPort hp = new HostPort(getHostName(i), port); |
| | | try (ConnectionWrapper conn = new ConnectionWrapper(hp, LDAPS, userDn, userPw, timeout, null)) |
| | | { |
| | | return; |
| | | } |
| | | catch (LdapException ne) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Could not connect to server: "+ne, ne)); |
| | | } |