/** * Indicates whether the connection on which this result code was received is * likely still usable. Note that this is a best guess, and it may or may not * be correct. It will attempt to be conservative so that a connection is * more likely to be classified as unusable when it may still be valid than to * be classified as usable when that is no longer the case. * * @return {@code true} if it is likely that the connection on which this * result code was received is still usable, or {@code false} if it * may no longer be valid. */ public boolean isConnectionUsable() { return isConnectionUsable(this); }
/** * Indicates whether the connection on which this result code was received is * likely still usable. Note that this is a best guess, and it may or may not * be correct. It will attempt to be conservative so that a connection is * more likely to be classified as unusable when it may still be valid than to * be classified as usable when that is no longer the case. * * @return {@code true} if it is likely that the connection on which this * result code was received is still usable, or {@code false} if it * may no longer be valid. */ public boolean isConnectionUsable() { return isConnectionUsable(this); }
throws LDAPException if (! ResultCode.isConnectionUsable(exception.getResultCode()))
throws LDAPException if (! ResultCode.isConnectionUsable(exception.getResultCode()))
protected SearchResult execute(SearchRequest request, String bindDN, String password) { LDAPConnection connection = null; try { if (allowAllSocketFactory) { SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager()); connection = new LDAPConnection(sslUtil.createSSLSocketFactory(), serverHost, serverPort); } else { connection = new LDAPConnection(serverHost, serverPort); } if (bindDN != null) { BindResult auth = connection.bind(bindDN, password); if (!auth.getResultCode().isConnectionUsable()) { log.error("Connection not usable, result code : " + auth.getResultCode()); } } return connection.search(request); } catch (LDAPException le) { String message = le.getMessage(); if (!message.startsWith("Unable to bind as user ")) { log.error(le.getMessage(), le); } } catch (GeneralSecurityException gse) { log.error(gse.getMessage(), gse); } finally { if (null != connection) { connection.close(); } } return null; }
resultCode.compareAndSet(null, rc); if (! le.getResultCode().isConnectionUsable())
resultCode.compareAndSet(null, rc); if (! le.getResultCode().isConnectionUsable())
if (! ResultCode.isConnectionUsable(result.getResultCode())) le.getResponseControls())); if (! ResultCode.isConnectionUsable(le.getResultCode()))
if (! ResultCode.isConnectionUsable(result.getResultCode())) le.getResponseControls())); if (! ResultCode.isConnectionUsable(le.getResultCode()))
resultCode.compareAndSet(null, rc); if (! lse.getResultCode().isConnectionUsable()) resultCode.compareAndSet(null, rc); if (! le.getResultCode().isConnectionUsable())
resultCode.compareAndSet(null, rc); if (! lse.getResultCode().isConnectionUsable())
if ((result != null) && (result.getResultCode().isConnectionUsable())) if (result.getResultCode().isConnectionUsable())
if (! ResultCode.isConnectionUsable(result.getResultCode()))
if (! ResultCode.isConnectionUsable(result.getResultCode()))
return; else if (lse.getResultCode().isConnectionUsable())
if (! le.getResultCode().isConnectionUsable())
if ((result != null) && (result.getResultCode().isConnectionUsable())) if (result.getResultCode().isConnectionUsable())
else if (searchResult.getResultCode().isConnectionUsable()) connectionValid = searchResult.getResultCode().isConnectionUsable(); writeRejectedChange(rejectWriter, ERR_LDAPMODIFY_SEARCH_FAILED.get(modifyChangeRecord.getDN(),