Classes | |
class | _CacheEntry |
class | _EmptyCache |
Public Member Functions | |
synchronized boolean | addDNSEntry (final DNSEntry dnsEntry) |
synchronized Collection< DNSEntry > | allValues () |
DNSCache () | |
DNSCache (DNSCache map) | |
DNSCache (int initialCapacity) | |
Set< Map.Entry< String, List <?extends DNSEntry > > > | entrySet () |
synchronized DNSEntry | getDNSEntry (DNSEntry dnsEntry) |
synchronized DNSEntry | getDNSEntry (String name, DNSRecordType type, DNSRecordClass recordClass) |
synchronized Collection <?extends DNSEntry > | getDNSEntryList (String name) |
synchronized Collection <?extends DNSEntry > | getDNSEntryList (String name, DNSRecordType type, DNSRecordClass recordClass) |
List<?extends DNSEntry > | put (String key, List<?extends DNSEntry > value) |
synchronized boolean | removeDNSEntry (DNSEntry dnsEntry) |
synchronized boolean | replaceDNSEntry (DNSEntry newDNSEntry, DNSEntry existingDNSEntry) |
synchronized String | toString () |
Static Public Attributes | |
static final DNSCache | EmptyCache = new _EmptyCache() |
Protected Member Functions | |
Object | clone () throws CloneNotSupportedException |
Map.Entry< String, List <?extends DNSEntry > > | getEntry (String key) |
Private Member Functions | |
Collection<?extends DNSEntry > | _getDNSEntryList (String name) |
Private Attributes | |
transient Set< Map.Entry < String, List<?extends DNSEntry > > > | _entrySet = null |
A table of DNS entries. This is a map table which can handle multiple entries with the same name.
Storing multiple entries with the same name is implemented using a linked list. This is hidden from the user and can change in later implementation.
Here's how to iterate over all entries:
for (Iterator i=dnscache.allValues().iterator(); i.hasNext(); ) { DNSEntry entry = i.next(); ...do something with entry... }
And here's how to iterate over all entries having a given name:
for (Iterator i=dnscache.getDNSEntryList(name).iterator(); i.hasNext(); ) { DNSEntry entry = i.next(); ...do something with entry... }
Definition at line 45 of file DNSCache.java.
javax.jmdns.impl.DNSCache.DNSCache | ( | ) | [inline] |
Definition at line 256 of file DNSCache.java.
javax.jmdns.impl.DNSCache.DNSCache | ( | DNSCache | map | ) | [inline] |
map |
Definition at line 263 of file DNSCache.java.
javax.jmdns.impl.DNSCache.DNSCache | ( | int | initialCapacity | ) | [inline] |
Create a table with a given initial size.
initialCapacity |
Definition at line 275 of file DNSCache.java.
Collection<? extends DNSEntry> javax.jmdns.impl.DNSCache._getDNSEntryList | ( | String | name | ) | [inline, private] |
Definition at line 373 of file DNSCache.java.
synchronized boolean javax.jmdns.impl.DNSCache.addDNSEntry | ( | final DNSEntry | dnsEntry | ) | [inline] |
Adds an entry to the table.
dnsEntry |
Definition at line 451 of file DNSCache.java.
synchronized Collection<DNSEntry> javax.jmdns.impl.DNSCache.allValues | ( | ) | [inline] |
Returns all entries in the cache
Definition at line 347 of file DNSCache.java.
Object javax.jmdns.impl.DNSCache.clone | ( | ) | throws CloneNotSupportedException [inline, protected] |
Definition at line 336 of file DNSCache.java.
Set<Map.Entry<String, List<? extends DNSEntry> > > javax.jmdns.impl.DNSCache.entrySet | ( | ) | [inline] |
Reimplemented in javax.jmdns.impl.DNSCache._EmptyCache.
Definition at line 288 of file DNSCache.java.
synchronized DNSEntry javax.jmdns.impl.DNSCache.getDNSEntry | ( | DNSEntry | dnsEntry | ) | [inline] |
Get a matching DNS entry from the table (using isSameEntry). Returns the entry that was found.
dnsEntry |
Definition at line 383 of file DNSCache.java.
synchronized DNSEntry javax.jmdns.impl.DNSCache.getDNSEntry | ( | String | name, |
DNSRecordType | type, | ||
DNSRecordClass | recordClass | ||
) | [inline] |
Get a matching DNS entry from the table.
name | |
type | |
recordClass |
Definition at line 407 of file DNSCache.java.
synchronized Collection<? extends DNSEntry> javax.jmdns.impl.DNSCache.getDNSEntryList | ( | String | name | ) | [inline] |
Iterate only over items with matching name. Returns an list of DNSEntry or null. To retrieve all entries, one must iterate over this linked list.
name |
Definition at line 363 of file DNSCache.java.
synchronized Collection<? extends DNSEntry> javax.jmdns.impl.DNSCache.getDNSEntryList | ( | String | name, |
DNSRecordType | type, | ||
DNSRecordClass | recordClass | ||
) | [inline] |
Get all matching DNS entries from the table.
name | |
type | |
recordClass |
Definition at line 429 of file DNSCache.java.
Map.Entry<String, List<? extends DNSEntry> > javax.jmdns.impl.DNSCache.getEntry | ( | String | key | ) | [inline, protected] |
List<? extends DNSEntry> javax.jmdns.impl.DNSCache.put | ( | String | key, |
List<?extends DNSEntry > | value | ||
) | [inline] |
Reimplemented in javax.jmdns.impl.DNSCache._EmptyCache.
Definition at line 319 of file DNSCache.java.
synchronized boolean javax.jmdns.impl.DNSCache.removeDNSEntry | ( | DNSEntry | dnsEntry | ) | [inline] |
Removes a specific entry from the table. Returns true if the entry was found.
dnsEntry |
Definition at line 481 of file DNSCache.java.
synchronized boolean javax.jmdns.impl.DNSCache.replaceDNSEntry | ( | DNSEntry | newDNSEntry, |
DNSEntry | existingDNSEntry | ||
) | [inline] |
Replace an existing entry by a new one.
Note: the 2 entries must have the same key.
newDNSEntry | |
existingDNSEntry |
true
if the entry has been replace, false
otherwise. Definition at line 504 of file DNSCache.java.
synchronized String javax.jmdns.impl.DNSCache.toString | ( | ) | [inline] |
Definition at line 533 of file DNSCache.java.
transient Set<Map.Entry<String, List<? extends DNSEntry> > > javax.jmdns.impl.DNSCache._entrySet = null [private] |
Definition at line 49 of file DNSCache.java.
final DNSCache javax.jmdns.impl.DNSCache.EmptyCache = new _EmptyCache() [static] |
Definition at line 54 of file DNSCache.java.