info.informatica.net
Class PropertyDNSCache

java.lang.Object
  extended by info.informatica.util.ObjectCache
      extended by info.informatica.net.PropertyDNSCache

public final class PropertyDNSCache
extends ObjectCache

Properties-based DNS cache.

Do not use to cache a large amount of DNS entries.

Version:
1.06
Author:
amengual at informatica dot info

Field Summary
static String DNS_CACHE_FILE
           
 
Constructor Summary
PropertyDNSCache()
           
 
Method Summary
 void close()
          Closes this cache.
 void init(Properties conf)
           
 DatedContainer<String> lookup(String ip)
           
 String lookupString(String ip)
           
 void put(String ip, DatedContainer<String> dc)
           
 void put(String ip, String name)
           
 void setExpireTime(long t)
          Sets the cache entry expire time.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DNS_CACHE_FILE

public static final String DNS_CACHE_FILE
See Also:
Constant Field Values
Constructor Detail

PropertyDNSCache

public PropertyDNSCache()
Method Detail

init

public void init(Properties conf)
          throws CacheException
Specified by:
init in class ObjectCache
Throws:
CacheException

setExpireTime

public void setExpireTime(long t)
Description copied from class: ObjectCache
Sets the cache entry expire time.

Specified by:
setExpireTime in class ObjectCache
Parameters:
t - the time in seconds.

lookupString

public String lookupString(String ip)
Specified by:
lookupString in class ObjectCache

lookup

public DatedContainer<String> lookup(String ip)
Specified by:
lookup in class ObjectCache

put

public void put(String ip,
                String name)
Specified by:
put in class ObjectCache

put

public void put(String ip,
                DatedContainer<String> dc)
Overrides:
put in class ObjectCache

close

public void close()
           throws CacheException
Description copied from class: ObjectCache
Closes this cache.

Specified by:
close in class ObjectCache
Throws:
CacheException - if a problem arose when attempting to close.