Interface DnsQueryListener


@UnstableApi public interface DnsQueryListener
Listens to the result of querying DnsRecords.
  • Method Details

    • of

      static DnsQueryListener of()
      Returns the default DnsQueryListener which logs DnsRecord query failures.
    • onSuccess

      void onSuccess(List<DnsRecord> oldRecords, List<DnsRecord> newRecords, String logPrefix)
      Invoked when queries for DnsRecords 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 for DnsRecords 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.