--- /dev/null 2017-12-06 15:25:09.752000052 +0000 +++ new/src/java.naming/share/classes/javax/naming/spi/ldap/LdapDnsProviderResult.java 2017-12-06 17:43:08.343425969 +0000 @@ -0,0 +1,45 @@ +package javax.naming.spi.ldap; + +import java.util.List; + +/** + * This class is used by an {@link LdapDnsProvider} to return the result of a + * DNS lookup for a given ldap url. The result consists of a domain name and + * its associated ldap server endpoints. + */ +public class LdapDnsProviderResult { + + private final String domainName; + private final List endpoints; + + /** + * Construct an LdapDnsProviderResult consisting of a resolved domain name + * and the ldap server endpoints that serve the domain. + * + * @param domainName the resolved domain name + * @param endpoints the resolved ldap server endpoints + */ + public LdapDnsProviderResult(String domainName, List endpoints) { + this.domainName = domainName; + this.endpoints = endpoints; + } + + /** + * Get the domain name resolved from the ldap URL. + * + * @return the resolved domain name + */ + public String getDomainName() { + return domainName; + } + + /** + * Get the individual server endpoints resolved from the ldap URL. + * + * @return the resolved ldap server endpoints + */ + public List getEndpoints() { + return endpoints; + } + +}