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:
io.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>,DnsMessage,DnsQuery,io.netty.util.ReferenceCounted
public class DatagramDnsQuery extends DefaultDnsQuery implements io.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>
ADnsQueryimplementation for UDP/IP.
-
-
Constructor Summary
Constructors Constructor Description DatagramDnsQuery(InetSocketAddress sender, InetSocketAddress recipient, int id)Creates a new instance with theDnsOpCode.QUERYopCode.DatagramDnsQuery(InetSocketAddress sender, 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()booleanequals(Object obj)inthashCode()InetSocketAddressrecipient()DatagramDnsQueryretain()DatagramDnsQueryretain(int increment)InetSocketAddresssender()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()DatagramDnsQuerytouch(Object hint)-
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
-
-
-
-
Constructor Detail
-
DatagramDnsQuery
public DatagramDnsQuery(InetSocketAddress sender, 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(InetSocketAddress sender, 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()
- Specified by:
contentin interfaceio.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>
-
sender
public InetSocketAddress sender()
- Specified by:
senderin interfaceio.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>
-
recipient
public InetSocketAddress recipient()
- Specified by:
recipientin interfaceio.netty.channel.AddressedEnvelope<DatagramDnsQuery,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()
- Specified by:
touchin interfaceio.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceDnsQuery- Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Overrides:
touchin classDefaultDnsQuery
-
touch
public DatagramDnsQuery touch(Object hint)
- Specified by:
touchin interfaceio.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>- Specified by:
touchin interfaceDnsMessage- Specified by:
touchin interfaceDnsQuery- Specified by:
touchin interfaceio.netty.util.ReferenceCounted- Overrides:
touchin classDefaultDnsQuery
-
retain
public DatagramDnsQuery retain()
- Specified by:
retainin interfaceio.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceDnsQuery- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classDefaultDnsQuery
-
retain
public DatagramDnsQuery retain(int increment)
- Specified by:
retainin interfaceio.netty.channel.AddressedEnvelope<DatagramDnsQuery,InetSocketAddress>- Specified by:
retainin interfaceDnsMessage- Specified by:
retainin interfaceDnsQuery- Specified by:
retainin interfaceio.netty.util.ReferenceCounted- Overrides:
retainin classDefaultDnsQuery
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractDnsMessage
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDnsMessage
-
-