public class Record extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Record.CLASS
The symbolic class of a DNS record (usually IN for Internet).
|
static class |
Record.TYPE
The record type.
|
Modifier and Type | Field and Description |
---|---|
protected Record.CLASS |
clazz
The record class (usually CLASS.IN).
|
protected String |
name
The generic name of this record.
|
protected Data |
payloadData
The payload object of this record.
|
protected long |
ttl
The ttl of this record.
|
protected Record.TYPE |
type
The type (and payload type) of this record.
|
protected boolean |
unicastQuery
MDNS defines the highest bit of the class as the unicast query bit.
|
Constructor and Description |
---|
Record() |
Modifier and Type | Method and Description |
---|---|
String |
getName()
The generic record name, e.g.
|
Data |
getPayload()
The payload data, usually a subclass of data (A, AAAA, CNAME, ...).
|
long |
getTtl()
Retrieve the record ttl.
|
boolean |
isAnswer(Question q)
Check if this record answers a given query.
|
boolean |
isUnicastQuery()
See if this query/response was a unicast query (highest class bit set).
|
void |
parse(DataInputStream dis,
byte[] data)
Parse a given record based on the full message data and the current
stream position.
|
String |
toString()
Retrieve a textual representation of this resource record.
|
protected String name
protected Record.TYPE type
protected Record.CLASS clazz
protected long ttl
protected Data payloadData
protected boolean unicastQuery
public void parse(DataInputStream dis, byte[] data) throws IOException
dis
- The DataInputStream positioned at the first record byte.data
- The full message data.IOException
- In case of malformed replies.public String toString()
public boolean isAnswer(Question q)
q
- The query.public boolean isUnicastQuery()
public String getName()
public Data getPayload()
public long getTtl()
Copyright © 2014–2018. All rights reserved.