| Modifier and Type | Field and Description |
|---|---|
static Duration |
DEFAULT_RESOLVER_TIMEOUT
Default timeout until resolving with one of the used resolvers fails.
|
static Duration |
DEFAULT_TIMEOUT
Default timeout until resolving is aborted.
|
| Constructor and Description |
|---|
ExtendedResolver()
Creates a new Extended Resolver.
|
ExtendedResolver(Iterable<Resolver> resolvers)
Creates a new
ExtendedResolver. |
ExtendedResolver(Resolver[] resolvers)
Creates a new Extended Resolver
|
ExtendedResolver(String[] servers)
Creates a new instance with
SimpleResolvers. |
| Modifier and Type | Method and Description |
|---|---|
void |
addResolver(Resolver r)
Adds a new resolver to be used by this ExtendedResolver
|
void |
deleteResolver(Resolver r)
Deletes a resolver used by this ExtendedResolver
|
boolean |
getLoadBalance()
Gets whether the servers receive queries load balanced.
|
Resolver |
getResolver(int n)
Returns the nth resolver used by this ExtendedResolver
|
Resolver[] |
getResolvers()
Returns all resolvers used by this ExtendedResolver
|
int |
getRetries()
Gets the number of retries sent to each server per query.
|
Duration |
getTimeout()
Gets the amount of time to wait for a response before giving up.
|
CompletionStage<Message> |
sendAsync(Message query)
Sends a message to multiple servers, and queries are sent multiple times until either a
successful response is received, or it is clear that there is no successful response.
|
void |
setEDNS(int version,
int payloadSize,
int flags,
List<EDNSOption> options)
Sets the EDNS information on outgoing messages.
|
void |
setIgnoreTruncation(boolean flag)
Sets whether truncated responses will be ignored.
|
void |
setLoadBalance(boolean flag)
Sets whether the servers should be load balanced.
|
void |
setPort(int port)
Sets the port to communicate with on the server
|
void |
setRetries(int retries)
Sets the number of retries sent to each server per query
|
void |
setTCP(boolean flag)
Sets whether TCP connections will be used by default
|
void |
setTimeout(Duration timeout)
Sets the amount of time to wait for a response before giving up.
|
void |
setTSIGKey(TSIG key)
Specifies the TSIG key that messages will be signed with
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsend, sendAsync, setEDNS, setEDNS, setTimeout, setTimeoutpublic static final Duration DEFAULT_TIMEOUT
public static final Duration DEFAULT_RESOLVER_TIMEOUT
public ExtendedResolver()
ResolverConfig is used to determine the
servers for which SimpleResolvers are initialized. The timeout for each server is
initialized with DEFAULT_RESOLVER_TIMEOUT.public ExtendedResolver(String[] servers) throws UnknownHostException
SimpleResolvers. The timeout for each server is initialized
with DEFAULT_RESOLVER_TIMEOUT.servers - An array of server names or IP addresses for which SimpleResolvers are
initialized.UnknownHostException - A server name could not be resolvedpublic ExtendedResolver(Resolver[] resolvers)
resolvers - An array of pre-initialized Resolvers.public ExtendedResolver(Iterable<Resolver> resolvers)
ExtendedResolver. No timeout value is applied to the individual
resolvers, make sure their timeout is smaller than the timeout of this ExtendedResolver.resolvers - An iterable of pre-initialized Resolvers.public void setPort(int port)
Resolverpublic void setTCP(boolean flag)
Resolverpublic void setIgnoreTruncation(boolean flag)
ResolversetIgnoreTruncation in interface Resolverflag - Indicates whether truncated responses should be ignored.public void setEDNS(int version,
int payloadSize,
int flags,
List<EDNSOption> options)
ResolversetEDNS in interface Resolverversion - The EDNS version to use. 0 indicates EDNS0 and -1 indicates no EDNS.payloadSize - The maximum DNS packet size that this host is capable of receiving over UDP.
If 0 is specified, the default (1280) is used.flags - EDNS extended flags to be set in the OPT record.options - EDNS options to be set in the OPT record, specified as a List of
OPTRecord.Option elements.OPTRecordpublic void setTSIGKey(TSIG key)
ResolversetTSIGKey in interface Resolverkey - The keypublic Duration getTimeout()
ResolvergetTimeout in interface ResolverResolver.setTimeout(Duration)public void setTimeout(Duration timeout)
ResolversetTimeout in interface Resolvertimeout - The amount of time to wait.public CompletionStage<Message> sendAsync(Message query)
public Resolver getResolver(int n)
public Resolver[] getResolvers()
public void addResolver(Resolver r)
public void deleteResolver(Resolver r)
public boolean getLoadBalance()
public void setLoadBalance(boolean flag)
flag - If true, servers will be tried in round-robin order. If false, servers will always
be queried in the same order.public int getRetries()
public void setRetries(int retries)
Copyright © 2021 dnsjava.org. All rights reserved.