Interface CaldavHostResolver

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface CaldavHostResolver
Name resolution as a seam. The address checks of CaldavServerUrlValidator have to know where a declared host actually points, and calling InetAddress statically from the validator would make every one of its tests reach the network — flaky, slow, and dependent on whatever the machine's resolver believes today. The production wiring hands over the JDK resolver; the tests hand over a table.
  • Method Summary

    Modifier and Type
    Method
    Description
    Every address a host name — or an IP literal, which resolves to itself without a query — currently points at.
  • Method Details

    • resolve

      InetAddress[] resolve(String host) throws UnknownHostException
      Every address a host name — or an IP literal, which resolves to itself without a query — currently points at.
      Parameters:
      host - host part of a declared URL, brackets already stripped from an IPv6 literal
      Returns:
      the addresses the host points at, never empty
      Throws:
      UnknownHostException - when the host cannot be resolved at all