Package de.adrianlange.mcd
Class DnsLookupContextImpl
- java.lang.Object
-
- de.adrianlange.mcd.DnsLookupContextImpl
-
- All Implemented Interfaces:
DnsLookupContext
public class DnsLookupContextImpl extends Object implements DnsLookupContext
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDnsLookupContextImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDnsServer(String dnsServer)Collection<String>getDnsServers()Returns a collection of configured DNS servers.intgetRetries()Returns the number of automatic retries until a request fails.DurationgetTimeout()Returns the duration until a request runs into a timeout.booleanisTcp()Returns if TCP is used.voidsetRetries(int retries)voidsetTcp(boolean tcp)voidsetTimeout(Duration timeout)
-
-
-
Method Detail
-
addDnsServer
public void addDnsServer(String dnsServer) throws UnknownHostException
- Throws:
UnknownHostException
-
getDnsServers
public Collection<String> getDnsServers()
Description copied from interface:DnsLookupContextReturns 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:
getDnsServersin interfaceDnsLookupContext- Returns:
- A collection of DNS servers or
nullif none is configured.
-
getTimeout
public Duration getTimeout()
Description copied from interface:DnsLookupContextReturns the duration until a request runs into a timeout.- Specified by:
getTimeoutin interfaceDnsLookupContext- Returns:
- duration until request runs into timeout
-
setTimeout
public void setTimeout(Duration timeout)
-
getRetries
public int getRetries()
Description copied from interface:DnsLookupContextReturns the number of automatic retries until a request fails.- Specified by:
getRetriesin interfaceDnsLookupContext- Returns:
- Number of retries
-
setRetries
public void setRetries(int retries)
-
isTcp
public boolean isTcp()
Description copied from interface:DnsLookupContextReturns if TCP is used. If not UDP will be used.- Specified by:
isTcpin interfaceDnsLookupContext- Returns:
- True if TCP should be used, false otherwise
-
setTcp
public void setTcp(boolean tcp)
-
-