org.jnetpcap.util.resolver
Class IpResolver

java.lang.Object
  extended by org.jnetpcap.util.resolver.AbstractResolver
      extended by org.jnetpcap.util.resolver.IpResolver
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, Resolver

public class IpResolver
extends AbstractResolver

A resolver object that knows how to convert IP addresses into hostnames.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jnetpcap.util.resolver.Resolver
Resolver.ResolverType
 
Field Summary
 
Fields inherited from class org.jnetpcap.util.resolver.AbstractResolver
INFINITE_TIMEOUT, logger
 
Fields inherited from interface org.jnetpcap.util.resolver.Resolver
RESOLVER_SEARCH_PATH_PROPERTY
 
Constructor Summary
IpResolver()
           
 
Method Summary
 java.lang.String resolveToName(byte[] address, long hash)
          Resolves an address to a name.
protected  java.lang.String resolveToName(long number, long hash)
          Resolves number to a name.
 long toHashCode(byte[] address)
           
 
Methods inherited from class org.jnetpcap.util.resolver.AbstractResolver
addToCache, addToCache, canBeResolved, clearCache, finalize, getCacheCapacity, getCacheLoadFactor, getNegativeTimeout, getPositiveTimeout, hasCacheFile, initializeIfNeeded, isCached, loadCache, loadCache, loadCache, propertyChange, resolve, saveCache, saveCache, setCacheCapacity, setCacheLoadFactor, setNegativeTimeout, setPositiveTimeout, toHashCode, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IpResolver

public IpResolver()
Parameters:
type -
Method Detail

resolveToName

public java.lang.String resolveToName(byte[] address,
                                      long hash)
Description copied from class: AbstractResolver
Resolves an address to a name. Performs any neccessary lookups to try and resolve the name. The method should not access any of the cached information. THis method is called only after the cache has already been checked and failed to produce a positive or negative lookup entry.

Specified by:
resolveToName in class AbstractResolver
Parameters:
address - address to resolve
hash - computed hash code for the address, identifies the address uniquely

toHashCode

public long toHashCode(byte[] address)
Specified by:
toHashCode in class AbstractResolver

resolveToName

protected java.lang.String resolveToName(long number,
                                         long hash)
Description copied from class: AbstractResolver
Resolves number to a name. Performs any neccessary lookups to try and resolve the name. The method should not access any of the cached information. THis method is called only after the cache has already been checked and failed to produce a positive or negative lookup entry.

Specified by:
resolveToName in class AbstractResolver
Parameters:
number - a number value to resolve
hash - computed hash code for the number, identifies the number uniquely