Package org.ldaptive.dns
Class DefaultDNSContextFactory
- java.lang.Object
-
- org.ldaptive.dns.DefaultDNSContextFactory
-
- All Implemented Interfaces:
DNSContextFactory
public class DefaultDNSContextFactory extends Object implements DNSContextFactory
Provides the default implementation of the JNDI context factory for DNS queries.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DNS_PROVIDER_URL
Default provider URL for DNS, determines DNS from the underlying OS.static String
DNS_CONTEXT_FACTORY
JNDI context factory for DNS.private List<String>
nameservers
DNS name servers in order of preference.
-
Constructor Summary
Constructors Constructor Description DefaultDNSContextFactory(String... servers)
Creates a new instance that resolves DNS names using the given name servers.
-
-
-
Field Detail
-
DNS_CONTEXT_FACTORY
public static final String DNS_CONTEXT_FACTORY
JNDI context factory for DNS.- See Also:
- Constant Field Values
-
DEFAULT_DNS_PROVIDER_URL
public static final String DEFAULT_DNS_PROVIDER_URL
Default provider URL for DNS, determines DNS from the underlying OS. Value is "dns:".- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultDNSContextFactory
public DefaultDNSContextFactory(String... servers)
Creates a new instance that resolves DNS names using the given name servers.- Parameters:
servers
- name servers in order of preference.
-
-
Method Detail
-
create
public InitialDirContext create() throws NamingException
Description copied from interface:DNSContextFactory
Creates a new JNDI context.- Specified by:
create
in interfaceDNSContextFactory
- Returns:
- JNDI context
- Throws:
NamingException
- if an error occurs creating the context
-
-