Interface AddressResolver

All Known Implementing Classes:
DnsRecordIpAddressResolver, DnsSrvRecordAddressResolver, ListAddressResolver

public interface AddressResolver
Strategy interface to get the potential servers to connect to.
  • Method Details

    • getAddresses

      List<Address> getAddresses() throws IOException
      Get the potential Addresses to connect to.
      Returns:
      candidate Addresses
      Throws:
      IOException - if it encounters a problem
    • maybeShuffle

      default List<Address> maybeShuffle(List<Address> input)
      Optionally shuffle the list of addresses returned by getAddresses().

      The automatic connection recovery calls this method after getAddresses() to pick a random address for reconnecting.

      The default method implementation calls Collections.shuffle(List). Custom implementations can choose to not do any shuffling to have more predictability in the reconnection.

      Parameters:
      input -
      Returns:
      potentially shuffled list of addresses.