1 package javax.naming.spi.ldap;
   2 
   3 import java.util.List;
   4 
   5 /**
   6  * This class is used by an {@link LdapDnsProvider} to return the result of a
   7  * DNS lookup for a given ldap url. The result consists of a domain name and
   8  * its associated ldap server endpoints.
   9  */
  10 public class LdapDnsProviderResult {
  11 
  12     private final String domainName;
  13     private final List<String> endpoints;
  14 
  15     /**
  16      * Construct an LdapDnsProviderResult consisting of a resolved domain name
  17      * and the ldap server endpoints that serve the domain.
  18      *
  19      * @param domainName    the resolved domain name
  20      * @param endpoints     the resolved ldap server endpoints
  21      */
  22     public LdapDnsProviderResult(String domainName, List<String> endpoints) {
  23         this.domainName = domainName;
  24         this.endpoints = endpoints;
  25     }
  26 
  27     /**
  28      * Get the domain name resolved from the ldap URL.
  29      *
  30      * @return  the resolved domain name
  31      */
  32     public String getDomainName() {
  33         return domainName;
  34     }
  35 
  36     /**
  37      * Get the individual server endpoints resolved from the ldap URL.
  38      *
  39      * @return  the resolved ldap server endpoints
  40      */
  41     public List<String> getEndpoints() {
  42         return endpoints;
  43     }
  44 
  45 }