Class DNSResolver


  • public abstract class DNSResolver
    extends java.lang.Object
    Implementations of this interface define a class that is capable of resolving DNS addresses.
    • Field Detail

      • LOGGER

        protected static final java.util.logging.Logger LOGGER
    • Constructor Detail

      • DNSResolver

        protected DNSResolver​(boolean supportsDnssec)
    • Method Detail

      • lookupSrvRecords

        public final java.util.Collection<org.minidns.record.SRV> lookupSrvRecords​(org.minidns.dnsname.DnsName name,
                                                                                   java.util.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.
      • lookupHostAddress0

        protected java.util.List<java.net.InetAddress> lookupHostAddress0​(org.minidns.dnsname.DnsName name,
                                                                          java.util.List<RemoteConnectionEndpointLookupFailure> lookupFailures,
                                                                          ConnectionConfiguration.DnssecMode dnssecMode)
        Lookup the IP addresses of a given host name. Returns null if there was an error, in which the error reason will be added in form of a HostAddress to failedAddresses. 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 lookup
        lookupFailures - 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​(java.lang.CharSequence name,
                                                java.lang.CharSequence hostname,
                                                java.util.List<java.net.InetAddress> hostAddresses)