/** * {@inheritDoc} */ public final long getResponseTimeoutMillis(final LDAPConnection connection) { if ((responseTimeout < 0L) && (connection != null)) { return connection.getConnectionOptions().getResponseTimeoutMillis(); } else { return responseTimeout; } }
/** * {@inheritDoc} */ public final long getResponseTimeoutMillis(final LDAPConnection connection) { if ((responseTimeout < 0L) && (connection != null)) { return connection.getConnectionOptions().getResponseTimeoutMillis(); } else { return responseTimeout; } }
/** * Indicates whether to automatically follow any referrals encountered while * processing this request. If a value has been set for this request, then it * will be returned. Otherwise, the default from the connection options for * the provided connection will be used. * * @param connection The connection whose connection options may be used in * the course of making the determination. It must not * be {@code null}. * * @return {@code true} if any referrals encountered during processing should * be automatically followed, or {@code false} if not. */ public final boolean followReferrals(final LDAPConnection connection) { if (followReferrals == null) { return connection.getConnectionOptions().followReferrals(); } else { return followReferrals; } }
/** * 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; } }
/** * Indicates whether to automatically follow any referrals encountered while * processing this request. If a value has been set for this request, then it * will be returned. Otherwise, the default from the connection options for * the provided connection will be used. * * @param connection The connection whose connection options may be used in * the course of making the determination. It must not * be {@code null}. * * @return {@code true} if any referrals encountered during processing should * be automatically followed, or {@code false} if not. */ public final boolean followReferrals(final LDAPConnection connection) { if (followReferrals == null) { return connection.getConnectionOptions().followReferrals(); } else { return followReferrals; } }
/** * Notifies the disconnect handler that the associated connection has been * closed. */ void notifyDisconnectHandler() { final boolean alreadyNotified = handlerNotified.getAndSet(true); if (alreadyNotified) { return; } final DisconnectHandler handler = connection.getConnectionOptions().getDisconnectHandler(); if (handler != null) { handler.handleDisconnect(connection, host, port, type, message, cause); } }
/** * Notifies the disconnect handler that the associated connection has been * closed. */ void notifyDisconnectHandler() { final boolean alreadyNotified = handlerNotified.getAndSet(true); if (alreadyNotified) { return; } final DisconnectHandler handler = connection.getConnectionOptions().getDisconnectHandler(); if (handler != null) { handler.handleDisconnect(connection, host, port, type, message, cause); } }
/** * Specifies the maximum length of time to wait for the connection to be * established, in seconds. * * @param timeout The maximum length of time to wait for the connection to * be established. */ public void setConnectTimeout(final int timeout) { final LDAPConnectionOptions options = conn.getConnectionOptions(); if (timeout > 0) { options.setConnectTimeoutMillis(1000 * timeout); } else { options.setConnectTimeoutMillis(0); } conn.setConnectionOptions(options); }
DEFAULT_INPUT_BUFFER_SIZE); asn1StreamReader = new ASN1StreamReader(inputStream, connection.getConnectionOptions().getMaxMessageSize()); final LDAPConnectionOptions options = connection.getConnectionOptions(); final int connectTimeout = options.getConnectTimeoutMillis(); if (connectTimeout > 0)
connection.getConnectionOptions().autoReconnect(); return processSync(connection, depth, autoReconnect);
connection.getConnectionOptions().autoReconnect(); return processSync(connection, depth, autoReconnect);
connection.getConnectionOptions().getResponseTimeoutMillis();
connection.getConnectionOptions().getResponseTimeoutMillis();
connection.getConnectionOptions().autoReconnect(); return processSync(connection, autoReconnect); connection.getConnectionOptions().bindWithDNRequiresPassword())
/** * {@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); } }
connection.getConnectionOptions(); @SuppressWarnings("deprecation") final boolean autoReconnect = connectionOptions.autoReconnect();
connection.getConnectionOptions(); @SuppressWarnings("deprecation") final boolean autoReconnect = connectionOptions.autoReconnect();
if (connection.getConnectionOptions().abandonOnTimeout())
if (connection.getConnectionOptions().abandonOnTimeout())