Class DnsLookupContextImpl

java.lang.Object
de.adrianlange.mcd.DnsLookupContextImpl
All Implemented Interfaces:
DnsLookupContext

public class DnsLookupContextImpl extends Object implements DnsLookupContext
  • Constructor Details

    • DnsLookupContextImpl

      protected DnsLookupContextImpl()
  • Method Details

    • addDnsServer

      public void addDnsServer(String dnsServer) throws UnknownHostException
      Throws:
      UnknownHostException
    • getDnsServers

      public Collection<String> getDnsServers()
      Description copied from interface: DnsLookupContext
      Returns a collection of configured DNS servers. If nothing is set the hosts default DNS server is used. If multiple DNS server are defined, only one of them will be used.
      Specified by:
      getDnsServers in interface DnsLookupContext
      Returns:
      A collection of DNS servers or null if none is configured.
    • getTimeout

      public Duration getTimeout()
      Description copied from interface: DnsLookupContext
      Returns the duration until a request runs into a timeout.
      Specified by:
      getTimeout in interface DnsLookupContext
      Returns:
      duration until request runs into timeout
    • setTimeout

      public void setTimeout(Duration timeout)
    • getRetries

      public int getRetries()
      Description copied from interface: DnsLookupContext
      Returns the number of automatic retries until a request fails.
      Specified by:
      getRetries in interface DnsLookupContext
      Returns:
      Number of retries
    • setRetries

      public void setRetries(int retries)
    • isTcp

      public boolean isTcp()
      Description copied from interface: DnsLookupContext
      Returns if TCP is used. If not UDP will be used.
      Specified by:
      isTcp in interface DnsLookupContext
      Returns:
      True if TCP should be used, false otherwise
    • setTcp

      public void setTcp(boolean tcp)