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)
DnsQueryLifecycleObserver
queryWritten
in interface DnsQueryLifecycleObserver
dnsServerAddress
- 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)
DnsQueryLifecycleObserver
queryCancelled
in interface DnsQueryLifecycleObserver
queriesRemaining
- The number of queries remaining.public DnsQueryLifecycleObserver queryRedirected(java.util.List<java.net.InetSocketAddress> nameServers)
DnsQueryLifecycleObserver
queryRedirected
in interface DnsQueryLifecycleObserver
nameServers
- 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 DnsQueryLifecycleObserver
cnameQuestion
- the question we would use if we issue a new query.public DnsQueryLifecycleObserver queryNoAnswer(DnsResponseCode code)
DnsQueryLifecycleObserver
DnsResponseCode.NXDOMAIN
so we may try to query again.queryNoAnswer
in interface DnsQueryLifecycleObserver
code
- the unexpected response code.public void queryFailed(java.lang.Throwable cause)
DnsQueryLifecycleObserver
queryFailed
in interface DnsQueryLifecycleObserver
cause
- The cause which for the failure.public void querySucceed()
DnsQueryLifecycleObserver
querySucceed
in interface DnsQueryLifecycleObserver