Package io.netty.resolver.dns
Class BiDnsQueryLifecycleObserver
- java.lang.Object
-
- io.netty.resolver.dns.BiDnsQueryLifecycleObserver
-
- All Implemented Interfaces:
DnsQueryLifecycleObserver
public final class BiDnsQueryLifecycleObserver extends java.lang.Object implements DnsQueryLifecycleObserver
Combines twoDnsQueryLifecycleObserverinto a singleDnsQueryLifecycleObserver.
-
-
Constructor Summary
Constructors Constructor Description BiDnsQueryLifecycleObserver(DnsQueryLifecycleObserver a, DnsQueryLifecycleObserver b)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidqueryCancelled(int queriesRemaining)The query may have been written but it was cancelled at some point.DnsQueryLifecycleObserverqueryCNAMEd(DnsQuestion cnameQuestion)The query returned a CNAME which we may attempt to follow with a new query.voidqueryFailed(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 resolutionDnsQueryLifecycleObserverqueryNoAnswer(DnsResponseCode code)The response to the query didn't provide the expected response code, but it didn't returnDnsResponseCode.NXDOMAINso we may try to query again.DnsQueryLifecycleObserverqueryRedirected(java.util.List<java.net.InetSocketAddress> nameServers)The query has been redirected to another list of DNS servers.voidquerySucceed()The query received the expected results.voidqueryWritten(java.net.InetSocketAddress dnsServerAddress, ChannelFuture future)The query has been written.
-
-
-
Constructor Detail
-
BiDnsQueryLifecycleObserver
public BiDnsQueryLifecycleObserver(DnsQueryLifecycleObserver a, DnsQueryLifecycleObserver b)
Create a new instance.- Parameters:
a- TheDnsQueryLifecycleObserverthat will receive events first.b- TheDnsQueryLifecycleObserverthat will receive events second.
-
-
Method Detail
-
queryWritten
public void queryWritten(java.net.InetSocketAddress dnsServerAddress, ChannelFuture future)Description copied from interface:DnsQueryLifecycleObserverThe query has been written.- Specified by:
queryWrittenin interfaceDnsQueryLifecycleObserver- Parameters:
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.
-
queryCancelled
public void queryCancelled(int queriesRemaining)
Description copied from interface:DnsQueryLifecycleObserverThe query may have been written but it was cancelled at some point.- Specified by:
queryCancelledin interfaceDnsQueryLifecycleObserver- Parameters:
queriesRemaining- The number of queries remaining.
-
queryRedirected
public DnsQueryLifecycleObserver queryRedirected(java.util.List<java.net.InetSocketAddress> nameServers)
Description copied from interface:DnsQueryLifecycleObserverThe query has been redirected to another list of DNS servers.- Specified by:
queryRedirectedin interfaceDnsQueryLifecycleObserver- Parameters:
nameServers- The name servers the query has been redirected to.- Returns:
- An observer for the new query which we may issue.
-
queryCNAMEd
public DnsQueryLifecycleObserver queryCNAMEd(DnsQuestion cnameQuestion)
Description copied from interface:DnsQueryLifecycleObserverThe query returned a CNAME which we may attempt to follow with a new query.Note that multiple queries may be encountering a CNAME. For example a if both
DnsRecordType.AAAAandDnsRecordType.Aare supported we may query for both.- Specified by:
queryCNAMEdin interfaceDnsQueryLifecycleObserver- Parameters:
cnameQuestion- the question we would use if we issue a new query.- Returns:
- An observer for the new query which we may issue.
-
queryNoAnswer
public DnsQueryLifecycleObserver queryNoAnswer(DnsResponseCode code)
Description copied from interface:DnsQueryLifecycleObserverThe response to the query didn't provide the expected response code, but it didn't returnDnsResponseCode.NXDOMAINso we may try to query again.- Specified by:
queryNoAnswerin interfaceDnsQueryLifecycleObserver- Parameters:
code- the unexpected response code.- Returns:
- An observer for the new query which we may issue.
-
queryFailed
public void queryFailed(java.lang.Throwable cause)
Description copied from interface:DnsQueryLifecycleObserverThe 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
- Specified by:
queryFailedin interfaceDnsQueryLifecycleObserver- Parameters:
cause- The cause which for the failure.
-
querySucceed
public void querySucceed()
Description copied from interface:DnsQueryLifecycleObserverThe query received the expected results.- Specified by:
querySucceedin interfaceDnsQueryLifecycleObserver
-
-