throws LDAPException final LDAPConnection conn = getConnection(); releaseConnection(conn); return rootDSE; throwLDAPExceptionIfShouldNotRetry(t, OperationType.SEARCH, conn); final LDAPConnection newConn = replaceDefunctConnection(t, conn); releaseConnection(newConn); return rootDSE; throwLDAPException(t2, newConn);
/** * Releases the provided connection back to the pool after an exception has * been encountered while processing an operation on that connection. The * connection pool health check instance associated with this pool will be * used to determine whether the provided connection is still valid and will * either release it back for use in processing other operations on the * connection or will terminate the connection and create a new one to take * its place. * * @param connection The connection to be evaluated and released back to the * pool or replaced with a new connection. * @param exception The exception caught while processing an operation on * the connection. */ public final void releaseConnectionAfterException( final LDAPConnection connection, final LDAPException exception) { final LDAPConnectionPoolHealthCheck healthCheck = getHealthCheck(); try { healthCheck.ensureConnectionValidAfterException(connection, exception); releaseConnection(connection); } catch (LDAPException le) { debugException(le); releaseDefunctConnection(connection); } }
/** * Processes the provided add request using a connection from this connection * pool. * * @param addRequest The add request to be processed. It must not be * {@code null}. * * @return The result of processing the add operation. * * @throws LDAPException If the server rejects the add request, or if a * problem is encountered while sending the request or * reading the response. */ public final LDAPResult add(final ReadOnlyAddRequest addRequest) throws LDAPException { return add((AddRequest) addRequest); }
try conn = getConnection(); releaseConnection(conn); return entry; throwLDAPSearchExceptionIfShouldNotRetry(t, conn); try newConn = replaceDefunctConnection(t, conn); releaseConnection(newConn); return entry; throwLDAPSearchException(t2, newConn);
try conn = getConnection(); releaseDefunctConnection(conn); releaseConnection(conn);
/** * Handles the provided {@code Throwable} object by ensuring that the provided * connection is released to the pool and throwing an appropriate * {@code LDAPException} object. * * @param t The {@code Throwable} object that was caught. * @param conn The connection to be released to the pool. * * @throws LDAPException To indicate that a problem occurred during LDAP * processing. */ void throwLDAPException(final Throwable t, final LDAPConnection conn) throws LDAPException { debugException(t); if (t instanceof LDAPException) { final LDAPException le = (LDAPException) t; releaseConnectionAfterException(conn, le); throw le; } else { releaseDefunctConnection(conn); throw new LDAPException(ResultCode.LOCAL_ERROR, ERR_POOL_OP_EXCEPTION.get(getExceptionMessage(t)), t); } }
public static void releaseDefunct(LDAPConnection connection) { if (connection != null && connection.getConnectionPool() != null) connection.getConnectionPool().releaseDefunctConnection(connection); }
if (timeSinceLastCheck >= pool.getHealthCheckIntervalMillis()) pool.doHealthCheck(); (pool.getHealthCheckIntervalMillis() - timeSinceLastCheck), 30000L); try
public static void releaseConnection(LDAPConnection connection) { if (connection != null && connection.getConnectionPool() != null) connection.getConnectionPool().releaseConnection(connection); }
public static void releaseConnectionAfterException(LDAPConnection connection, LDAPException e) { if (connection != null && connection.getConnectionPool() != null) connection.getConnectionPool().releaseConnectionAfterException(connection, e); }
/** * Processes the provided delete request using a connection from this * connection pool. * * @param deleteRequest The delete request to be processed. It must not be * {@code null}. * * @return The result of processing the delete operation. * * @throws LDAPException If the server rejects the delete request, or if a * problem is encountered while sending the request or * reading the response. */ public final LDAPResult delete(final ReadOnlyDeleteRequest deleteRequest) throws LDAPException { return delete((DeleteRequest) deleteRequest); }
/** * Processes the provided compare request using a connection from this * connection pool. * * @param compareRequest The compare request to be processed. It must not * be {@code null}. * * @return The result of processing the compare operation. * * @throws LDAPException If the server rejects the compare request, or if a * problem is encountered while sending the request or * reading the response. */ public final CompareResult compare( final ReadOnlyCompareRequest compareRequest) throws LDAPException { return compare((CompareRequest) compareRequest); }
/** * Processes a simple bind request with the provided DN and password using a * connection from this connection pool. Note that this will impact the state * of the connection in the pool, and therefore this method should only be * used if this connection pool is used exclusively for processing bind * operations, or if the retain identity request control (only available in * the Commercial Edition of the LDAP SDK for use with the Ping Identity, * UnboundID, or Alcatel-Lucent 8661 Directory Server) is included in the bind * request to ensure that the authentication state is not impacted. * * @param bindDN The bind DN for the bind operation. * @param password The password for the simple bind operation. * * @return The result of processing the bind operation. * * @throws LDAPException If the server rejects the bind request, or if a * problem occurs while sending the request or reading * the response. */ public final BindResult bind(final String bindDN, final String password) throws LDAPException { return bind(new SimpleBindRequest(bindDN, password)); }
/** * Closes the connection. */ public void run() { final AbstractConnectionPool pool = connection.getConnectionPool(); if (pool != null) { final LDAPConnectionPoolStatistics stats = pool.getConnectionPoolStatistics(); if (stats != null) { stats.incrementNumConnectionsClosedUnneeded(); } } connection.setDisconnectInfo(DisconnectType.POOL_CLOSED, null, null); if (unbind) { connection.terminate(null); } else { connection.setClosed(); } } }
try conn = getConnection(); releaseConnection(conn); return entry; throwLDAPSearchExceptionIfShouldNotRetry(t, conn); try newConn = replaceDefunctConnection(t, conn); releaseConnection(newConn); return entry; throwLDAPSearchException(t2, newConn);
try conn = getConnection(); releaseDefunctConnection(conn); releaseConnection(conn);
/** * Handles the provided {@code Throwable} object by ensuring that the provided * connection is released to the pool and throwing an appropriate * {@code LDAPException} object. * * @param t The {@code Throwable} object that was caught. * @param conn The connection to be released to the pool. * * @throws LDAPException To indicate that a problem occurred during LDAP * processing. */ void throwLDAPException(final Throwable t, final LDAPConnection conn) throws LDAPException { debugException(t); if (t instanceof LDAPException) { final LDAPException le = (LDAPException) t; releaseConnectionAfterException(conn, le); throw le; } else { releaseDefunctConnection(conn); throw new LDAPException(ResultCode.LOCAL_ERROR, ERR_POOL_OP_EXCEPTION.get(getExceptionMessage(t)), t); } }
public static void releaseDefunct(LDAPConnection connection) { if (connection != null && connection.getConnectionPool() != null) connection.getConnectionPool().releaseDefunctConnection(connection); }
if (timeSinceLastCheck >= pool.getHealthCheckIntervalMillis()) pool.doHealthCheck(); (pool.getHealthCheckIntervalMillis() - timeSinceLastCheck), 30000L); try
public static void releaseConnection(LDAPConnection connection) { if (connection != null && connection.getConnectionPool() != null) connection.getConnectionPool().releaseConnection(connection); }