Java Doc for Cache.java in  » Net » dnsjava » org » xbill » DNS » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » dnsjava » org.xbill.DNS 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.xbill.DNS.Cache

Cache
public class Cache (Code)
A cache of DNS records. The cache obeys TTLs, so items are purged after their validity period is complete. Negative answers are cached, to avoid repeated failed DNS queries. The credibility of each RRset is maintained, so that more credible records replace less credible records, and lookups can specify the minimum credibility of data they are requesting.
See Also:   RRset
See Also:   Credibility
author:
   Brian Wellington



Constructor Summary
public  Cache(int dclass)
    
public  Cache()
     Creates an empty Cache for class IN.
public  Cache(String file)
     Creates a Cache which initially contains all records in the specified file.

Method Summary
public  SetResponseaddMessage(Message in)
     Adds all data from a Message into the Cache.
public synchronized  voidaddNegative(Name name, int type, SOARecord soa, int cred)
     Adds a negative entry to the Cache.
public synchronized  voidaddRRset(RRset rrset, int cred)
     Adds an RRset to the Cache.
public synchronized  voidaddRecord(Record r, int cred, Object o)
     Adds a record to the Cache.
public synchronized  voidclearCache()
     Empties the Cache.
public  RRset[]findAnyRecords(Name name, int type)
     Looks up Records in the Cache (a wrapper around lookupRecords).
public  RRset[]findRecords(Name name, int type)
     Looks up credible Records in the Cache (a wrapper around lookupRecords).
public  voidflushName(Name name)
    
public  voidflushSet(Name name, int type)
    
public  intgetDClass()
     Returns the DNS class of this cache.
public  intgetMaxCache()
     Gets the maximum length of time that records will be stored in this Cache.
public  intgetMaxEntries()
     Gets the maximum number of entries in the Cache, where an entry consists of all records with a specific Name.
public  intgetMaxNCache()
     Gets the maximum length of time that a negative response will be stored in this Cache.
public  intgetSize()
     Gets the current number of entries in the Cache, where an entry consists of all records with a specific Name.
protected synchronized  SetResponselookup(Name name, int type, int minCred)
     Finds all matching sets or something that causes the lookup to stop.
public  SetResponselookupRecords(Name name, int type, int minCred)
     Looks up Records in the Cache.
public  voidsetMaxCache(int seconds)
     Sets the maximum length of time that records will be stored in this Cache.
public  voidsetMaxEntries(int entries)
     Sets the maximum number of entries in the Cache, where an entry consists of all records with a specific Name.
public  voidsetMaxNCache(int seconds)
     Sets the maximum length of time that a negative response will be stored in this Cache.
public  StringtoString()
     Returns the contents of the Cache as a string.


Constructor Detail
Cache
public Cache(int dclass)(Code)
Creates an empty Cache
Parameters:
  dclass - The DNS class of this cache
See Also:   DClass



Cache
public Cache()(Code)
Creates an empty Cache for class IN.
See Also:   DClass



Cache
public Cache(String file) throws IOException(Code)
Creates a Cache which initially contains all records in the specified file.




Method Detail
addMessage
public SetResponse addMessage(Message in)(Code)
Adds all data from a Message into the Cache. Each record is added with the appropriate credibility, and negative answers are cached as such.
Parameters:
  in - The Message to be added A SetResponse that reflects what would be returned from a cachelookup, or null if nothing useful could be cached from the message.
See Also:   Message



addNegative
public synchronized void addNegative(Name name, int type, SOARecord soa, int cred)(Code)
Adds a negative entry to the Cache.
Parameters:
  name - The name of the negative entry
Parameters:
  type - The type of the negative entry
Parameters:
  soa - The SOA record to add to the negative cache entry, or null.The negative cache ttl is derived from the SOA.
Parameters:
  cred - The credibility of the negative entry



addRRset
public synchronized void addRRset(RRset rrset, int cred)(Code)
Adds an RRset to the Cache.
Parameters:
  rrset - The RRset to be added
Parameters:
  cred - The credibility of these records
See Also:   RRset



addRecord
public synchronized void addRecord(Record r, int cred, Object o)(Code)
Adds a record to the Cache.
Parameters:
  r - The record to be added
Parameters:
  cred - The credibility of the record
Parameters:
  o - The source of the record (this could be a Message, for example)
See Also:   Record



clearCache
public synchronized void clearCache()(Code)
Empties the Cache.



findAnyRecords
public RRset[] findAnyRecords(Name name, int type)(Code)
Looks up Records in the Cache (a wrapper around lookupRecords). Unlike lookupRecords, this given no indication of why failure occurred.
Parameters:
  name - The name to look up
Parameters:
  type - The type to look up An array of RRsets, or null
See Also:   Credibility



findRecords
public RRset[] findRecords(Name name, int type)(Code)
Looks up credible Records in the Cache (a wrapper around lookupRecords). Unlike lookupRecords, this given no indication of why failure occurred.
Parameters:
  name - The name to look up
Parameters:
  type - The type to look up An array of RRsets, or null
See Also:   Credibility



flushName
public void flushName(Name name)(Code)
Flushes all RRsets with a given name from the cache
Parameters:
  name - The name of the records to be flushed
See Also:   RRset



flushSet
public void flushSet(Name name, int type)(Code)
Flushes an RRset from the cache
Parameters:
  name - The name of the records to be flushed
Parameters:
  type - The type of the records to be flushed
See Also:   RRset



getDClass
public int getDClass()(Code)
Returns the DNS class of this cache.



getMaxCache
public int getMaxCache()(Code)
Gets the maximum length of time that records will be stored in this Cache. A negative value indicates no limit.



getMaxEntries
public int getMaxEntries()(Code)
Gets the maximum number of entries in the Cache, where an entry consists of all records with a specific Name. A negative value is treated as an infinite limit.



getMaxNCache
public int getMaxNCache()(Code)
Gets the maximum length of time that a negative response will be stored in this Cache. A negative value indicates no limit.



getSize
public int getSize()(Code)
Gets the current number of entries in the Cache, where an entry consists of all records with a specific Name.



lookup
protected synchronized SetResponse lookup(Name name, int type, int minCred)(Code)
Finds all matching sets or something that causes the lookup to stop.



lookupRecords
public SetResponse lookupRecords(Name name, int type, int minCred)(Code)
Looks up Records in the Cache. This follows CNAMEs and handles negatively cached data.
Parameters:
  name - The name to look up
Parameters:
  type - The type to look up
Parameters:
  minCred - The minimum acceptable credibility A SetResponse object
See Also:   SetResponse
See Also:   Credibility



setMaxCache
public void setMaxCache(int seconds)(Code)
Sets the maximum length of time that records will be stored in this Cache. A negative value disables this feature (that is, sets no limit).



setMaxEntries
public void setMaxEntries(int entries)(Code)
Sets the maximum number of entries in the Cache, where an entry consists of all records with a specific Name. A negative value is treated as an infinite limit. Note that setting this to a value lower than the current number of entries will not cause the Cache to shrink immediately. The default maximum number of entries is 50000.
Parameters:
  entries - The maximum number of entries in the Cache.



setMaxNCache
public void setMaxNCache(int seconds)(Code)
Sets the maximum length of time that a negative response will be stored in this Cache. A negative value disables this feature (that is, sets no limit).



toString
public String toString()(Code)
Returns the contents of the Cache as a string.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.