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