Package org.jivesoftware.smack.util.dns
Class DNSResolver
- java.lang.Object
-
- org.jivesoftware.smack.util.dns.DNSResolver
-
- Direct Known Subclasses:
DNSJavaResolver
,JavaxResolver
,MiniDnsResolver
public abstract class DNSResolver extends Object
Implementations of this interface define a class that is capable of resolving DNS addresses.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DNSResolver(boolean supportsDnssec)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<InetAddress>
lookupHostAddress(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
protected List<InetAddress>
lookupHostAddress0(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
Lookup the IP addresses of a given host name.Collection<SRV>
lookupSrvRecords(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
Gets a list of service records for the specified service.protected abstract Collection<SRV>
lookupSrvRecords0(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
protected static boolean
shouldContinue(CharSequence name, CharSequence hostname, List<InetAddress> hostAddresses)
-
-
-
Constructor Detail
-
DNSResolver
protected DNSResolver(boolean supportsDnssec)
-
-
Method Detail
-
lookupSrvRecords
public final Collection<SRV> lookupSrvRecords(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
Gets a list of service records for the specified service.- Parameters:
name
- The symbolic name of the service.lookupFailures
- list of exceptions that occurred during lookup.dnssecMode
- security mode.- Returns:
- The list of SRV records mapped to the service name.
-
lookupSrvRecords0
protected abstract Collection<SRV> lookupSrvRecords0(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
-
lookupHostAddress
public final List<InetAddress> lookupHostAddress(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
-
lookupHostAddress0
protected List<InetAddress> lookupHostAddress0(DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, ConnectionConfiguration.DnssecMode dnssecMode)
Lookup the IP addresses of a given host name. Returnsnull
if there was an error, in which the error reason will be added in form of aHostAddress
tofailedAddresses
. Returns a empty list in case the DNS name exists but has no associated A or AAAA resource records. Otherwise, if the resolution was successful and there is at least one A or AAAA resource record, then a non-empty list will be returned.Concrete DNS resolver implementations are free to overwrite this, but have to stick to the interface contract.
- Parameters:
name
- the DNS name to lookuplookupFailures
- list of exceptions that occurred during lookup.dnssecMode
- the selected DNSSEC mode- Returns:
- A list, either empty or non-empty, or
null
-
shouldContinue
protected static boolean shouldContinue(CharSequence name, CharSequence hostname, List<InetAddress> hostAddresses)
-
-