Lines Matching refs:dnsEntry
29 * DNSEntry entry = i.next();
38 * DNSEntry entry = i.next();
45 public class DNSCache extends AbstractMap<String, List<? extends DNSEntry>> {
49 private transient Set<Map.Entry<String, List<? extends DNSEntry>>> _entrySet = null;
94 public List<DNSEntry> get(Object key) {
110 public Collection<List<? extends DNSEntry>> values() {
118 public Set<Map.Entry<String, List<? extends DNSEntry>>> entrySet() {
134 public List<? extends DNSEntry> put(String key, List<? extends DNSEntry> value) {
151 protected static class _CacheEntry extends Object implements Map.Entry<String, List<? extends DNSEntry>> {
153 private List<? extends DNSEntry> _value;
161 protected _CacheEntry(String key, List<? extends DNSEntry> value) {
170 protected _CacheEntry(Map.Entry<String, List<? extends DNSEntry>> entry) {
190 public List<? extends DNSEntry> getValue() {
198 public List<? extends DNSEntry> setValue(List<? extends DNSEntry> value) {
199 List<? extends DNSEntry> oldValue = _value;
242 for (DNSEntry entry : _value) {
277 _entrySet = new HashSet<Map.Entry<String, List<? extends DNSEntry>>>(initialCapacity);
288 public Set<Map.Entry<String, List<? extends DNSEntry>>> entrySet() {
290 _entrySet = new HashSet<Map.Entry<String, List<? extends DNSEntry>>>();
299 protected Map.Entry<String, List<? extends DNSEntry>> getEntry(String key) {
301 for (Map.Entry<String, List<? extends DNSEntry>> entry : this.entrySet()) {
319 public List<? extends DNSEntry> put(String key, List<? extends DNSEntry> value) {
321 List<? extends DNSEntry> oldValue = null;
322 Map.Entry<String, List<? extends DNSEntry>> oldEntry = this.getEntry(key);
347 public synchronized Collection<DNSEntry> allValues() {
348 List<DNSEntry> allValues = new ArrayList<DNSEntry>();
349 for (List<? extends DNSEntry> entry : this.values()) {
358 * 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.
363 public synchronized Collection<? extends DNSEntry> getDNSEntryList(String name) {
364 Collection<? extends DNSEntry> entryList = this._getDNSEntryList(name);
366 entryList = new ArrayList<DNSEntry>(entryList);
373 private Collection<? extends DNSEntry> _getDNSEntryList(String name) {
380 * @param dnsEntry
381 * @return DNSEntry
383 public synchronized DNSEntry getDNSEntry(DNSEntry dnsEntry) {
384 DNSEntry result = null;
385 if (dnsEntry != null) {
386 Collection<? extends DNSEntry> entryList = this._getDNSEntryList(dnsEntry.getKey());
388 for (DNSEntry testDNSEntry : entryList) {
389 if (testDNSEntry.isSameEntry(dnsEntry)) {
405 * @return DNSEntry
407 public synchronized DNSEntry getDNSEntry(String name, DNSRecordType type, DNSRecordClass recordClass) {
408 DNSEntry result = null;
409 Collection<? extends DNSEntry> entryList = this._getDNSEntryList(name);
411 for (DNSEntry testDNSEntry : entryList) {
429 public synchronized Collection<? extends DNSEntry> getDNSEntryList(String name, DNSRecordType type, DNSRecordClass recordClass) {
430 Collection<? extends DNSEntry> entryList = this._getDNSEntryList(name);
432 entryList = new ArrayList<DNSEntry>(entryList);
433 for (Iterator<? extends DNSEntry> i = entryList.iterator(); i.hasNext();) {
434 DNSEntry testDNSEntry = i.next();
448 * @param dnsEntry
451 public synchronized boolean addDNSEntry(final DNSEntry dnsEntry) {
453 if (dnsEntry != null) {
454 Map.Entry<String, List<? extends DNSEntry>> oldEntry = this.getEntry(dnsEntry.getKey());
456 List<DNSEntry> aNewValue = null;
458 aNewValue = new ArrayList<DNSEntry>(oldEntry.getValue());
460 aNewValue = new ArrayList<DNSEntry>();
462 aNewValue.add(dnsEntry);
467 this.entrySet().add(new _CacheEntry(dnsEntry.getKey(), aNewValue));
478 * @param dnsEntry
481 public synchronized boolean removeDNSEntry(DNSEntry dnsEntry) {
483 if (dnsEntry != null) {
484 Map.Entry<String, List<? extends DNSEntry>> existingEntry = this.getEntry(dnsEntry.getKey());
486 result = existingEntry.getValue().remove(dnsEntry);
504 public synchronized boolean replaceDNSEntry(DNSEntry newDNSEntry, DNSEntry existingDNSEntry) {
507 Map.Entry<String, List<? extends DNSEntry>> oldEntry = this.getEntry(newDNSEntry.getKey());
509 List<DNSEntry> aNewValue = null;
511 aNewValue = new ArrayList<DNSEntry>(oldEntry.getValue());
513 aNewValue = new ArrayList<DNSEntry>();
536 for (Map.Entry<String, List<? extends DNSEntry>> entry : this.entrySet()) {