|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xbill.DNS.Record
A generic DNS resource record. The specific record types extend this class. A record contains a name, type, class, and rdata.
| Field Summary | |
protected int |
dclass
|
protected Name |
name
|
protected long |
ttl
|
protected int |
type
|
| Constructor Summary | |
protected |
Record()
|
| 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. |
int |
compareTo(Object o)
Compares this Record to another Object. |
boolean |
equals(Object arg)
Determines if two Records are identical. |
static Record |
fromString(Name name,
int type,
int dclass,
long ttl,
String s,
Name origin)
Builds a new Record from its textual representation |
static Record |
fromString(Name name,
int type,
int dclass,
long ttl,
Tokenizer st,
Name origin)
Builds a new Record from its textual representation |
static Record |
fromWire(byte[] b,
int section)
Builds a Record from DNS uncompressed wire format. |
Name |
getAdditionalName()
Returns the name for which additional data processing should be done for this record. |
int |
getDClass()
Returns the record's class |
Name |
getName()
Returns the record's name |
int |
getRRsetType()
Returns the type of RRset that this record would belong to. |
long |
getTTL()
Returns the record's TTL |
int |
getType()
Returns the record's type |
int |
hashCode()
Generates a hash code based on the Record's data. |
static Record |
newRecord(Name name,
int type,
int dclass)
Creates a new empty record, with the given parameters. |
static Record |
newRecord(Name name,
int type,
int dclass,
long ttl)
Creates a new empty record, with the given parameters. |
static Record |
newRecord(Name name,
int type,
int dclass,
long ttl,
byte[] data)
Creates a new record, with the given parameters. |
static Record |
newRecord(Name name,
int type,
int dclass,
long ttl,
int length,
byte[] data)
Creates a new record, with the given parameters. |
String |
rdataToString()
Converts the rdata portion of a Record into a String representation |
byte[] |
rdataToWireCanonical()
Converts the rdata in a Record into canonical DNS uncompressed wire format (all names are converted to lowercase). |
String |
toString()
Converts a Record into a String representation |
byte[] |
toWire(int section)
Converts a Record into DNS uncompressed wire format. |
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 |
withName(Name name)
Creates a new record identical to the current record, but with a different name. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Name name
protected int type
protected int dclass
protected long ttl
| Constructor Detail |
protected Record()
| Method Detail |
public static Record newRecord(Name name,
int type,
int dclass,
long ttl,
int length,
byte[] data)
name - The owner name of the record.type - The record's type.dclass - The record's class.ttl - The record's time to live.length - The length of the record's data.data - The rdata of the record, in uncompressed DNS wire format. Only
the first length bytes are used.
public static Record newRecord(Name name,
int type,
int dclass,
long ttl,
byte[] data)
name - The owner name of the record.type - The record's type.dclass - The record's class.ttl - The record's time to live.data - The complete rdata of the record, in uncompressed DNS wire
format.
public static Record newRecord(Name name,
int type,
int dclass,
long ttl)
name - The owner name of the record.type - The record's type.dclass - The record's class.ttl - The record's time to live.
public static Record newRecord(Name name,
int type,
int dclass)
name - The owner name of the record.type - The record's type.dclass - The record's class.
public static Record fromWire(byte[] b,
int section)
throws IOException
IOExceptionpublic byte[] toWire(int section)
public byte[] toWireCanonical()
public byte[] rdataToWireCanonical()
public String rdataToString()
public String toString()
protected static byte[] byteArrayFromString(String s)
throws TextParseException
TextParseException
protected static String byteArrayToString(byte[] array,
boolean quote)
protected static String unknownToString(byte[] data)
public static Record fromString(Name name,
int type,
int dclass,
long ttl,
Tokenizer st,
Name origin)
throws IOException
name - The owner name of the record.type - The record's type.dclass - The record's class.ttl - The record's time to live.st - A tokenizer containing the textual representation of the rdata.origin - The default origin to be appended to relative domain names.
IOException - The text format was invalid.
public static Record fromString(Name name,
int type,
int dclass,
long ttl,
String s,
Name origin)
throws IOException
name - The owner name of the record.type - The record's type.dclass - The record's class.ttl - The record's time to live.s - The textual representation of the rdata.origin - The default origin to be appended to relative domain names.
IOException - The text format was invalid.public Name getName()
Namepublic int getType()
Typepublic int getRRsetType()
Type,
RRset,
SIGRecordpublic int getDClass()
public long getTTL()
public boolean equals(Object arg)
arg - The record to compare to
public int hashCode()
public Record withName(Name name)
public int compareTo(Object o)
compareTo in interface Comparableo - The Object to be compared.
ClassCastException - if the argument is not a Record.public Name getAdditionalName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||