public class AddressResolverOptions extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CACHE_MAX_TIME_TO_LIVE |
static int |
DEFAULT_CACHE_MIN_TIME_TO_LIVE |
static int |
DEFAULT_CACHE_NEGATIVE_TIME_TO_LIVE |
static int |
DEFAULT_MAX_QUERIES |
static int |
DEFAULT_NDOTS |
static boolean |
DEFAULT_OPT_RESOURCE_ENABLED
The default value for
setOptResourceEnabled(boolean) = true |
static int |
DEFAULT_QUERY_TIMEOUT |
static boolean |
DEFAULT_RD_FLAG |
static List<String> |
DEFAULT_SEACH_DOMAINS |
static List<String> |
DEFAULT_SERVERS
The default list of DNS servers = null (uses system name server's list like resolve.conf otherwise Google Public DNS)
|
Constructor and Description |
---|
AddressResolverOptions() |
AddressResolverOptions(AddressResolverOptions other) |
AddressResolverOptions(JsonObject json) |
Modifier and Type | Method and Description |
---|---|
AddressResolverOptions |
addSearchDomain(String searchDomain)
Add a DNS search domain.
|
AddressResolverOptions |
addServer(String server)
Add a DNS server address.
|
boolean |
equals(Object o) |
int |
getCacheMaxTimeToLive() |
int |
getCacheMinTimeToLive() |
int |
getCacheNegativeTimeToLive() |
String |
getHostsPath() |
Buffer |
getHostsValue() |
int |
getMaxQueries() |
int |
getNdots() |
long |
getQueryTimeout() |
boolean |
getRdFlag() |
List<String> |
getSearchDomains() |
List<String> |
getServers() |
int |
hashCode() |
boolean |
isOptResourceEnabled() |
AddressResolverOptions |
setCacheMaxTimeToLive(int cacheMaxTimeToLive)
Set the cache maximum TTL value in seconds.
|
AddressResolverOptions |
setCacheMinTimeToLive(int cacheMinTimeToLive)
Set the cache minimum TTL value in seconds.
|
AddressResolverOptions |
setCacheNegativeTimeToLive(int cacheNegativeTimeToLive)
Set the negative cache TTL value in seconds.
|
AddressResolverOptions |
setHostsPath(String hostsPath)
Set the path of an alternate hosts configuration file to use instead of the one provided by the os.
|
AddressResolverOptions |
setHostsValue(Buffer hostsValue)
Set an alternate hosts configuration file to use instead of the one provided by the os.
|
AddressResolverOptions |
setMaxQueries(int maxQueries)
Set the maximum number of queries when an hostname is resolved.
|
AddressResolverOptions |
setNdots(int ndots)
Set the ndots value used when resolving using search domains, the default value is
1 . |
AddressResolverOptions |
setOptResourceEnabled(boolean optResourceEnabled)
Set to true to enable the automatic inclusion in DNS queries of an optional record that hints
the remote DNS server about how much data the resolver can read per response.
|
AddressResolverOptions |
setQueryTimeout(long queryTimeout)
Set the query timeout in milliseconds, i.e the amount of time after a query is considered to be failed.
|
AddressResolverOptions |
setRdFlag(boolean rdFlag)
Set the DNS queries Recursion Desired flag value.
|
AddressResolverOptions |
setSearchDomains(List<String> searchDomains)
Set the lists of DNS search domains.
|
AddressResolverOptions |
setServers(List<String> servers)
Set the list of DNS server addresses, an address is the IP of the dns server, followed by an optional
colon and a port, e.g
8.8.8.8 or {code 192.168.0.1:40000}. |
JsonObject |
toJson() |
public static final List<String> DEFAULT_SERVERS
public static final boolean DEFAULT_OPT_RESOURCE_ENABLED
setOptResourceEnabled(boolean)
= truepublic static final int DEFAULT_CACHE_MIN_TIME_TO_LIVE
public static final int DEFAULT_CACHE_MAX_TIME_TO_LIVE
public static final int DEFAULT_CACHE_NEGATIVE_TIME_TO_LIVE
public static final int DEFAULT_QUERY_TIMEOUT
public static final int DEFAULT_MAX_QUERIES
public static final boolean DEFAULT_RD_FLAG
public static final int DEFAULT_NDOTS
public AddressResolverOptions()
public AddressResolverOptions(AddressResolverOptions other)
public AddressResolverOptions(JsonObject json)
public String getHostsPath()
public AddressResolverOptions setHostsPath(String hostsPath)
hostsPath
- the hosts pathpublic Buffer getHostsValue()
public AddressResolverOptions setHostsValue(Buffer hostsValue)
hostsValue
- the hosts contentpublic AddressResolverOptions setServers(List<String> servers)
8.8.8.8
or {code 192.168.0.1:40000}. When the list is empty, the resolver
will use the list of the system DNS server addresses from the environment, if that list cannot be retrieved
it will use Google's public DNS servers "8.8.8.8"
and "8.8.4.4"
.servers
- the list of DNS serverspublic AddressResolverOptions addServer(String server)
server
- the server to addpublic boolean isOptResourceEnabled()
public AddressResolverOptions setOptResourceEnabled(boolean optResourceEnabled)
optResourceEnabled
- true to enable, false otherwisepublic int getCacheMinTimeToLive()
public AddressResolverOptions setCacheMinTimeToLive(int cacheMinTimeToLive)
cacheMinTimeToLive
- the cache min TTL in secondspublic int getCacheMaxTimeToLive()
public AddressResolverOptions setCacheMaxTimeToLive(int cacheMaxTimeToLive)
cacheMaxTimeToLive
- the cache max TTL in secondspublic int getCacheNegativeTimeToLive()
public AddressResolverOptions setCacheNegativeTimeToLive(int cacheNegativeTimeToLive)
cacheNegativeTimeToLive
- the cache negative TTL in secondspublic long getQueryTimeout()
public AddressResolverOptions setQueryTimeout(long queryTimeout)
queryTimeout
- the query timeout in millisecondspublic int getMaxQueries()
public AddressResolverOptions setMaxQueries(int maxQueries)
maxQueries
- the max number of queries to be sentpublic boolean getRdFlag()
public AddressResolverOptions setRdFlag(boolean rdFlag)
rdFlag
- the flag valuepublic AddressResolverOptions setSearchDomains(List<String> searchDomains)
searchDomains
- the search domainspublic AddressResolverOptions addSearchDomain(String searchDomain)
searchDomain
- the search domain to addpublic int getNdots()
public AddressResolverOptions setNdots(int ndots)
1
.ndots
- the new ndots valuepublic JsonObject toJson()
Copyright © 2016. All rights reserved.