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 String
Default DNS record name.private boolean
Connect 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 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:DNSResolver
Resolve a set of DNS records of some type for the given name.- Specified by:
resolve
in interfaceDNSResolver<SRVRecord>
- Overrides:
resolve
in 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:AbstractDNSResolver
Get the types of records to query for, e.g.{"A", "AAAA"}
.- Specified by:
getAttributes
in classAbstractDNSResolver<SRVRecord>
- Returns:
- Array of JNDI attribute names.
-
processRecords
Description copied from class:AbstractDNSResolver
Process a set of DNS records.- Specified by:
processRecords
in 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:
toString
in classAbstractDNSResolver<SRVRecord>
-