- java.lang.Object
-
- io.netty5.resolver.dns.BiDnsQueryLifecycleObserver
-
- All Implemented Interfaces:
DnsQueryLifecycleObserver
public final class BiDnsQueryLifecycleObserver extends Object implements DnsQueryLifecycleObserver
Combines twoDnsQueryLifecycleObserver
into 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 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(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 resolutionDnsQueryLifecycleObserver
queryNoAnswer(DnsResponseCode code)
The response to the query didn't provide the expected response code, but it didn't returnDnsResponseCode.NXDOMAIN
so we may try to query again.DnsQueryLifecycleObserver
queryRedirected(List<InetSocketAddress> nameServers)
The query has been redirected to another list of DNS servers.void
querySucceed()
The query received the expected results.void
queryWritten(InetSocketAddress dnsServerAddress, Future<Void> future)
The query has been written.
-
-
-
Constructor Detail
-
BiDnsQueryLifecycleObserver
public BiDnsQueryLifecycleObserver(DnsQueryLifecycleObserver a, DnsQueryLifecycleObserver b)
Create a new instance.- Parameters:
a
- TheDnsQueryLifecycleObserver
that will receive events first.b
- TheDnsQueryLifecycleObserver
that will receive events second.
-
-
Method Detail
-
queryWritten
public void queryWritten(InetSocketAddress dnsServerAddress, Future<Void> future)
Description copied from interface:DnsQueryLifecycleObserver
The query has been written.- Specified by:
queryWritten
in 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:DnsQueryLifecycleObserver
The query may have been written but it was cancelled at some point.- Specified by:
queryCancelled
in interfaceDnsQueryLifecycleObserver
- Parameters:
queriesRemaining
- The number of queries remaining.
-
queryRedirected
public DnsQueryLifecycleObserver queryRedirected(List<InetSocketAddress> nameServers)
Description copied from interface:DnsQueryLifecycleObserver
The query has been redirected to another list of DNS servers.- Specified by:
queryRedirected
in 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:DnsQueryLifecycleObserver
The 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.AAAA
andDnsRecordType.A
are supported we may query for both.- Specified by:
queryCNAMEd
in 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:DnsQueryLifecycleObserver
The response to the query didn't provide the expected response code, but it didn't returnDnsResponseCode.NXDOMAIN
so we may try to query again.- Specified by:
queryNoAnswer
in interfaceDnsQueryLifecycleObserver
- Parameters:
code
- the unexpected response code.- Returns:
- An observer for the new query which we may issue.
-
queryFailed
public void queryFailed(Throwable cause)
Description copied from interface:DnsQueryLifecycleObserver
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
- Specified by:
queryFailed
in interfaceDnsQueryLifecycleObserver
- Parameters:
cause
- The cause which for the failure.
-
querySucceed
public void querySucceed()
Description copied from interface:DnsQueryLifecycleObserver
The query received the expected results.- Specified by:
querySucceed
in interfaceDnsQueryLifecycleObserver
-
-