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

public Class DatagramDnsResponse

extends DefaultDnsResponse
implements AddressedEnvelope<DatagramDnsResponse, 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 DnsResponse implementation for UDP/IP.

Field Summary

Modifier and TypeField and Description
private final InetSocketAddress
private final InetSocketAddress

Constructor Summary

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

Creates a new instance with the DnsOpCode#QUERY opCode and the DnsResponseCode#NOERROR RCODE.

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

Creates a new instance with the DnsResponseCode#NOERROR responseCode.

public
DatagramDnsResponse(InetSocketAddress
the address of the sender
sender
,
InetSocketAddress
the address of the recipient
recipient
,
int
the ID of the DNS response
id
,
DnsOpCode
the opCode of the DNS response
opCode
,
DnsResponseCode
the RCODE of the DNS response
responseCode
)

Creates a new instance.

Method Summary

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

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

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

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

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse
clear(DnsSection section)

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

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

Removes all the records in the specified section of this DNS message.
public DatagramDnsResponse
public DatagramDnsResponse
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 the object.
public InetSocketAddress
recipient()

Implements io.netty.channel.AddressedEnvelope.recipient.

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

Implements io.netty.channel.AddressedEnvelope.sender.

Returns the address of the sender of this message.
public DatagramDnsResponse
setAuthoritativeAnswer(boolean
flag for authoritative answer
authoritativeAnswer
)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setAuthoritativeAnswer.

Implements io.netty.handler.codec.dns.DnsResponse.setAuthoritativeAnswer.

Set to true if responding server is authoritative for the domain name in the query message.
public DatagramDnsResponse
setCode(DnsResponseCode
the response code
code
)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setCode.

Implements io.netty.handler.codec.dns.DnsResponse.setCode.

Sets the response code for this message.
public DatagramDnsResponse
public DatagramDnsResponse
public DatagramDnsResponse
setRecord(DnsSection section, DnsRecord record)

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse
setRecursionAvailable(boolean
flag for recursion availability
recursionAvailable
)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setRecursionAvailable.

Implements io.netty.handler.codec.dns.DnsResponse.setRecursionAvailable.

Set to true if DNS server can handle recursive queries.
public DatagramDnsResponse
public DatagramDnsResponse
setTruncated(boolean
flag for truncation
truncated
)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setTruncated.

Implements io.netty.handler.codec.dns.DnsResponse.setTruncated.

Set to true if response has been truncated (usually happens for responses over 512 bytes).
public DatagramDnsResponse
setZ(int z)

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

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

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

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

Implements io.netty.channel.AddressedEnvelope.touch, io.netty.handler.codec.dns.DnsResponse.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.DefaultDnsResponse:
codeisAuthoritativeAnswerisRecursionAvailableisTruncatedtoString

Field Detail

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

Constructor Detail

DatagramDnsResponseback to summary
public DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id)

Creates a new instance with the DnsOpCode#QUERY opCode and the DnsResponseCode#NOERROR RCODE.

Parameters
sender:InetSocketAddress

the address of the sender

recipient:InetSocketAddress

the address of the recipient

id:int

the ID of the DNS response

DatagramDnsResponseback to summary
public DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode)

Creates a new instance with the DnsResponseCode#NOERROR responseCode.

Parameters
sender:InetSocketAddress

the address of the sender

recipient:InetSocketAddress

the address of the recipient

id:int

the ID of the DNS response

opCode:DnsOpCode

the opCode of the DNS response

DatagramDnsResponseback to summary
public DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode, DnsResponseCode responseCode)

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 response

opCode:DnsOpCode

the opCode of the DNS response

responseCode:DnsResponseCode

the RCODE of the DNS response

Method Detail

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

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse addRecord(DnsSection section, int index, DnsRecord record)

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse clear(DnsSection section)

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse clear()

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse 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 the 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 DatagramDnsResponse retain()

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

Implements io.netty.channel.AddressedEnvelope.retain, io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse retain(int increment)

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

Implements io.netty.channel.AddressedEnvelope.retain, io.netty.handler.codec.dns.DnsResponse.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
setAuthoritativeAnswerback to summary
public DatagramDnsResponse setAuthoritativeAnswer(boolean authoritativeAnswer)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setAuthoritativeAnswer.

Implements io.netty.handler.codec.dns.DnsResponse.setAuthoritativeAnswer.

Doc from io.netty.handler.codec.dns.DnsResponse.setAuthoritativeAnswer.

Set to true if responding server is authoritative for the domain name in the query message.

Parameters
authoritativeAnswer:boolean

flag for authoritative answer

Annotations
@Override
setCodeback to summary
public DatagramDnsResponse setCode(DnsResponseCode code)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setCode.

Implements io.netty.handler.codec.dns.DnsResponse.setCode.

Doc from io.netty.handler.codec.dns.DnsResponse.setCode.

Sets the response code for this message.

Parameters
code:DnsResponseCode

the response code

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

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse setOpCode(DnsOpCode opCode)

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse setRecord(DnsSection section, DnsRecord record)

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

Implements io.netty.handler.codec.dns.DnsResponse.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
setRecursionAvailableback to summary
public DatagramDnsResponse setRecursionAvailable(boolean recursionAvailable)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setRecursionAvailable.

Implements io.netty.handler.codec.dns.DnsResponse.setRecursionAvailable.

Doc from io.netty.handler.codec.dns.DnsResponse.setRecursionAvailable.

Set to true if DNS server can handle recursive queries.

Parameters
recursionAvailable:boolean

flag for recursion availability

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

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

Implements io.netty.handler.codec.dns.DnsResponse.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
setTruncatedback to summary
public DatagramDnsResponse setTruncated(boolean truncated)

Overrides io.netty.handler.codec.dns.DefaultDnsResponse.setTruncated.

Implements io.netty.handler.codec.dns.DnsResponse.setTruncated.

Doc from io.netty.handler.codec.dns.DnsResponse.setTruncated.

Set to true if response has been truncated (usually happens for responses over 512 bytes).

Parameters
truncated:boolean

flag for truncation

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

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

Implements io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse touch()

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

Implements io.netty.channel.AddressedEnvelope.touch, io.netty.handler.codec.dns.DnsResponse.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 DatagramDnsResponse touch(Object hint)

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

Implements io.netty.channel.AddressedEnvelope.touch, io.netty.handler.codec.dns.DnsResponse.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