public abstract class DNSMessage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.List<DNSRecord> |
_additionals |
protected java.util.List<DNSRecord> |
_answers |
protected java.util.List<DNSRecord> |
_authoritativeAnswers |
protected java.util.List<DNSQuestion> |
_questions |
static boolean |
MULTICAST |
static boolean |
UNICAST |
Modifier | Constructor and Description |
---|---|
protected |
DNSMessage(int flags,
int id,
boolean multicast) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<? extends DNSRecord> |
getAdditionals() |
java.util.Collection<? extends DNSRecord> |
getAllAnswers() |
java.util.Collection<? extends DNSRecord> |
getAnswers() |
java.util.Collection<? extends DNSRecord> |
getAuthorities() |
int |
getFlags() |
int |
getId() |
int |
getNumberOfAdditionals() |
int |
getNumberOfAnswers() |
int |
getNumberOfAuthorities() |
int |
getNumberOfQuestions() |
int |
getOperationCode()
Returns the operation code value.
|
java.util.Collection<? extends DNSQuestion> |
getQuestions() |
boolean |
isAuthoritativeAnswer()
Check if the message is an authoritative answer.
|
boolean |
isEmpty()
Check if the message is empty
|
boolean |
isMulticast() |
boolean |
isQuery()
Check if the message is a query.
|
boolean |
isResponse()
Check if the message is a response.
|
boolean |
isTruncated()
Check if the message is truncated.
|
boolean |
isValidResponseCode()
Check is the response code is valid
The only valid value is zero all other values signify an error and the message must be ignored. |
protected java.lang.String |
print(byte[] data)
Debugging.
|
void |
setFlags(int flags) |
void |
setId(int id) |
public static final boolean MULTICAST
public static final boolean UNICAST
protected final java.util.List<DNSQuestion> _questions
protected final java.util.List<DNSRecord> _answers
protected final java.util.List<DNSRecord> _authoritativeAnswers
protected final java.util.List<DNSRecord> _additionals
protected DNSMessage(int flags, int id, boolean multicast)
flags
- id
- multicast
- public int getId()
public void setId(int id)
id
- the id to setpublic int getFlags()
public void setFlags(int flags)
flags
- the flags to setpublic boolean isMulticast()
public java.util.Collection<? extends DNSQuestion> getQuestions()
public int getNumberOfQuestions()
public java.util.Collection<? extends DNSRecord> getAllAnswers()
public java.util.Collection<? extends DNSRecord> getAnswers()
public int getNumberOfAnswers()
public java.util.Collection<? extends DNSRecord> getAuthorities()
public int getNumberOfAuthorities()
public java.util.Collection<? extends DNSRecord> getAdditionals()
public int getNumberOfAdditionals()
public boolean isValidResponseCode()
public int getOperationCode()
public boolean isTruncated()
public boolean isAuthoritativeAnswer()
public boolean isQuery()
public boolean isResponse()
public boolean isEmpty()
protected java.lang.String print(byte[] data)
data
-