org.jasen.net
Class CachedInetAddress

java.lang.Object
  extended byorg.jasen.net.CachedInetAddress
All Implemented Interfaces:
Serializable

public class CachedInetAddress
extends Object
implements Serializable

Used by the rudamentary caching system employed by the JasenInetAddressResolver.

It is recommended that an alternate resolver be used in production.

Author:
Jason Polites
See Also:
Serialized Form

Constructor Summary
CachedInetAddress()
           
 
Method Summary
 long getCachedAt()
          Gets the time (in seconds) that this address was cached
 String getHostname()
          Gets the hostname for this address
 InetAddress getInetAddress()
          Gets the cached InetAddress
 long getTtl()
          Gets the Time To Live in seconds
 void setCachedAt(long cachedAt)
          Sets the time (in seconds) that this address was cached
 void setHostname(String host)
          Sets the hostname for this address
 void setInetAddress(InetAddress inetAddress)
          Sets the cached InetAddress
 void setTtl(long ttl)
          Sets the Time To Live in seconds
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedInetAddress

public CachedInetAddress()
Method Detail

getCachedAt

public long getCachedAt()
Gets the time (in seconds) that this address was cached

Returns:
The time the address was last cached

setCachedAt

public void setCachedAt(long cachedAt)
Sets the time (in seconds) that this address was cached

Parameters:
cachedAt -

getInetAddress

public InetAddress getInetAddress()
                           throws UnknownHostException
Gets the cached InetAddress

Returns:
The InetAddress object corresponding to this cache entry
Throws:
UnknownHostException - if the address was an "unknown" address

setInetAddress

public void setInetAddress(InetAddress inetAddress)
Sets the cached InetAddress

Parameters:
inetAddress -

getTtl

public long getTtl()
Gets the Time To Live in seconds

Returns:

setTtl

public void setTtl(long ttl)
Sets the Time To Live in seconds

Parameters:
ttl -

getHostname

public String getHostname()
Gets the hostname for this address

Returns:
The hostname for this address

setHostname

public void setHostname(String host)
Sets the hostname for this address

Parameters:
host -