Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
javax.jmdns.impl.DNSCache Class Reference
Inheritance diagram for javax.jmdns.impl.DNSCache:
Inheritance graph
[legend]

List of all members.

Classes

class  _CacheEntry
class  _EmptyCache

Public Member Functions

synchronized boolean addDNSEntry (final DNSEntry dnsEntry)
synchronized Collection< DNSEntryallValues ()
 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 DNSEntryput (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

Detailed Description

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...
       }
 
Author:
Arthur van Hoff, Werner Randelshofer, Rick Blair, Pierre Frisch

Definition at line 45 of file DNSCache.java.


Constructor & Destructor Documentation

Definition at line 256 of file DNSCache.java.

Parameters:
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.

Parameters:
initialCapacity

Definition at line 275 of file DNSCache.java.


Member Function Documentation

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.

Parameters:
dnsEntry
Returns:
true if the entry was added

Definition at line 451 of file DNSCache.java.

synchronized Collection<DNSEntry> javax.jmdns.impl.DNSCache.allValues ( ) [inline]

Returns all entries in the cache

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.

Parameters:
dnsEntry
Returns:
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.

Parameters:
name
type
recordClass
Returns:
DNSEntry

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.

Parameters:
name
Returns:
list of DNSEntries

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.

Parameters:
name
type
recordClass
Returns:
list of entries

Definition at line 429 of file DNSCache.java.

Map.Entry<String, List<? extends DNSEntry> > javax.jmdns.impl.DNSCache.getEntry ( String  key) [inline, protected]
Parameters:
key
Returns:
map entry for the key

Definition at line 299 of file DNSCache.java.

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.

Parameters:
dnsEntry
Returns:
true if the entry was removed

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.

Parameters:
newDNSEntry
existingDNSEntry
Returns:
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.


Member Data Documentation

transient Set<Map.Entry<String, List<? extends DNSEntry> > > javax.jmdns.impl.DNSCache._entrySet = null [private]

Definition at line 49 of file DNSCache.java.

Definition at line 54 of file DNSCache.java.


The documentation for this class was generated from the following file:


zeroconf_jmdns_suite
Author(s): Daniel Stonier
autogenerated on Thu Aug 27 2015 15:50:27