java.lang.Object
net.i2p.router.transport.ReverseDnsLookup.CacheEntry
Enclosing class:
ReverseDnsLookup

public static class ReverseDnsLookup.CacheEntryextends Object
Cache entry for IP address and hostname mappings.
  • Constructor Details

    • CacheEntry

      public CacheEntry(String ipAddress, String hostname)
      Creates an entry cached at the current time.
      Parameters:
      ipAddress - the IP address the entry describes
      hostname - the resolved host name, stored as "unknown" when null
    • CacheEntry

      public CacheEntry(String ipAddress, String hostname, long timestamp)
      Creates an entry with the given cache timestamp.
      Parameters:
      ipAddress - the IP address the entry describes
      hostname - the resolved host name, stored as "unknown" when null
      timestamp - epoch milliseconds at which the entry was cached, used to expire it
  • Method Details

    • getIpAddress

      public String getIpAddress()
      The cached IP address of the entry.
      Returns:
      the IP address
    • getHostname

      public String getHostname()
      The cached hostname for the entry.
      Returns:
      the resolved host name, or "unknown" if the lookup resolved none
    • getTimestamp

      public long getTimestamp()
      The timestamp when the entry was cached.
      Returns:
      the epoch milliseconds at which the entry was cached, used to expire it
    • getRdnsEntry

      public String getRdnsEntry()
      The formatted rDNS cache entry.
      Returns:
      the rDNS entry