Package io.netty.handler.codec.dns
Interface DnsResponse
-
- All Superinterfaces:
DnsMessage,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()Increases the reference count by1.DnsResponseretain(int increment)Increases the reference count by the specifiedincrement.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()Records the current access location of this object for debugging purposes.DnsResponsetouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from interface io.netty.handler.codec.dns.DnsMessage
count, count, id, isRecursionDesired, opCode, recordAt, recordAt, removeRecord, setRecord, z
-
Methods inherited from interface io.netty.util.ReferenceCounted
refCnt, release, release
-
-
-
-
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()
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceReferenceCounted
-
touch
DnsResponse touch(java.lang.Object hint)
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceReferenceCounted
-
retain
DnsResponse retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceReferenceCounted
-
retain
DnsResponse retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceReferenceCounted
-
-