Package de.adrianlange.mcd
Class DnsLookupContextImpl
java.lang.Object
de.adrianlange.mcd.DnsLookupContextImpl
- All Implemented Interfaces:
DnsLookupContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDnsServer(String dnsServer) Returns a collection of configured DNS servers.intReturns the number of automatic retries until a request fails.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)
-
Constructor Details
-
DnsLookupContextImpl
protected DnsLookupContextImpl()
-
-
Method Details
-
addDnsServer
- Throws:
UnknownHostException
-
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
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
-
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)
-