public class DNSMessage extends Serializable
| Constructor and Description |
|---|
DNSMessage() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAdditional(DNSResourceRecord additional) |
void |
addAnswer(DNSResourceRecord answer) |
void |
addAuthority(DNSResourceRecord authority) |
void |
addQuery(DNSQuery query) |
int |
byteBufSize() |
void |
fromByteBuf(io.netty.buffer.ByteBuf buffer)
Fills this object with the data from the
ByteBuf. |
java.lang.Iterable<DNSResourceRecord> |
getAdditionals() |
java.lang.Iterable<DNSResourceRecord> |
getAnswers() |
java.lang.Iterable<DNSResourceRecord> |
getAuthorities() |
int |
getCountAdditionals() |
int |
getCountAnswers() |
int |
getCountAuthorities() |
int |
getCountQueries() |
int |
getId() |
byte |
getOpcode() |
java.lang.String |
getOpcodeAsString() |
java.lang.Iterable<DNSQuery> |
getQueries() |
byte |
getResponseCode() |
boolean |
isAuthoritativeResponse() |
boolean |
isQueryOrResponse() |
boolean |
isRecursionAvailable() |
boolean |
isRecursionDesired() |
boolean |
isTruncated() |
void |
setAuthoritativeResponse(boolean authoritativeResponse) |
void |
setId(int id) |
void |
setOpcode(byte opcode) |
void |
setQueryOrResponse(boolean queryOrResponse) |
void |
setRecursionAvailable(boolean recursionAvailable) |
void |
setRecursionDesired(boolean recursionDesired) |
void |
setResponseCode(byte responseCode) |
void |
setTruncated(boolean truncated) |
void |
toByteBuf(io.netty.buffer.ByteBuf buffer)
Writes the data of this object into the
ByteBuf. |
toByteBufpublic int getId()
public void setId(int id)
public boolean isQueryOrResponse()
public void setQueryOrResponse(boolean queryOrResponse)
public byte getOpcode()
public void setOpcode(byte opcode)
public java.lang.String getOpcodeAsString()
public boolean isAuthoritativeResponse()
public void setAuthoritativeResponse(boolean authoritativeResponse)
public boolean isTruncated()
public void setTruncated(boolean truncated)
public boolean isRecursionDesired()
public void setRecursionDesired(boolean recursionDesired)
public boolean isRecursionAvailable()
public void setRecursionAvailable(boolean recursionAvailable)
public byte getResponseCode()
public void setResponseCode(byte responseCode)
public void addQuery(DNSQuery query)
public void addAnswer(DNSResourceRecord answer)
public void addAuthority(DNSResourceRecord authority)
public void addAdditional(DNSResourceRecord additional)
public java.lang.Iterable<DNSQuery> getQueries()
public java.lang.Iterable<DNSResourceRecord> getAnswers()
public java.lang.Iterable<DNSResourceRecord> getAuthorities()
public java.lang.Iterable<DNSResourceRecord> getAdditionals()
public int getCountQueries()
public int getCountAnswers()
public int getCountAuthorities()
public int getCountAdditionals()
public int byteBufSize()
byteBufSize in class Serializablepublic void toByteBuf(io.netty.buffer.ByteBuf buffer)
SerializableByteBuf.toByteBuf in class Serializablebuffer - buffer to store the datapublic void fromByteBuf(io.netty.buffer.ByteBuf buffer)
throws DataNotRepresentsObject
SerializableByteBuf.
If the buffer contents doesn't match the object specification,
should throw IllegalArgumentException.fromByteBuf in class Serializablebuffer - buffer with the dataDataNotRepresentsObject - If the buffer data doesn't
represent the object