Class Resolver
java.lang.Object
org.deltava.util.dns.Resolver
A utility class to pass asynchronous reverse DNS requests to a separate daemon thread.
- Since:
- 12.4
- Version:
- 12.4
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the cache hit ratio.longgetHits()Returns the number of resolver cache hits.longReturns the number of rejected resolver entries.longReturns the number of resolver cache requests.intReturns the number of currently active resolver threads.Resolves a host name from an IP address.voidstart()Starts the executor pool.voidstop()Shuts down the executor pool.
-
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
-