Package io.netty.handler.codec.dns
Interface DnsResponse
-
- All Superinterfaces:
DnsMessage,io.netty.util.ReferenceCounted
- All Known Implementing Classes:
DatagramDnsResponse,DefaultDnsResponse
public interface DnsResponse extends DnsMessage
A DNS response message.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DnsResponseaddRecord(DnsSection section, int index, DnsRecord record)Adds the specifiedrecordat the specifiedindexof the specifiedsectionof this DNS message.DnsResponseaddRecord(DnsSection section, DnsRecord record)Adds the specifiedrecordat the end of the specifiedsectionof this DNS message.DnsResponseclear()Removes all the records in this DNS message.DnsResponseclear(DnsSection section)Removes all the records in the specifiedsectionof this DNS message.DnsResponseCodecode()Returns the 4 bit return code.booleanisAuthoritativeAnswer()Returnstrueif responding server is authoritative for the domain name in the query message.booleanisRecursionAvailable()Returnstrueif DNS server can handle recursive queries.booleanisTruncated()Returnstrueif response has been truncated, usually if it is over 512 bytes.DnsResponseretain()DnsResponseretain(int increment)DnsResponsesetAuthoritativeAnswer(boolean authoritativeAnswer)Set totrueif responding server is authoritative for the domain name in the query message.DnsResponsesetCode(DnsResponseCode code)Sets the response code for this message.DnsResponsesetId(int id)Sets theIDof this DNS message.DnsResponsesetOpCode(DnsOpCode opCode)Sets theopCodeof this DNS message.DnsResponsesetRecord(DnsSection section, DnsRecord record)Sets the specifiedsectionof this DNS message to the specifiedrecord, making it a single-record section.DnsResponsesetRecursionAvailable(boolean recursionAvailable)Set totrueif DNS server can handle recursive queries.DnsResponsesetRecursionDesired(boolean recursionDesired)Sets theRD(recursion desired} field of this DNS message.DnsResponsesetTruncated(boolean truncated)Set totrueif response has been truncated (usually happens for responses over 512 bytes).DnsResponsesetZ(int z)Sets theZ(reserved for future use) field of this DNS message.DnsResponsetouch()DnsResponsetouch(Object hint)-
Methods inherited from interface io.netty.handler.codec.dns.DnsMessage
count, count, id, isRecursionDesired, opCode, recordAt, recordAt, removeRecord, setRecord, z
-
-
-
-
Method Detail
-
isAuthoritativeAnswer
boolean isAuthoritativeAnswer()
Returnstrueif responding server is authoritative for the domain name in the query message.
-
setAuthoritativeAnswer
DnsResponse setAuthoritativeAnswer(boolean authoritativeAnswer)
Set totrueif responding server is authoritative for the domain name in the query message.- Parameters:
authoritativeAnswer- flag for authoritative answer
-
isTruncated
boolean isTruncated()
Returnstrueif response has been truncated, usually if it is over 512 bytes.
-
setTruncated
DnsResponse setTruncated(boolean truncated)
Set totrueif response has been truncated (usually happens for responses over 512 bytes).- Parameters:
truncated- flag for truncation
-
isRecursionAvailable
boolean isRecursionAvailable()
Returnstrueif DNS server can handle recursive queries.
-
setRecursionAvailable
DnsResponse setRecursionAvailable(boolean recursionAvailable)
Set totrueif DNS server can handle recursive queries.- Parameters:
recursionAvailable- flag for recursion availability
-
code
DnsResponseCode code()
Returns the 4 bit return code.
-
setCode
DnsResponse setCode(DnsResponseCode code)
Sets the response code for this message.- Parameters:
code- the response code
-
setId
DnsResponse setId(int id)
Description copied from interface:DnsMessageSets theIDof this DNS message.- Specified by:
setIdin interfaceDnsMessage
-
setOpCode
DnsResponse setOpCode(DnsOpCode opCode)
Description copied from interface:DnsMessageSets theopCodeof this DNS message.- Specified by:
setOpCodein interfaceDnsMessage
-
setRecursionDesired
DnsResponse setRecursionDesired(boolean recursionDesired)
Description copied from interface:DnsMessageSets theRD(recursion desired} field of this DNS message.- Specified by:
setRecursionDesiredin interfaceDnsMessage
-
setZ
DnsResponse setZ(int z)
Description copied from interface:DnsMessageSets theZ(reserved for future use) field of this DNS message.- Specified by:
setZin interfaceDnsMessage
-
setRecord
DnsResponse setRecord(DnsSection section, DnsRecord record)
Description copied from interface:DnsMessageSets the specifiedsectionof this DNS message to the specifiedrecord, making it a single-record section. When the specifiedsectionisDnsSection.QUESTION, the specifiedrecordmust be aDnsQuestion.- Specified by:
setRecordin interfaceDnsMessage
-
addRecord
DnsResponse addRecord(DnsSection section, DnsRecord record)
Description copied from interface:DnsMessageAdds the specifiedrecordat the end of the specifiedsectionof this DNS message. When the specifiedsectionisDnsSection.QUESTION, the specifiedrecordmust be aDnsQuestion.- Specified by:
addRecordin interfaceDnsMessage
-
addRecord
DnsResponse addRecord(DnsSection section, int index, DnsRecord record)
Description copied from interface:DnsMessageAdds the specifiedrecordat the specifiedindexof the specifiedsectionof this DNS message. When the specifiedsectionisDnsSection.QUESTION, the specifiedrecordmust be aDnsQuestion.- Specified by:
addRecordin interfaceDnsMessage
-
clear
DnsResponse clear(DnsSection section)
Description copied from interface:DnsMessageRemoves all the records in the specifiedsectionof this DNS message.- Specified by:
clearin interfaceDnsMessage
-
clear
DnsResponse clear()
Description copied from interface:DnsMessageRemoves all the records in this DNS message.- Specified by:
clearin interfaceDnsMessage
-
touch
DnsResponse touch()
- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
touch
DnsResponse touch(Object hint)
- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
retain
DnsResponse retain()
- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
retain
DnsResponse retain(int increment)
- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceio.netty.util.ReferenceCounted
-
-