Package io.netty.handler.codec.dns
Class DefaultDnsQuery
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.codec.dns.AbstractDnsMessage
-
- io.netty.handler.codec.dns.DefaultDnsQuery
-
- All Implemented Interfaces:
DnsMessage,DnsQuery,ReferenceCounted
- Direct Known Subclasses:
DatagramDnsQuery
public class DefaultDnsQuery extends AbstractDnsMessage implements DnsQuery
The defaultDnsQueryimplementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultDnsQuery(int id)Creates a new instance with theDnsOpCode.QUERYopCode.DefaultDnsQuery(int id, DnsOpCode opCode)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DnsQueryaddRecord(DnsSection section, int index, DnsRecord record)Adds the specifiedrecordat the specifiedindexof the specifiedsectionof this DNS message.DnsQueryaddRecord(DnsSection section, DnsRecord record)Adds the specifiedrecordat the end of the specifiedsectionof this DNS message.DnsQueryclear()Removes all the records in this DNS message.DnsQueryclear(DnsSection section)Removes all the records in the specifiedsectionof this DNS message.DnsQueryretain()Increases the reference count by1.DnsQueryretain(int increment)Increases the reference count by the specifiedincrement.DnsQuerysetId(int id)Sets theIDof this DNS message.DnsQuerysetOpCode(DnsOpCode opCode)Sets theopCodeof this DNS message.DnsQuerysetRecord(DnsSection section, DnsRecord record)Sets the specifiedsectionof this DNS message to the specifiedrecord, making it a single-record section.DnsQuerysetRecursionDesired(boolean recursionDesired)Sets theRD(recursion desired} field of this DNS message.DnsQuerysetZ(int z)Sets theZ(reserved for future use) field of this DNS message.java.lang.StringtoString()DnsQuerytouch()Records the current access location of this object for debugging purposes.DnsQuerytouch(java.lang.Object hint)Records the current access location of this object with an additional arbitrary information for debugging purposes.-
Methods inherited from class io.netty.handler.codec.dns.AbstractDnsMessage
count, count, deallocate, equals, hashCode, id, isRecursionDesired, opCode, recordAt, recordAt, removeRecord, setRecord, z
-
Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, release, release, setRefCnt
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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
-
-
-
-
Constructor Detail
-
DefaultDnsQuery
public DefaultDnsQuery(int id)
Creates a new instance with theDnsOpCode.QUERYopCode.- Parameters:
id- theIDof the DNS query
-
DefaultDnsQuery
public DefaultDnsQuery(int id, DnsOpCode opCode)Creates a new instance.- Parameters:
id- theIDof the DNS queryopCode- theopCodeof the DNS query
-
-
Method Detail
-
setId
public DnsQuery setId(int id)
Description copied from interface:DnsMessageSets theIDof this DNS message.- Specified by:
setIdin interfaceDnsMessage- Specified by:
setIdin interfaceDnsQuery- Overrides:
setIdin classAbstractDnsMessage
-
setOpCode
public DnsQuery setOpCode(DnsOpCode opCode)
Description copied from interface:DnsMessageSets theopCodeof this DNS message.- Specified by:
setOpCodein interfaceDnsMessage- Specified by:
setOpCodein interfaceDnsQuery- Overrides:
setOpCodein classAbstractDnsMessage
-
setRecursionDesired
public DnsQuery setRecursionDesired(boolean recursionDesired)
Description copied from interface:DnsMessageSets theRD(recursion desired} field of this DNS message.- Specified by:
setRecursionDesiredin interfaceDnsMessage- Specified by:
setRecursionDesiredin interfaceDnsQuery- Overrides:
setRecursionDesiredin classAbstractDnsMessage
-
setZ
public DnsQuery setZ(int z)
Description copied from interface:DnsMessageSets theZ(reserved for future use) field of this DNS message.- Specified by:
setZin interfaceDnsMessage- Specified by:
setZin interfaceDnsQuery- Overrides:
setZin classAbstractDnsMessage
-
setRecord
public DnsQuery 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- Specified by:
setRecordin interfaceDnsQuery- Overrides:
setRecordin classAbstractDnsMessage
-
addRecord
public DnsQuery 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- Specified by:
addRecordin interfaceDnsQuery- Overrides:
addRecordin classAbstractDnsMessage
-
addRecord
public DnsQuery 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- Specified by:
addRecordin interfaceDnsQuery- Overrides:
addRecordin classAbstractDnsMessage
-
clear
public DnsQuery clear(DnsSection section)
Description copied from interface:DnsMessageRemoves all the records in the specifiedsectionof this DNS message.- Specified by:
clearin interfaceDnsMessage- Specified by:
clearin interfaceDnsQuery- Overrides:
clearin classAbstractDnsMessage
-
clear
public DnsQuery clear()
Description copied from interface:DnsMessageRemoves all the records in this DNS message.- Specified by:
clearin interfaceDnsMessage- Specified by:
clearin interfaceDnsQuery- Overrides:
clearin classAbstractDnsMessage
-
touch
public DnsQuery 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 interfaceDnsQuery- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractDnsMessage
-
touch
public DnsQuery 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 interfaceDnsQuery- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classAbstractDnsMessage
-
retain
public DnsQuery retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceDnsQuery- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractDnsMessage
-
retain
public DnsQuery retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceDnsQuery- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classAbstractDnsMessage
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-