@UnstableApi public class DatagramDnsResponse extends DefaultDnsResponse implements AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
DnsResponse
implementation for UDP/IP.Constructor and Description |
---|
DatagramDnsResponse(InetSocketAddress sender,
InetSocketAddress recipient,
int id)
|
DatagramDnsResponse(InetSocketAddress sender,
InetSocketAddress recipient,
int id,
DnsOpCode opCode)
Creates a new instance with the
DnsResponseCode.NOERROR responseCode. |
DatagramDnsResponse(InetSocketAddress sender,
InetSocketAddress recipient,
int id,
DnsOpCode opCode,
DnsResponseCode responseCode)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
DatagramDnsResponse |
addRecord(DnsSection section,
DnsRecord record)
Adds the specified
record at the end of the specified section of this DNS message. |
DatagramDnsResponse |
addRecord(DnsSection section,
int index,
DnsRecord record)
Adds the specified
record at the specified index of the specified section
of this DNS message. |
DatagramDnsResponse |
clear()
Removes all the records in this DNS message.
|
DatagramDnsResponse |
clear(DnsSection section)
Removes all the records in the specified
section of this DNS message. |
DatagramDnsResponse |
content()
Returns the message wrapped by this envelope message.
|
boolean |
equals(Object obj) |
int |
hashCode() |
InetSocketAddress |
recipient()
Returns the address of the recipient of this message.
|
DatagramDnsResponse |
retain()
Increases the reference count by
1 . |
DatagramDnsResponse |
retain(int increment)
Increases the reference count by the specified
increment . |
InetSocketAddress |
sender()
Returns the address of the sender of this message.
|
DatagramDnsResponse |
setAuthoritativeAnswer(boolean authoritativeAnswer)
Set to
true if responding server is authoritative for the domain
name in the query message. |
DatagramDnsResponse |
setCode(DnsResponseCode code)
Sets the response code for this message.
|
DatagramDnsResponse |
setId(int id)
Sets the
ID of this DNS message. |
DatagramDnsResponse |
setOpCode(DnsOpCode opCode)
Sets the
opCode of this DNS message. |
DatagramDnsResponse |
setRecord(DnsSection section,
DnsRecord record)
Sets the specified
section of this DNS message to the specified record ,
making it a single-record section. |
DatagramDnsResponse |
setRecursionAvailable(boolean recursionAvailable)
Set to
true if DNS server can handle recursive queries. |
DatagramDnsResponse |
setRecursionDesired(boolean recursionDesired)
Sets the
RD (recursion desired} field of this DNS message. |
DatagramDnsResponse |
setTruncated(boolean truncated)
Set to
true if response has been truncated (usually happens for
responses over 512 bytes). |
DatagramDnsResponse |
setZ(int z)
Sets the
Z (reserved for future use) field of this DNS message. |
DatagramDnsResponse |
touch()
Records the current access location of this object for debugging purposes.
|
DatagramDnsResponse |
touch(Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
code, isAuthoritativeAnswer, isRecursionAvailable, isTruncated, toString
count, count, deallocate, id, isRecursionDesired, opCode, recordAt, recordAt, removeRecord, setRecord, z
refCnt, release, release, setRefCnt
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
refCnt, release, release
count, count, id, isRecursionDesired, opCode, recordAt, recordAt, removeRecord, setRecord, z
public DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id)
sender
- the address of the senderrecipient
- the address of the recipientid
- the ID
of the DNS responsepublic DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode)
DnsResponseCode.NOERROR
responseCode.sender
- the address of the senderrecipient
- the address of the recipientid
- the ID
of the DNS responseopCode
- the opCode
of the DNS responsepublic DatagramDnsResponse(InetSocketAddress sender, InetSocketAddress recipient, int id, DnsOpCode opCode, DnsResponseCode responseCode)
sender
- the address of the senderrecipient
- the address of the recipientid
- the ID
of the DNS responseopCode
- the opCode
of the DNS responseresponseCode
- the RCODE
of the DNS responsepublic DatagramDnsResponse content()
AddressedEnvelope
content
in interface AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
public InetSocketAddress sender()
AddressedEnvelope
sender
in interface AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
public InetSocketAddress recipient()
AddressedEnvelope
recipient
in interface AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
public DatagramDnsResponse setAuthoritativeAnswer(boolean authoritativeAnswer)
DnsResponse
true
if responding server is authoritative for the domain
name in the query message.setAuthoritativeAnswer
in interface DnsResponse
setAuthoritativeAnswer
in class DefaultDnsResponse
authoritativeAnswer
- flag for authoritative answerpublic DatagramDnsResponse setTruncated(boolean truncated)
DnsResponse
true
if response has been truncated (usually happens for
responses over 512 bytes).setTruncated
in interface DnsResponse
setTruncated
in class DefaultDnsResponse
truncated
- flag for truncationpublic DatagramDnsResponse setRecursionAvailable(boolean recursionAvailable)
DnsResponse
true
if DNS server can handle recursive queries.setRecursionAvailable
in interface DnsResponse
setRecursionAvailable
in class DefaultDnsResponse
recursionAvailable
- flag for recursion availabilitypublic DatagramDnsResponse setCode(DnsResponseCode code)
DnsResponse
setCode
in interface DnsResponse
setCode
in class DefaultDnsResponse
code
- the response codepublic DatagramDnsResponse setId(int id)
DnsMessage
ID
of this DNS message.setId
in interface DnsMessage
setId
in interface DnsResponse
setId
in class DefaultDnsResponse
public DatagramDnsResponse setOpCode(DnsOpCode opCode)
DnsMessage
opCode
of this DNS message.setOpCode
in interface DnsMessage
setOpCode
in interface DnsResponse
setOpCode
in class DefaultDnsResponse
public DatagramDnsResponse setRecursionDesired(boolean recursionDesired)
DnsMessage
RD
(recursion desired} field of this DNS message.setRecursionDesired
in interface DnsMessage
setRecursionDesired
in interface DnsResponse
setRecursionDesired
in class DefaultDnsResponse
public DatagramDnsResponse setZ(int z)
DnsMessage
Z
(reserved for future use) field of this DNS message.setZ
in interface DnsMessage
setZ
in interface DnsResponse
setZ
in class DefaultDnsResponse
public DatagramDnsResponse setRecord(DnsSection section, DnsRecord record)
DnsMessage
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
.setRecord
in interface DnsMessage
setRecord
in interface DnsResponse
setRecord
in class DefaultDnsResponse
public DatagramDnsResponse addRecord(DnsSection section, DnsRecord record)
DnsMessage
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
.addRecord
in interface DnsMessage
addRecord
in interface DnsResponse
addRecord
in class DefaultDnsResponse
public DatagramDnsResponse addRecord(DnsSection section, int index, DnsRecord record)
DnsMessage
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
.addRecord
in interface DnsMessage
addRecord
in interface DnsResponse
addRecord
in class DefaultDnsResponse
public DatagramDnsResponse clear(DnsSection section)
DnsMessage
section
of this DNS message.clear
in interface DnsMessage
clear
in interface DnsResponse
clear
in class DefaultDnsResponse
public DatagramDnsResponse clear()
DnsMessage
clear
in interface DnsMessage
clear
in interface DnsResponse
clear
in class DefaultDnsResponse
public DatagramDnsResponse touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
touch
in interface DnsMessage
touch
in interface DnsResponse
touch
in interface ReferenceCounted
touch
in class DefaultDnsResponse
public DatagramDnsResponse touch(Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
in interface AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
touch
in interface DnsMessage
touch
in interface DnsResponse
touch
in interface ReferenceCounted
touch
in class DefaultDnsResponse
public DatagramDnsResponse retain()
ReferenceCounted
1
.retain
in interface AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
retain
in interface DnsMessage
retain
in interface DnsResponse
retain
in interface ReferenceCounted
retain
in class DefaultDnsResponse
public DatagramDnsResponse retain(int increment)
ReferenceCounted
increment
.retain
in interface AddressedEnvelope<DatagramDnsResponse,InetSocketAddress>
retain
in interface DnsMessage
retain
in interface DnsResponse
retain
in interface ReferenceCounted
retain
in class DefaultDnsResponse
public boolean equals(Object obj)
equals
in class AbstractDnsMessage
public int hashCode()
hashCode
in class AbstractDnsMessage
Copyright © 2008–2017 The Netty Project. All rights reserved.