Java Doc for Message.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.Message

All known Subclasses:   org.xbill.DNS.Update,
Message
public class Message implements Cloneable(Code)
A DNS Message. A message is the basic unit of communication between the client and server of a DNS operation. A message consists of a Header and 4 message sections.
See Also:   Resolver
See Also:   Header
See Also:   Section
author:
   Brian Wellington


Field Summary
final public static  intMAXLENGTH
     The maximum length of a message in wire format.
final static  intTSIG_FAILED
    
final static  intTSIG_INTERMEDIATE
    
final static  intTSIG_SIGNED
    
final static  intTSIG_UNSIGNED
    
final static  intTSIG_VERIFIED
    
 inttsigState
    
 inttsigstart
    

Constructor Summary
public  Message(int id)
    
public  Message()
    
 Message(DNSInput in)
    
public  Message(byte[] b)
    

Method Summary
public  voidaddRecord(Record r, int section)
     Adds a record to a section of the Message, and adjusts the header.
public  Objectclone()
     Creates a copy of this Message.
public  booleanfindRRset(Name name, int type, int section)
     Determines if an RRset with the given name and type is already present in the given section.
public  booleanfindRRset(Name name, int type)
     Determines if an RRset with the given name and type is already present in any section.
public  booleanfindRecord(Record r, int section)
     Determines if the given record is already present in the given section.
public  booleanfindRecord(Record r)
     Determines if the given record is already present in any section.
public  HeadergetHeader()
     Retrieves the Header.
public  OPTRecordgetOPT()
     Returns the OPT record from the ADDITIONAL section, if one is present.
public  RecordgetQuestion()
     Returns the first record in the QUESTION section.
public  intgetRcode()
     Returns the message's rcode (error code).
public  Record[]getSectionArray(int section)
     Returns an array containing all records in the given section, or an empty array if the section is empty.
public  RRset[]getSectionRRsets(int section)
     Returns an array containing all records in the given section grouped into RRsets.
public  TSIGRecordgetTSIG()
     Returns the TSIG record from the ADDITIONAL section, if one is present.
public  booleanisSigned()
    
public  booleanisVerified()
    
public static  MessagenewQuery(Record r)
     Creates a new Message with a random Message ID suitable for sending as a query.
public static  MessagenewUpdate(Name zone)
     Creates a new Message to contain a dynamic update.
public  intnumBytes()
     Returns the size of the message.
public  voidremoveAllRecords(int section)
     Removes all records from a section of the Message, and adjusts the header.
public  booleanremoveRecord(Record r, int section)
     Removes a record from a section of the Message, and adjusts the header.
public  StringsectionToString(int i)
     Converts the given section of the Message to a String.
public  voidsetHeader(Header h)
     Replaces the Header with a new one.
public  voidsetTSIG(TSIG key, int error, TSIGRecord querytsig)
     Sets the TSIG key and other necessary information to sign a message.
public  StringtoString()
     Converts the Message to a String.
 voidtoWire(DNSOutput out)
    
public  byte[]toWire()
     Returns an array containing the wire format representation of the Message.
public  byte[]toWire(int maxLength)
     Returns an array containing the wire format representation of the Message with the specified maximum length.

Field Detail
MAXLENGTH
final public static int MAXLENGTH(Code)
The maximum length of a message in wire format.



TSIG_FAILED
final static int TSIG_FAILED(Code)



TSIG_INTERMEDIATE
final static int TSIG_INTERMEDIATE(Code)



TSIG_SIGNED
final static int TSIG_SIGNED(Code)



TSIG_UNSIGNED
final static int TSIG_UNSIGNED(Code)



TSIG_VERIFIED
final static int TSIG_VERIFIED(Code)



tsigState
int tsigState(Code)



tsigstart
int tsigstart(Code)




Constructor Detail
Message
public Message(int id)(Code)
Creates a new Message with the specified Message ID



Message
public Message()(Code)
Creates a new Message with a random Message ID



Message
Message(DNSInput in) throws IOException(Code)



Message
public Message(byte[] b) throws IOException(Code)
Creates a new Message from its DNS wire format representation
Parameters:
  b - A byte array containing the DNS Message.




Method Detail
addRecord
public void addRecord(Record r, int section)(Code)
Adds a record to a section of the Message, and adjusts the header.
See Also:   Record
See Also:   Section



clone
public Object clone()(Code)
Creates a copy of this Message. This is done by the Resolver before adding TSIG and OPT records, for example.
See Also:   Resolver
See Also:   TSIGRecord
See Also:   OPTRecord



findRRset
public boolean findRRset(Name name, int type, int section)(Code)
Determines if an RRset with the given name and type is already present in the given section.
See Also:   RRset
See Also:   Section



findRRset
public boolean findRRset(Name name, int type)(Code)
Determines if an RRset with the given name and type is already present in any section.
See Also:   RRset
See Also:   Section



findRecord
public boolean findRecord(Record r, int section)(Code)
Determines if the given record is already present in the given section.
See Also:   Record
See Also:   Section



findRecord
public boolean findRecord(Record r)(Code)
Determines if the given record is already present in any section.
See Also:   Record
See Also:   Section



getHeader
public Header getHeader()(Code)
Retrieves the Header.
See Also:   Header



getOPT
public OPTRecord getOPT()(Code)
Returns the OPT record from the ADDITIONAL section, if one is present.
See Also:   OPTRecord
See Also:   Section



getQuestion
public Record getQuestion()(Code)
Returns the first record in the QUESTION section.
See Also:   Record
See Also:   Section



getRcode
public int getRcode()(Code)
Returns the message's rcode (error code). This incorporates the EDNS extended rcode.



getSectionArray
public Record[] getSectionArray(int section)(Code)
Returns an array containing all records in the given section, or an empty array if the section is empty.
See Also:   Record
See Also:   Section



getSectionRRsets
public RRset[] getSectionRRsets(int section)(Code)
Returns an array containing all records in the given section grouped into RRsets.
See Also:   RRset
See Also:   Section



getTSIG
public TSIGRecord getTSIG()(Code)
Returns the TSIG record from the ADDITIONAL section, if one is present.
See Also:   TSIGRecord
See Also:   TSIG
See Also:   Section



isSigned
public boolean isSigned()(Code)
Was this message signed by a TSIG?
See Also:   TSIG



isVerified
public boolean isVerified()(Code)
If this message was signed by a TSIG, was the TSIG verified?
See Also:   TSIG



newQuery
public static Message newQuery(Record r)(Code)
Creates a new Message with a random Message ID suitable for sending as a query.
Parameters:
  r - A record containing the question



newUpdate
public static Message newUpdate(Name zone)(Code)
Creates a new Message to contain a dynamic update. A random Message ID and the zone are filled in.
Parameters:
  zone - The zone to be updated



numBytes
public int numBytes()(Code)
Returns the size of the message. Only valid if the message has been converted to or from wire format.



removeAllRecords
public void removeAllRecords(int section)(Code)
Removes all records from a section of the Message, and adjusts the header.
See Also:   Record
See Also:   Section



removeRecord
public boolean removeRecord(Record r, int section)(Code)
Removes a record from a section of the Message, and adjusts the header.
See Also:   Record
See Also:   Section



sectionToString
public String sectionToString(int i)(Code)
Converts the given section of the Message to a String.
See Also:   Section



setHeader
public void setHeader(Header h)(Code)
Replaces the Header with a new one.
See Also:   Header



setTSIG
public void setTSIG(TSIG key, int error, TSIGRecord querytsig)(Code)
Sets the TSIG key and other necessary information to sign a message.
Parameters:
  key - The TSIG key.
Parameters:
  error - The value of the TSIG error field.
Parameters:
  querytsig - If this is a response, the TSIG from the request.



toString
public String toString()(Code)
Converts the Message to a String.



toWire
void toWire(DNSOutput out)(Code)



toWire
public byte[] toWire()(Code)
Returns an array containing the wire format representation of the Message.



toWire
public byte[] toWire(int maxLength)(Code)
Returns an array containing the wire format representation of the Message with the specified maximum length. This will generate a truncated message (with the TC bit) if the message doesn't fit, and will also sign the message with the TSIG key set by a call to setTSIG(). This method may return null if the message could not be rendered at all; this could happen if maxLength is smaller than a DNS header, for example.
Parameters:
  maxLength - The maximum length of the message. The wire format of the message, or null if the message could not berendered into the specified length.
See Also:   Flags
See Also:   TSIG



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.