/** * Creates a new DNS SRV connection strategy. * * @param env JNDI environment * @param ttl time to live in milliseconds for SRV records */ public DnsSrvConnectionStrategy(final Map<String, Object> env, final long ttl) { if (env != null) { setJndiEnvironment(env); } setTimeToLive(ttl); }
System.currentTimeMillis() >= srvRecords.get(0).getExpirationTime()) { try { srvRecords = sortSrvRecords(retrieveDNSRecords(metadata.getLdapUrl(), jndiEnv, srvTtl)); } catch (NamingException e) { throw new IllegalArgumentException("Could not retrieve DNS SRV record for " + metadata.getLdapUrl(), e);