A table of DNS entries. This is a hash table which can handle multiple entries with the same name.
Storing multiple entries with the same name is implemented using a linked list of
CacheNode
's.
The current implementation of the API of DNSCache does expose the cache nodes to clients. Clients must explicitly deal with the nodes when iterating over entries in the cache. Here's how to iterate over all entries in the cache:
for (Iterator i=dnscache.iterator(); i.hasNext(); ) { for (DNSCache.CacheNode n = (DNSCache.CacheNode) i.next(); n != null; n.next()) { DNSEntry entry = n.getValue(); ...do something with entry... } }
And here's how to iterate over all entries having a given name:
for (DNSCache.CacheNode n = (DNSCache.CacheNode) dnscache.find(name); n != null; n.next()) { DNSEntry entry = n.getValue(); ...do something with entry... }
@version %I%, %G%
@author Arthur van Hoff, Werner Randelshofer, Rick Blair