final class TraceDnsQueryLifecycleObserver extends java.lang.Object implements DnsQueryLifecycleObserver
| Modifier and Type | Field and Description |
|---|---|
private java.net.InetSocketAddress |
dnsServerAddress |
private InternalLogLevel |
level |
private InternalLogger |
logger |
private DnsQuestion |
question |
| Constructor and Description |
|---|
TraceDnsQueryLifecycleObserver(DnsQuestion question,
InternalLogger logger,
InternalLogLevel level) |
| Modifier and Type | Method and Description |
|---|---|
void |
queryCancelled(int queriesRemaining)
The query may have been written but it was cancelled at some point.
|
DnsQueryLifecycleObserver |
queryCNAMEd(DnsQuestion cnameQuestion)
The query returned a CNAME which we may attempt to follow with a new query.
|
void |
queryFailed(java.lang.Throwable cause)
The following criteria are possible:
IO Error
Server responded with an invalid DNS response
Server responded with a valid DNS response, but it didn't progress the resolution
|
DnsQueryLifecycleObserver |
queryNoAnswer(DnsResponseCode code)
The response to the query didn't provide the expected response code, but it didn't return
DnsResponseCode.NXDOMAIN so we may try to query again. |
DnsQueryLifecycleObserver |
queryRedirected(java.util.List<java.net.InetSocketAddress> nameServers)
The query has been redirected to another list of DNS servers.
|
void |
querySucceed()
The query received the expected results.
|
void |
queryWritten(java.net.InetSocketAddress dnsServerAddress,
ChannelFuture future)
The query has been written.
|
private final InternalLogger logger
private final InternalLogLevel level
private final DnsQuestion question
private java.net.InetSocketAddress dnsServerAddress
TraceDnsQueryLifecycleObserver(DnsQuestion question, InternalLogger logger, InternalLogLevel level)
public void queryWritten(java.net.InetSocketAddress dnsServerAddress,
ChannelFuture future)
DnsQueryLifecycleObserverqueryWritten in interface DnsQueryLifecycleObserverdnsServerAddress - The DNS server address which the query was sent to.future - The future which represents the status of the write operation for the DNS query.public void queryCancelled(int queriesRemaining)
DnsQueryLifecycleObserverqueryCancelled in interface DnsQueryLifecycleObserverqueriesRemaining - The number of queries remaining.public DnsQueryLifecycleObserver queryRedirected(java.util.List<java.net.InetSocketAddress> nameServers)
DnsQueryLifecycleObserverqueryRedirected in interface DnsQueryLifecycleObservernameServers - The name servers the query has been redirected to.public DnsQueryLifecycleObserver queryCNAMEd(DnsQuestion cnameQuestion)
DnsQueryLifecycleObserver
Note that multiple queries may be encountering a CNAME. For example a if both DnsRecordType.AAAA and
DnsRecordType.A are supported we may query for both.
queryCNAMEd in interface DnsQueryLifecycleObservercnameQuestion - the question we would use if we issue a new query.public DnsQueryLifecycleObserver queryNoAnswer(DnsResponseCode code)
DnsQueryLifecycleObserverDnsResponseCode.NXDOMAIN so we may try to query again.queryNoAnswer in interface DnsQueryLifecycleObservercode - the unexpected response code.public void queryFailed(java.lang.Throwable cause)
DnsQueryLifecycleObserverqueryFailed in interface DnsQueryLifecycleObservercause - The cause which for the failure.public void querySucceed()
DnsQueryLifecycleObserverquerySucceed in interface DnsQueryLifecycleObserver