Package org.ldaptive.dns
Class AbstractDNSResolver<T>
java.lang.Object
org.ldaptive.dns.AbstractDNSResolver<T>
- Type Parameters:
T- Type of record to resolve.
- All Implemented Interfaces:
DNSResolver<T>
- Direct Known Subclasses:
SRVDNSResolver
Base class for all DNS resolvers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DNSContextFactoryFactory to create DNS connections.protected final LoggerClass logger. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDNSResolver(DNSContextFactory factory) Creates a new abstract DNS resolver. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String[]Get the types of records to query for, e.g.processRecords(Set<String> records) Process a set of DNS records.Resolve a set of DNS records of some type for the given name.private voidresolveOne(DirContext ctx, String name, String attrId, Set<String> records) Query for a single kind of DNS record.toString()
-
Field Details
-
logger
Class logger. -
contextFactory
Factory to create DNS connections.
-
-
Constructor Details
-
AbstractDNSResolver
Creates a new abstract DNS resolver.- Parameters:
factory- DNS context factory
-
-
Method Details
-
resolve
Description copied from interface:DNSResolverResolve a set of DNS records of some type for the given name.- Specified by:
resolvein interfaceDNSResolver<T>- Parameters:
name- Name for which to resolve DNS records.- Returns:
- Set of records of type T bound to the given name.
-
getAttributes
Get the types of records to query for, e.g.{"A", "AAAA"}.- Returns:
- Array of JNDI attribute names.
-
processRecords
Process a set of DNS records.- Parameters:
records- Set of raw DNS records returned from a name query.- Returns:
- Set of converted/processed records.
-
resolveOne
private void resolveOne(DirContext ctx, String name, String attrId, Set<String> records) throws NamingException Query for a single kind of DNS record.- Parameters:
ctx- Directory context.name- Name to query for.attrId- DNS record type, e.g.A.records- Set of records to append results to.- Throws:
NamingException- on DNS lookup failure.
-
toString
-