Top Description Fields Constructors Methods
io.netty.handler.codec.dns

public Class DatagramDnsQuery

extends DefaultDnsQuery
implements AddressedEnvelope<DatagramDnsQuery, InetSocketAddress>
Class Inheritance
All Implemented Interfaces
io.netty.channel.AddressedEnvelope, io.netty.util.ReferenceCounted
Annotations
@UnstableApi
Imports
io.netty.channel.AddressedEnvelope, io.netty.util.internal.UnstableApi, java.net.InetSocketAddress, .SocketAddress

A DnsQuery implementation for UDP/IP.

Field Summary

Modifier and TypeField and Description
private final InetSocketAddress
private final InetSocketAddress

Constructor Summary

AccessConstructor and Description
public
DatagramDnsQuery(InetSocketAddress
the address of the sender
sender
,
InetSocketAddress
the address of the recipient
recipient
,
int
the ID of the DNS query
id
)

Creates a new instance with the DnsOpCode#QUERY opCode.

public
DatagramDnsQuery(InetSocketAddress
the address of the sender
sender
,
InetSocketAddress
the address of the recipient
recipient
,
int
the ID of the DNS query
id
,
DnsOpCode
the opCode of the DNS query
opCode
)

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
public DatagramDnsQuery
addRecord(DnsSection section, DnsRecord record)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.addRecord.

Implements io.netty.handler.codec.dns.DnsQuery.addRecord, io.netty.handler.codec.dns.DnsMessage.addRecord.

Adds the specified record at the end of the specified section of this DNS message.
public DatagramDnsQuery
addRecord(DnsSection section, int index, DnsRecord record)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.addRecord.

Implements io.netty.handler.codec.dns.DnsQuery.addRecord, io.netty.handler.codec.dns.DnsMessage.addRecord.

Adds the specified record at the specified index of the specified section of this DNS message.
public DatagramDnsQuery
clear(DnsSection section)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.clear.

Implements io.netty.handler.codec.dns.DnsQuery.clear, io.netty.handler.codec.dns.DnsMessage.clear.

Removes all the records in the specified section of this DNS message.
public DatagramDnsQuery
public DatagramDnsQuery
content()

Implements io.netty.channel.AddressedEnvelope.content.

Returns the message wrapped by this envelope message.
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides io.netty.handler.codec.dns.AbstractDnsMessage.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides io.netty.handler.codec.dns.AbstractDnsMessage.hashCode.

Returns a hash code value for this object.
public InetSocketAddress
recipient()

Implements io.netty.channel.AddressedEnvelope.recipient.

Returns the address of the recipient of this message.
public DatagramDnsQuery
public DatagramDnsQuery
public InetSocketAddress
sender()

Implements io.netty.channel.AddressedEnvelope.sender.

Returns the address of the sender of this message.
public DatagramDnsQuery
public DatagramDnsQuery
public DatagramDnsQuery
setRecord(DnsSection section, DnsRecord record)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.setRecord.

Implements io.netty.handler.codec.dns.DnsQuery.setRecord, io.netty.handler.codec.dns.DnsMessage.setRecord.

Sets the specified section of this DNS message to the specified record, making it a single-record section.
public DatagramDnsQuery
public DatagramDnsQuery
setZ(int z)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.setZ.

Implements io.netty.handler.codec.dns.DnsQuery.setZ, io.netty.handler.codec.dns.DnsMessage.setZ.

Sets the Z (reserved for future use) field of this DNS message.
public DatagramDnsQuery
public DatagramDnsQuery
touch(Object hint)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.touch.

Implements io.netty.channel.AddressedEnvelope.touch, io.netty.handler.codec.dns.DnsQuery.touch, io.netty.handler.codec.dns.DnsMessage.touch, io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
Inherited from io.netty.handler.codec.dns.DefaultDnsQuery:
toString

Field Detail

recipientback to summary
private final InetSocketAddress recipient
senderback to summary
private final InetSocketAddress sender

Constructor Detail

DatagramDnsQueryback to summary
public DatagramDnsQuery(InetSocketAddress sender, InetSocketAddress recipient, int id)

Creates a new instance with the DnsOpCode#QUERY opCode.

Parameters
sender:InetSocketAddress

the address of the sender

recipient:InetSocketAddress

the address of the recipient

id:int

the ID of the DNS query

DatagramDnsQueryback to summary
public DatagramDnsQuery(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode)

Creates a new instance.

Parameters
sender:InetSocketAddress

the address of the sender

recipient:InetSocketAddress

the address of the recipient

id:int

the ID of the DNS query

opCode:DnsOpCode

the opCode of the DNS query

Method Detail

addRecordback to summary
public DatagramDnsQuery addRecord(DnsSection section, DnsRecord record)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.addRecord.

Implements io.netty.handler.codec.dns.DnsQuery.addRecord, io.netty.handler.codec.dns.DnsMessage.addRecord.

Doc from io.netty.handler.codec.dns.DnsMessage.addRecord.

Adds the specified record at the end of the specified section of this DNS message. When the specified section is DnsSection#QUESTION, the specified record must be a DnsQuestion.

Annotations
@Override
addRecordback to summary
public DatagramDnsQuery addRecord(DnsSection section, int index, DnsRecord record)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.addRecord.

Implements io.netty.handler.codec.dns.DnsQuery.addRecord, io.netty.handler.codec.dns.DnsMessage.addRecord.

Doc from io.netty.handler.codec.dns.DnsMessage.addRecord.

Adds the specified record at the specified index of the specified section of this DNS message. When the specified section is DnsSection#QUESTION, the specified record must be a DnsQuestion.

Annotations
@Override
clearback to summary
public DatagramDnsQuery clear(DnsSection section)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.clear.

Implements io.netty.handler.codec.dns.DnsQuery.clear, io.netty.handler.codec.dns.DnsMessage.clear.

Doc from io.netty.handler.codec.dns.DnsMessage.clear.

Removes all the records in the specified section of this DNS message.

Annotations
@Override
clearback to summary
public DatagramDnsQuery clear()

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.clear.

Implements io.netty.handler.codec.dns.DnsQuery.clear, io.netty.handler.codec.dns.DnsMessage.clear.

Doc from io.netty.handler.codec.dns.DnsMessage.clear.

Removes all the records in this DNS message.

Annotations
@Override
contentback to summary
public DatagramDnsQuery content()

Implements io.netty.channel.AddressedEnvelope.content.

Doc from io.netty.channel.AddressedEnvelope.content.

Returns the message wrapped by this envelope message.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides io.netty.handler.codec.dns.AbstractDnsMessage.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides io.netty.handler.codec.dns.AbstractDnsMessage.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
recipientback to summary
public InetSocketAddress recipient()

Implements io.netty.channel.AddressedEnvelope.recipient.

Doc from io.netty.channel.AddressedEnvelope.recipient.

Returns the address of the recipient of this message.

Annotations
@Override
retainback to summary
public DatagramDnsQuery retain()

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.retain.

Implements io.netty.channel.AddressedEnvelope.retain, io.netty.handler.codec.dns.DnsQuery.retain, io.netty.handler.codec.dns.DnsMessage.retain, io.netty.util.ReferenceCounted.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.

Annotations
@Override
retainback to summary
public DatagramDnsQuery retain(int increment)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.retain.

Implements io.netty.channel.AddressedEnvelope.retain, io.netty.handler.codec.dns.DnsQuery.retain, io.netty.handler.codec.dns.DnsMessage.retain, io.netty.util.ReferenceCounted.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@Override
senderback to summary
public InetSocketAddress sender()

Implements io.netty.channel.AddressedEnvelope.sender.

Doc from io.netty.channel.AddressedEnvelope.sender.

Returns the address of the sender of this message.

Annotations
@Override
setIdback to summary
public DatagramDnsQuery setId(int id)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.setId.

Implements io.netty.handler.codec.dns.DnsQuery.setId, io.netty.handler.codec.dns.DnsMessage.setId.

Doc from io.netty.handler.codec.dns.DnsMessage.setId.

Sets the ID of this DNS message.

Annotations
@Override
setOpCodeback to summary
public DatagramDnsQuery setOpCode(DnsOpCode opCode)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.setOpCode.

Implements io.netty.handler.codec.dns.DnsQuery.setOpCode, io.netty.handler.codec.dns.DnsMessage.setOpCode.

Doc from io.netty.handler.codec.dns.DnsMessage.setOpCode.

Sets the opCode of this DNS message.

Annotations
@Override
setRecordback to summary
public DatagramDnsQuery setRecord(DnsSection section, DnsRecord record)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.setRecord.

Implements io.netty.handler.codec.dns.DnsQuery.setRecord, io.netty.handler.codec.dns.DnsMessage.setRecord.

Doc from io.netty.handler.codec.dns.DnsMessage.setRecord.

Sets the specified section of this DNS message to the specified record, making it a single-record section. When the specified section is DnsSection#QUESTION, the specified record must be a DnsQuestion.

Annotations
@Override
setRecursionDesiredback to summary
public DatagramDnsQuery setRecursionDesired(boolean recursionDesired)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.setRecursionDesired.

Implements io.netty.handler.codec.dns.DnsQuery.setRecursionDesired, io.netty.handler.codec.dns.DnsMessage.setRecursionDesired.

Doc from io.netty.handler.codec.dns.DnsMessage.setRecursionDesired.

Sets the RD (recursion desired} field of this DNS message.

Annotations
@Override
setZback to summary
public DatagramDnsQuery setZ(int z)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.setZ.

Implements io.netty.handler.codec.dns.DnsQuery.setZ, io.netty.handler.codec.dns.DnsMessage.setZ.

Doc from io.netty.handler.codec.dns.DnsMessage.setZ.

Sets the Z (reserved for future use) field of this DNS message.

Annotations
@Override
touchback to summary
public DatagramDnsQuery touch()

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.touch.

Implements io.netty.channel.AddressedEnvelope.touch, io.netty.handler.codec.dns.DnsQuery.touch, io.netty.handler.codec.dns.DnsMessage.touch, io.netty.util.ReferenceCounted.touch.

Doc from io.netty.util.ReferenceCounted.touch.

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 via ResourceLeakDetector. This method is a shortcut to touch(null).

Annotations
@Override
touchback to summary
public DatagramDnsQuery touch(Object hint)

Overrides io.netty.handler.codec.dns.DefaultDnsQuery.touch.

Implements io.netty.channel.AddressedEnvelope.touch, io.netty.handler.codec.dns.DnsQuery.touch, io.netty.handler.codec.dns.DnsMessage.touch, io.netty.util.ReferenceCounted.touch.

Doc from io.netty.util.ReferenceCounted.touch.

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 via ResourceLeakDetector.

Annotations
@Override