/** * Retrieves the maximum length of time to wait for the connection to be * established, in seconds. * * @return The maximum length of time to wait for the connection to be * established. */ public int getConnectTimeout() { final int connectTimeoutMillis = conn.getConnectionOptions().getConnectTimeoutMillis(); if (connectTimeoutMillis > 0) { return Math.max(1, (connectTimeoutMillis / 1000)); } else { return 0; } }
/** * Establishes an unauthenticated connection to the directory server using the * provided information. If the connection is already established, then it * will be closed and re-established. * <BR><BR> * If this method is invoked while any operations are in progress on this * connection, then the directory server may or may not abort processing for * those operations, depending on the type of operation and how far along the * server has already gotten while processing that operation. It is * recommended that all active operations be abandoned, canceled, or allowed * to complete before attempting to re-establish an active connection. * * @param host The string representation of the address of the server to * which the connection should be established. It may be a * resolvable name or an IP address. It must not be * {@code null}. * @param port The port number of the server to which the connection should * be established. It should be a value between 1 and 65535, * inclusive. * * @throws LDAPException If an error occurs while attempting to establish * the connection. */ public void connect(final String host, final int port) throws LDAPException { connect(host, port, connectionOptions.getConnectTimeoutMillis()); }
/** * Establishes an unauthenticated connection to the directory server using the * provided information. If the connection is already established, then it * will be closed and re-established. * <BR><BR> * If this method is invoked while any operations are in progress on this * connection, then the directory server may or may not abort processing for * those operations, depending on the type of operation and how far along the * server has already gotten while processing that operation. It is * recommended that all active operations be abandoned, canceled, or allowed * to complete before attempting to re-establish an active connection. * * @param host The string representation of the address of the server to * which the connection should be established. It may be a * resolvable name or an IP address. It must not be * {@code null}. * @param port The port number of the server to which the connection should * be established. It should be a value between 1 and 65535, * inclusive. * * @throws LDAPException If an error occurs while attempting to establish * the connection. */ @ThreadSafety(level=ThreadSafetyLevel.METHOD_NOT_THREADSAFE) public void connect(final String host, final int port) throws LDAPException { connect(host, port, connectionOptions.getConnectTimeoutMillis()); }
connectionOptions.getConnectTimeoutMillis(); if ((connectTimeout > 0L) && (connectTimeout < Integer.MAX_VALUE))
final int connectTimeout = options.getConnectTimeoutMillis(); if (connectTimeout > 0)
final int connectTimeout = options.getConnectTimeoutMillis(); if (connectTimeout > 0)
/** * {@inheritDoc} */ public void processPreAuthenticatedConnection(final LDAPConnection connection) throws LDAPException { final StartTLSExtendedRequest startTLSRequest; if (sslContext == null) { startTLSRequest = new StartTLSExtendedRequest(sslSocketFactory); } else { startTLSRequest = new StartTLSExtendedRequest(sslContext); } // Since the StartTLS processing will occur during the course of // establishing the connection for use in the pool, set the connect timeout // for the operation to be equal to the connect timeout from the connection // options. final LDAPConnectionOptions opts = connection.getConnectionOptions(); startTLSRequest.setResponseTimeoutMillis(opts.getConnectTimeoutMillis()); final ExtendedResult r = connection.processExtendedOperation(startTLSRequest); if (! r.getResultCode().equals(ResultCode.SUCCESS)) { throw new LDAPExtendedOperationException(r); } }
/** * {@inheritDoc} */ public void processPreAuthenticatedConnection(final LDAPConnection connection) throws LDAPException { final StartTLSExtendedRequest startTLSRequest; if (sslContext == null) { startTLSRequest = new StartTLSExtendedRequest(sslSocketFactory); } else { startTLSRequest = new StartTLSExtendedRequest(sslContext); } // Since the StartTLS processing will occur during the course of // establishing the connection for use in the pool, set the connect timeout // for the operation to be equal to the connect timeout from the connection // options. final LDAPConnectionOptions opts = connection.getConnectionOptions(); startTLSRequest.setResponseTimeoutMillis(opts.getConnectTimeoutMillis()); final ExtendedResult r = connection.processExtendedOperation(startTLSRequest); if (! r.getResultCode().equals(ResultCode.SUCCESS)) { throw new LDAPExtendedOperationException(r); } }
connectionOptions.getConnectTimeoutMillis()); if (healthCheck != null)
final int connectTimeout = connectionOptions.getConnectTimeoutMillis(); if (connectTimeout > 0)
final int connectTimeout = connectionOptions.getConnectTimeoutMillis(); if (connectTimeout > 0)
getConnectTimeoutMillis(); if (connectTimeout > 0)
getConnectTimeoutMillis(); if (connectTimeout > 0)