@Override public ProviderConnection create() throws LdapException { LdapException lastThrown = null; final String[] urls = connectionStrategy.getLdapUrls(metadata); if (urls == null || urls.length == 0) { throw new ConnectionException( "Connection strategy " + connectionStrategy + " did not produce any LDAP URLs for " + metadata); } ProviderConnection conn = null; for (String url : urls) { try { logger.trace("[{}] Attempting connection to {} for strategy {}", metadata, url, connectionStrategy); conn = createInternal(url); metadata.incrementCount(); lastThrown = null; break; } catch (ConnectionException e) { lastThrown = e; logger.debug("Error connecting to LDAP URL: {}", url, e); } } if (lastThrown != null) { throw lastThrown; } return conn; }
@Override public ProviderConnection create() throws LdapException { LdapException lastThrown = null; final String[] urls = connectionStrategy.getLdapUrls(metadata); if (urls == null || urls.length == 0) { throw new ConnectionException( "Connection strategy " + connectionStrategy + " did not produce any LDAP URLs for " + metadata); } ProviderConnection conn = null; for (String url : urls) { try { logger.trace("[{}] Attempting connection to {} for strategy {}", metadata, url, connectionStrategy); conn = createInternal(url); metadata.incrementCount(); lastThrown = null; break; } catch (ConnectionException e) { lastThrown = e; logger.debug("Error connecting to LDAP URL: {}", url, e); } } if (lastThrown != null) { throw lastThrown; } return conn; }
throw new ConnectionException(e, NamingExceptionUtils.getResultCode(e.getClass()));
throw new ConnectionException(e, NamingExceptionUtils.getResultCode(e.getClass())); } finally { if (threadLocalTLSSocketFactory != null) {
throw new ConnectionException(e, NamingExceptionUtils.getResultCode(e.getClass())); } finally { if (threadLocalTLSSocketFactory != null) {
} catch (NamingException e) { closeConn = true; throw new ConnectionException(e, NamingExceptionUtils.getResultCode(e.getClass())); } catch (IOException e) { closeConn = true; throw new ConnectionException(e); } catch (RuntimeException e) { closeConn = true;
} catch (NamingException e) { closeConn = true; throw new ConnectionException(e, NamingExceptionUtils.getResultCode(e.getClass())); } catch (IOException e) { closeConn = true; throw new ConnectionException(e); } catch (RuntimeException e) { closeConn = true;
} catch (NamingException e) { closeConn = true; throw new ConnectionException(e, NamingExceptionUtils.getResultCode(e.getClass())); } catch (IOException e) { closeConn = true; throw new ConnectionException(e); } catch (RuntimeException e) { closeConn = true;
final String[] urls = providerConfig.getConnectionStrategy().getLdapUrls(metadata); if (urls == null || urls.length == 0) { throw new ConnectionException( "Connection strategy " + providerConfig.getConnectionStrategy() + " did not produce any LDAP URLs for " + metadata);
throw new ConnectionException(e, ResultCode.valueOf(e.getResultCode().getValue())); } catch (org.apache.directory.api.ldap.model.exception.LdapException e) { closeConn = true; throw new ConnectionException(e); } catch (RuntimeException e) { closeConn = true;