Package org.ldaptive.dns
Class SRVDNSResolver
- All Implemented Interfaces:
DNSResolver<SRVRecord>
Queries for DNS A records for a given host name.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]Attributes (DNS record types) to query for.private static final StringDefault DNS record name.private final booleanConnect to LDAP using LDAPS.Fields inherited from class org.ldaptive.dns.AbstractDNSResolver
logger -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SRVDNSResolver(DNSContextFactory factory) Creates a new DNS address resolver.SRVDNSResolver(DNSContextFactory factory, boolean ssl) Creates a new DNS address resolver. -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.sortSrvRecords(Set<SRVRecord> records) Sorts the supplied SRV records according to RFC 2782.toString()
-
Field Details
-
ATTRIBUTES
Attributes (DNS record types) to query for. -
DEFAULT_RECORD_NAME
Default DNS record name.- See Also:
-
useSSL
private final boolean useSSLConnect to LDAP using LDAPS.
-
-
Constructor Details
-
SRVDNSResolver
public SRVDNSResolver()Default constructor. -
SRVDNSResolver
Creates a new DNS address resolver.- Parameters:
factory- JNDI dir context factory
-
SRVDNSResolver
Creates a new DNS address resolver.- Parameters:
factory- JNDI dir context factoryssl- whether SRV records should produce LDAPS URLs
-
-
Method Details
-
resolve
Description copied from interface:DNSResolverResolve a set of DNS records of some type for the given name.- Specified by:
resolvein interfaceDNSResolver<SRVRecord>- Overrides:
resolvein classAbstractDNSResolver<SRVRecord>- Parameters:
name- Name for which to resolve DNS records.- Returns:
- Set of records of type T bound to the given name.
-
getAttributes
Description copied from class:AbstractDNSResolverGet the types of records to query for, e.g.{"A", "AAAA"}.- Specified by:
getAttributesin classAbstractDNSResolver<SRVRecord>- Returns:
- Array of JNDI attribute names.
-
processRecords
Description copied from class:AbstractDNSResolverProcess a set of DNS records.- Specified by:
processRecordsin classAbstractDNSResolver<SRVRecord>- Parameters:
records- Set of raw DNS records returned from a name query.- Returns:
- Set of converted/processed records.
-
sortSrvRecords
Sorts the supplied SRV records according to RFC 2782. Records with the lowest priority are first. Records with the same priority are arranged by weight with higher weights having a greater chance to be ordered first.- Parameters:
records- to sort- Returns:
- sorted records
-
toString
- Overrides:
toStringin classAbstractDNSResolver<SRVRecord>
-