Interface NameResolver

All Known Implementing Classes:
DefaultNameResolver

public interface NameResolver
Interface to allow resolving a name to an InetAddress.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    doWork(long nowMs)
    Perform periodic work for the resolver.
    default void
    Deprecated.
    default void
    init(CountersReader countersReader, CounterProvider counterProvider)
    Do post construction initialisation of the name resolver.
    default String
    lookup(String name, String uriParamName, boolean isReLookup)
    Lookup the name and return a string of the form name:port that represents the endpoint or control param of the URI.
    default String
    Gets the name of the resolver, used for logging and debugging.
    resolve(String name, String uriParamName, boolean isReResolution)
    Resolve a name and return the most up to date InetAddress that represents the name.
  • Method Details

    • resolve

      InetAddress resolve(String name, String uriParamName, boolean isReResolution)
      Resolve a name and return the most up to date InetAddress that represents the name.
      Parameters:
      name - to resolve.
      uriParamName - that the resolution is for.
      isReResolution - true if this is a re-resolution or false if initial resolution.
      Returns:
      address for the name that most recently represents the name or null if not resolvable currently.
      See Also:
    • lookup

      default String lookup(String name, String uriParamName, boolean isReLookup)
      Lookup the name and return a string of the form name:port that represents the endpoint or control param of the URI.
      Parameters:
      name - to lookup
      uriParamName - that the lookup is for.
      isReLookup - true if this is a re-lookup or true if initial lookup.
      Returns:
      string in name:port form.
    • init

      @Deprecated default void init(MediaDriver.Context context)
      Deprecated.
      Do post construction initialisation of the name resolver. Happens during the conductor start lifecycle. Can be used for actions like adding counters.
      Parameters:
      context - for the media driver that the name resolver is running in.
      See Also:
    • init

      default void init(CountersReader countersReader, CounterProvider counterProvider)
      Do post construction initialisation of the name resolver.
      Parameters:
      countersReader - for finding existing counters.
      counterProvider - for adding counters.
    • doWork

      default int doWork(long nowMs)
      Perform periodic work for the resolver.
      Parameters:
      nowMs - current epoch clock time in milliseconds
      Returns:
      work count
    • name

      default String name()
      Gets the name of the resolver, used for logging and debugging.
      Returns:
      name of the resolver, defaults to the qualified class name.