Package io.netty.handler.codec.dns
Class DatagramDnsQuery
- java.lang.Object
-
- io.netty.util.AbstractReferenceCounted
-
- io.netty.handler.codec.dns.AbstractDnsMessage
-
- io.netty.handler.codec.dns.DefaultDnsQuery
-
- io.netty.handler.codec.dns.DatagramDnsQuery
-
- All Implemented Interfaces:
AddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>,DnsMessage,DnsQuery,ReferenceCounted
public class DatagramDnsQuery extends DefaultDnsQuery implements AddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>
ADnsQueryimplementation for UDP/IP.
-
-
Constructor Summary
Constructors Constructor Description DatagramDnsQuery(java.net.InetSocketAddress sender, java.net.InetSocketAddress recipient, int id)Creates a new instance with theDnsOpCode.QUERYopCode.DatagramDnsQuery(java.net.InetSocketAddress sender, java.net.InetSocketAddress recipient, int id, DnsOpCode opCode)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatagramDnsQueryaddRecord(DnsSection section, int index, DnsRecord record)Adds the specifiedrecordat the specifiedindexof the specifiedsectionof this DNS message.DatagramDnsQueryaddRecord(DnsSection section, DnsRecord record)Adds the specifiedrecordat the end of the specifiedsectionof this DNS message.DatagramDnsQueryclear()Removes all the records in this DNS message.DatagramDnsQueryclear(DnsSection section)Removes all the records in the specifiedsectionof this DNS message.DatagramDnsQuerycontent()Returns the message wrapped by this envelope message.booleanequals(java.lang.Object obj)inthashCode()java.net.InetSocketAddressrecipient()Returns the address of the recipient of this message.DatagramDnsQueryretain()Increases the reference count by1.DatagramDnsQueryretain(int increment)Increases the reference count by the specifiedincrement.java.net.InetSocketAddresssender()Returns the address of the sender of this message.DatagramDnsQuerysetId(int id)Sets theIDof this DNS message.DatagramDnsQuerysetOpCode(DnsOpCode opCode)Sets theopCodeof this DNS message.DatagramDnsQuerysetRecord(DnsSection section, DnsRecord record)Sets the specifiedsectionof this DNS message to the specifiedrecord, making it a single-record section.DatagramDnsQuerysetRecursionDesired(boolean recursionDesired)Sets theRD(recursion desired} field of this DNS message.DatagramDnsQuerysetZ(int z)Sets theZ(reserved for future use) field of this DNS message.DatagramDnsQuerytouch()Records the current access location of this object for debugging purposes.DatagramDnsQuerytouch(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.DefaultDnsQuery
toString
-
Methods inherited from class io.netty.handler.codec.dns.AbstractDnsMessage
count, count, deallocate, 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
-
DatagramDnsQuery
public DatagramDnsQuery(java.net.InetSocketAddress sender, java.net.InetSocketAddress recipient, int id)Creates a new instance with theDnsOpCode.QUERYopCode.- Parameters:
sender- the address of the senderrecipient- the address of the recipientid- theIDof the DNS query
-
DatagramDnsQuery
public DatagramDnsQuery(java.net.InetSocketAddress sender, java.net.InetSocketAddress recipient, int id, DnsOpCode opCode)Creates a new instance.- Parameters:
sender- the address of the senderrecipient- the address of the recipientid- theIDof the DNS queryopCode- theopCodeof the DNS query
-
-
Method Detail
-
content
public DatagramDnsQuery content()
Description copied from interface:AddressedEnvelopeReturns the message wrapped by this envelope message.- Specified by:
contentin interfaceAddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>
-
sender
public java.net.InetSocketAddress sender()
Description copied from interface:AddressedEnvelopeReturns the address of the sender of this message.- Specified by:
senderin interfaceAddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>
-
recipient
public java.net.InetSocketAddress recipient()
Description copied from interface:AddressedEnvelopeReturns the address of the recipient of this message.- Specified by:
recipientin interfaceAddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>
-
setId
public DatagramDnsQuery setId(int id)
Description copied from interface:DnsMessageSets theIDof this DNS message.- Specified by:
setIdin interfaceDnsMessage- Specified by:
setIdin interfaceDnsQuery- Overrides:
setIdin classDefaultDnsQuery
-
setOpCode
public DatagramDnsQuery setOpCode(DnsOpCode opCode)
Description copied from interface:DnsMessageSets theopCodeof this DNS message.- Specified by:
setOpCodein interfaceDnsMessage- Specified by:
setOpCodein interfaceDnsQuery- Overrides:
setOpCodein classDefaultDnsQuery
-
setRecursionDesired
public DatagramDnsQuery 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 classDefaultDnsQuery
-
setZ
public DatagramDnsQuery 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 classDefaultDnsQuery
-
setRecord
public DatagramDnsQuery 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 classDefaultDnsQuery
-
addRecord
public DatagramDnsQuery 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 classDefaultDnsQuery
-
addRecord
public DatagramDnsQuery 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 classDefaultDnsQuery
-
clear
public DatagramDnsQuery 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 classDefaultDnsQuery
-
clear
public DatagramDnsQuery clear()
Description copied from interface:DnsMessageRemoves all the records in this DNS message.- Specified by:
clearin interfaceDnsMessage- Specified by:
clearin interfaceDnsQuery- Overrides:
clearin classDefaultDnsQuery
-
touch
public DatagramDnsQuery 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 interfaceAddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceDnsQuery- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classDefaultDnsQuery
-
touch
public DatagramDnsQuery 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 interfaceAddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceDnsQuery- Specified by:
touchin interfaceReferenceCounted- Overrides:
touchin classDefaultDnsQuery
-
retain
public DatagramDnsQuery retain()
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceAddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceDnsQuery- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classDefaultDnsQuery
-
retain
public DatagramDnsQuery retain(int increment)
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceAddressedEnvelope<DatagramDnsQuery,java.net.InetSocketAddress>- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceDnsQuery- Specified by:
retainin interfaceReferenceCounted- Overrides:
retainin classDefaultDnsQuery
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractDnsMessage
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDnsMessage
-
-