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,
,InetSocketAddress> DnsMessage
,DnsQuery
,ReferenceCounted
public class DatagramDnsQuery
extends DefaultDnsQuery
implements AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>
A
DnsQuery
implementation for UDP/IP.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDatagramDnsQuery
(InetSocketAddress sender, InetSocketAddress recipient, int id) Creates a new instance with theDnsOpCode.QUERY
opCode
.DatagramDnsQuery
(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionaddRecord
(DnsSection section, int index, DnsRecord record) Adds the specifiedrecord
at the specifiedindex
of the specifiedsection
of this DNS message.addRecord
(DnsSection section, DnsRecord record) Adds the specifiedrecord
at the end of the specifiedsection
of this DNS message.clear()
Removes all the records in this DNS message.clear
(DnsSection section) Removes all the records in the specifiedsection
of this DNS message.content()
Returns the message wrapped by this envelope message.boolean
int
hashCode()
Returns the address of the recipient of this message.retain()
Increases the reference count by1
.retain
(int increment) Increases the reference count by the specifiedincrement
.sender()
Returns the address of the sender of this message.setId
(int id) Sets theID
of this DNS message.Sets theopCode
of this DNS message.setRecord
(DnsSection section, DnsRecord record) Sets the specifiedsection
of this DNS message to the specifiedrecord
, making it a single-record section.setRecursionDesired
(boolean recursionDesired) Sets theRD
(recursion desired} field of this DNS message.setZ
(int z) Sets theZ
(reserved for future use) field of this DNS message.touch()
Records the current access location of this object for debugging purposes.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
-
Field Details
-
sender
-
recipient
-
-
Constructor Details
-
DatagramDnsQuery
Creates a new instance with theDnsOpCode.QUERY
opCode
.- Parameters:
sender
- the address of the senderrecipient
- the address of the recipientid
- theID
of the DNS query
-
DatagramDnsQuery
public DatagramDnsQuery(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode) Creates a new instance.- Parameters:
sender
- the address of the senderrecipient
- the address of the recipientid
- theID
of the DNS queryopCode
- theopCode
of the DNS query
-
-
Method Details
-
content
Description copied from interface:AddressedEnvelope
Returns the message wrapped by this envelope message.- Specified by:
content
in interfaceAddressedEnvelope<DatagramDnsQuery,
InetSocketAddress>
-
sender
Description copied from interface:AddressedEnvelope
Returns the address of the sender of this message.- Specified by:
sender
in interfaceAddressedEnvelope<DatagramDnsQuery,
InetSocketAddress>
-
recipient
Description copied from interface:AddressedEnvelope
Returns the address of the recipient of this message.- Specified by:
recipient
in interfaceAddressedEnvelope<DatagramDnsQuery,
InetSocketAddress>
-
setId
Description copied from interface:DnsMessage
Sets theID
of this DNS message.- Specified by:
setId
in interfaceDnsMessage
- Specified by:
setId
in interfaceDnsQuery
- Overrides:
setId
in classDefaultDnsQuery
-
setOpCode
Description copied from interface:DnsMessage
Sets theopCode
of this DNS message.- Specified by:
setOpCode
in interfaceDnsMessage
- Specified by:
setOpCode
in interfaceDnsQuery
- Overrides:
setOpCode
in classDefaultDnsQuery
-
setRecursionDesired
Description copied from interface:DnsMessage
Sets theRD
(recursion desired} field of this DNS message.- Specified by:
setRecursionDesired
in interfaceDnsMessage
- Specified by:
setRecursionDesired
in interfaceDnsQuery
- Overrides:
setRecursionDesired
in classDefaultDnsQuery
-
setZ
Description copied from interface:DnsMessage
Sets theZ
(reserved for future use) field of this DNS message.- Specified by:
setZ
in interfaceDnsMessage
- Specified by:
setZ
in interfaceDnsQuery
- Overrides:
setZ
in classDefaultDnsQuery
-
setRecord
Description copied from interface:DnsMessage
Sets the specifiedsection
of this DNS message to the specifiedrecord
, making it a single-record section. When the specifiedsection
isDnsSection.QUESTION
, the specifiedrecord
must be aDnsQuestion
.- Specified by:
setRecord
in interfaceDnsMessage
- Specified by:
setRecord
in interfaceDnsQuery
- Overrides:
setRecord
in classDefaultDnsQuery
-
addRecord
Description copied from interface:DnsMessage
Adds the specifiedrecord
at the end of the specifiedsection
of this DNS message. When the specifiedsection
isDnsSection.QUESTION
, the specifiedrecord
must be aDnsQuestion
.- Specified by:
addRecord
in interfaceDnsMessage
- Specified by:
addRecord
in interfaceDnsQuery
- Overrides:
addRecord
in classDefaultDnsQuery
-
addRecord
Description copied from interface:DnsMessage
Adds the specifiedrecord
at the specifiedindex
of the specifiedsection
of this DNS message. When the specifiedsection
isDnsSection.QUESTION
, the specifiedrecord
must be aDnsQuestion
.- Specified by:
addRecord
in interfaceDnsMessage
- Specified by:
addRecord
in interfaceDnsQuery
- Overrides:
addRecord
in classDefaultDnsQuery
-
clear
Description copied from interface:DnsMessage
Removes all the records in the specifiedsection
of this DNS message.- Specified by:
clear
in interfaceDnsMessage
- Specified by:
clear
in interfaceDnsQuery
- Overrides:
clear
in classDefaultDnsQuery
-
clear
Description copied from interface:DnsMessage
Removes all the records in this DNS message.- Specified by:
clear
in interfaceDnsMessage
- Specified by:
clear
in interfaceDnsQuery
- Overrides:
clear
in classDefaultDnsQuery
-
touch
Description copied from interface:ReferenceCounted
Records 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:
touch
in interfaceAddressedEnvelope<DatagramDnsQuery,
InetSocketAddress> - Specified by:
touch
in interfaceDnsMessage
- Specified by:
touch
in interfaceDnsQuery
- Specified by:
touch
in interfaceReferenceCounted
- Overrides:
touch
in classDefaultDnsQuery
-
touch
Description copied from interface:ReferenceCounted
Records 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:
touch
in interfaceAddressedEnvelope<DatagramDnsQuery,
InetSocketAddress> - Specified by:
touch
in interfaceDnsMessage
- Specified by:
touch
in interfaceDnsQuery
- Specified by:
touch
in interfaceReferenceCounted
- Overrides:
touch
in classDefaultDnsQuery
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by1
.- Specified by:
retain
in interfaceAddressedEnvelope<DatagramDnsQuery,
InetSocketAddress> - Specified by:
retain
in interfaceDnsMessage
- Specified by:
retain
in interfaceDnsQuery
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classDefaultDnsQuery
-
retain
Description copied from interface:ReferenceCounted
Increases the reference count by the specifiedincrement
.- Specified by:
retain
in interfaceAddressedEnvelope<DatagramDnsQuery,
InetSocketAddress> - Specified by:
retain
in interfaceDnsMessage
- Specified by:
retain
in interfaceDnsQuery
- Specified by:
retain
in interfaceReferenceCounted
- Overrides:
retain
in classDefaultDnsQuery
-
equals
- Overrides:
equals
in classAbstractDnsMessage
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractDnsMessage
-