Interface DnsQueryListener
Listens to the result of querying
DnsRecord
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic DnsQueryListener
of()
Returns the defaultDnsQueryListener
which logsDnsRecord
query failures.void
onFailure
(List<DnsRecord> oldRecords, Throwable cause, String logPrefix, long delayMillis, int attemptsSoFar) Invoked when queries forDnsRecord
s have failed.void
Invoked when queries forDnsRecord
s are successful.
-
Method Details
-
of
Returns the defaultDnsQueryListener
which logsDnsRecord
query failures. -
onSuccess
Invoked when queries forDnsRecord
s are successful.- Parameters:
oldRecords
- old dns records which were to be updated. If empty, it indicates that this querying is called after initialization or the old records had failed.newRecords
- new dns records.logPrefix
- comma-separated dns record name. (e.g., `foo.com, bar.com`)
-
onFailure
void onFailure(List<DnsRecord> oldRecords, Throwable cause, String logPrefix, long delayMillis, int attemptsSoFar) Invoked when queries forDnsRecord
s have failed.- Parameters:
oldRecords
- old dns records which were to be updated. If empty, it indicates that this querying is called after initialization.cause
- the cause of the failure.logPrefix
- comma-separated dns record name. (e.g., `foo.com, bar.com`)delayMillis
- the interval of the next attempt.attemptsSoFar
- the number of inquiries so far.
-