Class Resolver

java.lang.Object
org.deltava.util.dns.Resolver

public class Resolver extends Object
A utility class to pass asynchronous reverse DNS requests to a separate daemon thread.
Since:
12.4
Version:
12.4
Author:
Luke
  • Constructor Details

    • Resolver

      public Resolver()
  • Method Details

    • start

      public void start()
      Starts the executor pool.
    • getThreadCount

      public int getThreadCount()
      Returns the number of currently active resolver threads.
      Returns:
      the number of threads
    • getHits

      public long getHits()
      Returns the number of resolver cache hits. If this cache is shared, calling this method on the cache will return the aggregate across all cache consumers, so this class maintains its own counter.
      Returns:
      the number of cache hits
    • getRequests

      public long getRequests()
      Returns the number of resolver cache requests. If this cache is shared, calling this method on the cache will return the aggregate across all cache consumers, so this class maintains its own counter.
      Returns:
      the number of cache requests
    • getRejected

      public long getRejected()
      Returns the number of rejected resolver entries. If this cache is shared, calling this method on the cache will return the aggregate across all cache consumers, so this class maintains its own counter.
      Returns:
      the number of rejected requests
    • getHitRate

      public float getHitRate()
      Returns the cache hit ratio.
      Returns:
      the ratio from 0 to 1
    • stop

      public void stop()
      Shuts down the executor pool.
    • resolve

      public String resolve(String addr, int wait)
      Resolves a host name from an IP address.
      Parameters:
      addr - the IP address
      wait - the maximum time to wait in milliseconds
      Returns:
      the host name, or the IP address if it cannot be resolved or times out