| java.lang.Object org.xbill.DNS.Record
All known Subclasses: org.xbill.DNS.SRVRecord, org.xbill.DNS.TSIGRecord, org.xbill.DNS.U16NameBase, org.xbill.DNS.IPSECKEYRecord, org.xbill.DNS.NSECRecord, org.xbill.DNS.TXTBase, org.xbill.DNS.UNKRecord, org.xbill.DNS.CERTRecord, org.xbill.DNS.WKSRecord, org.xbill.DNS.KEYBase, org.xbill.DNS.NSAPRecord, org.xbill.DNS.TKEYRecord, org.xbill.DNS.NXTRecord, org.xbill.DNS.NAPTRRecord, org.xbill.DNS.LOCRecord, org.xbill.DNS.DSRecord, org.xbill.DNS.MINFORecord, org.xbill.DNS.ARecord, org.xbill.DNS.A6Record, org.xbill.DNS.RPRecord, org.xbill.DNS.HINFORecord, org.xbill.DNS.X25Record, org.xbill.DNS.SIGBase, org.xbill.DNS.APLRecord, org.xbill.DNS.OPTRecord, org.xbill.DNS.SingleNameBase, org.xbill.DNS.PXRecord, org.xbill.DNS.NULLRecord, org.xbill.DNS.AAAARecord, org.xbill.DNS.SOARecord, org.xbill.DNS.SSHFPRecord, org.xbill.DNS.EmptyRecord, org.xbill.DNS.ISDNRecord, org.xbill.DNS.GPOSRecord,
Record | abstract public class Record implements Cloneable,Comparable(Code) | | A generic DNS resource record. The specific record types extend this class.
A record contains a name, type, class, ttl, and rdata.
author: Brian Wellington |
Constructor Summary | |
protected | Record() | | Record(Name name, int type, int dclass, long ttl) |
Method Summary | |
protected static byte[] | byteArrayFromString(String s) Converts a String into a byte array. | protected static String | byteArrayToString(byte[] array, boolean quote) Converts a byte array into a String. | static Name | checkName(String field, Name name) | static int | checkU16(String field, int val) | static long | checkU32(String field, long val) | static int | checkU8(String field, int val) | Record | cloneRecord() | public int | compareTo(Object o) Compares this Record to another Object.
Parameters: o - The Object to be compared. | public boolean | equals(Object arg) Determines if two Records are identical. | public static Record | fromString(Name name, int type, int dclass, long ttl, Tokenizer st, Name origin) Builds a new Record from its textual representation
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. Parameters: st - A tokenizer containing the textual representation of the rdata. Parameters: origin - The default origin to be appended to relative domain names. | public static Record | fromString(Name name, int type, int dclass, long ttl, String s, Name origin) Builds a new Record from its textual representation
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. Parameters: s - The textual representation of the rdata. Parameters: origin - The default origin to be appended to relative domain names. | static Record | fromWire(DNSInput in, int section, boolean isUpdate) | static Record | fromWire(DNSInput in, int section) | public static Record | fromWire(byte[] b, int section) Builds a Record from DNS uncompressed wire format. | public Name | getAdditionalName() Returns the name for which additional data processing should be done
for this record. | public int | getDClass() | public Name | getName() | abstract Record | getObject() | public int | getRRsetType() Returns the type of RRset that this record would belong to. | public long | getTTL() | public int | getType() | public int | hashCode() Generates a hash code based on the Record's data. | public static Record | newRecord(Name name, int type, int dclass, long ttl, int length, byte[] data) Creates a new record, with the given parameters.
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. Parameters: length - The length of the record's data. Parameters: data - The rdata of the record, in uncompressed DNS wire format. | public static Record | newRecord(Name name, int type, int dclass, long ttl, byte[] data) Creates a new record, with the given parameters. | public static Record | newRecord(Name name, int type, int dclass, long ttl) Creates a new empty record, with the given parameters.
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. | public static Record | newRecord(Name name, int type, int dclass) Creates a new empty record, with the given parameters. | abstract void | rdataFromString(Tokenizer st, Name origin) | public String | rdataToString() | public byte[] | rdataToWireCanonical() Converts the rdata in a Record into canonical DNS uncompressed wire format
(all names are converted to lowercase). | abstract void | rrFromWire(DNSInput in) | abstract String | rrToString() | abstract void | rrToWire(DNSOutput out, Compression c, boolean canonical) | public boolean | sameRRset(Record rec) Determines if two Records could be part of the same RRset. | void | setTTL(long ttl) | public String | toString() | void | toWire(DNSOutput out, int section, Compression c) | public byte[] | toWire(int section) Converts a Record into DNS uncompressed wire format. | public byte[] | toWireCanonical() Converts a Record into canonical DNS uncompressed wire format (all names are
converted to lowercase). | protected static String | unknownToString(byte[] data) Converts a byte array into the unknown RR format. | Record | withDClass(int dclass, long ttl) Creates a new record identical to the current record, but with a different
class and ttl. | public Record | withName(Name name) Creates a new record identical to the current record, but with a different
name. |
typedclass | protected int typedclass(Code) | | |
Record | protected Record()(Code) | | |
Record | Record(Name name, int type, int dclass, long ttl)(Code) | | |
byteArrayToString | protected static String byteArrayToString(byte[] array, boolean quote)(Code) | | Converts a byte array into a String.
|
compareTo | public int compareTo(Object o)(Code) | | Compares this Record to another Object.
Parameters: o - The Object to be compared. The value 0 if the argument is a record equivalent to this record;a value less than 0 if the argument is less than this record in thecanonical ordering, and a value greater than 0 if the argument is greaterthan this record in the canonical ordering. The canonical orderingis defined to compare by name, class, type, and rdata. throws: ClassCastException - if the argument is not a Record. |
equals | public boolean equals(Object arg)(Code) | | Determines if two Records are identical. This compares the name, type,
class, and rdata (with names canonicalized). The TTLs are not compared.
Parameters: arg - The record to compare to true if the records are equal, false otherwise. |
fromString | public static Record fromString(Name name, int type, int dclass, long ttl, Tokenizer st, Name origin) throws IOException(Code) | | Builds a new Record from its textual representation
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. Parameters: st - A tokenizer containing the textual representation of the rdata. Parameters: origin - The default origin to be appended to relative domain names. The new record throws: IOException - The text format was invalid. |
fromString | public static Record fromString(Name name, int type, int dclass, long ttl, String s, Name origin) throws IOException(Code) | | Builds a new Record from its textual representation
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. Parameters: s - The textual representation of the rdata. Parameters: origin - The default origin to be appended to relative domain names. The new record throws: IOException - The text format was invalid. |
fromWire | public static Record fromWire(byte[] b, int section) throws IOException(Code) | | Builds a Record from DNS uncompressed wire format.
|
getAdditionalName | public Name getAdditionalName()(Code) | | Returns the name for which additional data processing should be done
for this record. This can be used both for building responses and
parsing responses.
The name to used for additional data processing, or null if thisrecord type does not require additional data processing. |
getDClass | public int getDClass()(Code) | | Returns the record's class
|
getName | public Name getName()(Code) | | Returns the record's name
See Also: Name |
getObject | abstract Record getObject()(Code) | | Creates an empty record of the correct type; must be overriden
|
getRRsetType | public int getRRsetType()(Code) | | Returns the type of RRset that this record would belong to. For all types
except RRSIGRecord, this is equivalent to getType().
The type of record, if not SIGRecord. If the type is RRSIGRecord,the type covered is returned. See Also: Type See Also: RRset See Also: SIGRecord |
getTTL | public long getTTL()(Code) | | Returns the record's TTL
|
getType | public int getType()(Code) | | Returns the record's type
See Also: Type |
hashCode | public int hashCode()(Code) | | Generates a hash code based on the Record's data.
|
newRecord | public static Record newRecord(Name name, int type, int dclass, long ttl, int length, byte[] data)(Code) | | Creates a new record, with the given parameters.
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. Parameters: length - The length of the record's data. Parameters: data - The rdata of the record, in uncompressed DNS wire format. Onlythe first length bytes are used. |
newRecord | public static Record newRecord(Name name, int type, int dclass, long ttl, byte[] data)(Code) | | Creates a new record, with the given parameters.
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. Parameters: data - The complete rdata of the record, in uncompressed DNS wireformat. |
newRecord | public static Record newRecord(Name name, int type, int dclass, long ttl)(Code) | | Creates a new empty record, with the given parameters.
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. Parameters: ttl - The record's time to live. An object of a subclass of Record |
newRecord | public static Record newRecord(Name name, int type, int dclass)(Code) | | Creates a new empty record, with the given parameters. This method is
designed to create records that will be added to the QUERY section
of a message.
Parameters: name - The owner name of the record. Parameters: type - The record's type. Parameters: dclass - The record's class. An object of a subclass of Record |
rdataFromString | abstract void rdataFromString(Tokenizer st, Name origin) throws IOException(Code) | | Converts the text format of an RR to the internal format - must be overriden
|
rdataToString | public String rdataToString()(Code) | | Converts the rdata portion of a Record into a String representation
|
rdataToWireCanonical | public byte[] rdataToWireCanonical()(Code) | | Converts the rdata in a Record into canonical DNS uncompressed wire format
(all names are converted to lowercase).
|
rrFromWire | abstract void rrFromWire(DNSInput in) throws IOException(Code) | | Converts the type-specific RR to wire format - must be overriden
|
rrToString | abstract String rrToString()(Code) | | Converts the type-specific RR to text format - must be overriden
|
rrToWire | abstract void rrToWire(DNSOutput out, Compression c, boolean canonical)(Code) | | Converts the type-specific RR to wire format - must be overriden
|
sameRRset | public boolean sameRRset(Record rec)(Code) | | Determines if two Records could be part of the same RRset.
This compares the name, type, and class of the Records; the ttl and
rdata are not compared.
|
setTTL | void setTTL(long ttl)(Code) | | |
toString | public String toString()(Code) | | Converts a Record into a String representation
|
toWire | public byte[] toWire(int section)(Code) | | Converts a Record into DNS uncompressed wire format.
|
toWireCanonical | public byte[] toWireCanonical()(Code) | | Converts a Record into canonical DNS uncompressed wire format (all names are
converted to lowercase).
|
unknownToString | protected static String unknownToString(byte[] data)(Code) | | Converts a byte array into the unknown RR format.
|
withDClass | Record withDClass(int dclass, long ttl)(Code) | | Creates a new record identical to the current record, but with a different
class and ttl. This is most useful for dynamic update.
|
withName | public Record withName(Name name)(Code) | | Creates a new record identical to the current record, but with a different
name. This is most useful for replacing the name of a wildcard record.
|
|
|