@UnstableApi public interface DnsMessage extends ReferenceCounted
DnsQuery
and a DnsResponse
.Modifier and Type | Method and Description |
---|---|
DnsMessage |
addRecord(DnsSection section,
DnsRecord record)
Adds the specified
record at the end of the specified section of this DNS message. |
DnsMessage |
addRecord(DnsSection section,
int index,
DnsRecord record)
Adds the specified
record at the specified index of the specified section
of this DNS message. |
DnsMessage |
clear()
Removes all the records in this DNS message.
|
DnsMessage |
clear(DnsSection section)
Removes all the records in the specified
section of this DNS message. |
int |
count()
Returns the number of records in this DNS message.
|
int |
count(DnsSection section)
Returns the number of records in the specified
section of this DNS message. |
int |
id()
Returns the
ID of this DNS message. |
boolean |
isRecursionDesired()
Returns the
RD (recursion desired} field of this DNS message. |
DnsOpCode |
opCode()
Returns the
opCode of this DNS message. |
<T extends DnsRecord> |
recordAt(DnsSection section)
Returns the first record in the specified
section of this DNS message. |
<T extends DnsRecord> |
recordAt(DnsSection section,
int index)
Returns the record at the specified
index of the specified section of this DNS message. |
<T extends DnsRecord> |
removeRecord(DnsSection section,
int index)
Removes the record at the specified
index of the specified section from this DNS message. |
DnsMessage |
retain()
Increases the reference count by
1 . |
DnsMessage |
retain(int increment)
Increases the reference count by the specified
increment . |
DnsMessage |
setId(int id)
Sets the
ID of this DNS message. |
DnsMessage |
setOpCode(DnsOpCode opCode)
Sets the
opCode of this DNS message. |
DnsMessage |
setRecord(DnsSection section,
DnsRecord record)
Sets the specified
section of this DNS message to the specified record ,
making it a single-record section. |
<T extends DnsRecord> |
setRecord(DnsSection section,
int index,
DnsRecord record)
Sets the specified
record at the specified index of the specified section
of this DNS message. |
DnsMessage |
setRecursionDesired(boolean recursionDesired)
Sets the
RD (recursion desired} field of this DNS message. |
DnsMessage |
setZ(int z)
Sets the
Z (reserved for future use) field of this DNS message. |
DnsMessage |
touch()
Records the current access location of this object for debugging purposes.
|
DnsMessage |
touch(Object hint)
Records the current access location of this object with an additional arbitrary information for debugging
purposes.
|
int |
z()
Returns the
Z (reserved for future use) field of this DNS message. |
refCnt, release, release
int id()
ID
of this DNS message.DnsMessage setId(int id)
ID
of this DNS message.DnsOpCode opCode()
opCode
of this DNS message.DnsMessage setOpCode(DnsOpCode opCode)
opCode
of this DNS message.boolean isRecursionDesired()
RD
(recursion desired} field of this DNS message.DnsMessage setRecursionDesired(boolean recursionDesired)
RD
(recursion desired} field of this DNS message.int z()
Z
(reserved for future use) field of this DNS message.DnsMessage setZ(int z)
Z
(reserved for future use) field of this DNS message.int count(DnsSection section)
section
of this DNS message.int count()
<T extends DnsRecord> T recordAt(DnsSection section)
section
of this DNS message.
When the specified section
is DnsSection.QUESTION
, the type of the returned record is
always DnsQuestion
.null
if this message doesn't have any records in the specified section
<T extends DnsRecord> T recordAt(DnsSection section, int index)
index
of the specified section
of this DNS message.
When the specified section
is DnsSection.QUESTION
, the type of the returned record is
always DnsQuestion
.IndexOutOfBoundsException
- if the specified index
is out of boundsDnsMessage setRecord(DnsSection section, DnsRecord record)
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
.<T extends DnsRecord> T setRecord(DnsSection section, int index, DnsRecord record)
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
.IndexOutOfBoundsException
- if the specified index
is out of boundsDnsMessage addRecord(DnsSection section, DnsRecord record)
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
.DnsMessage addRecord(DnsSection section, int index, DnsRecord record)
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
.IndexOutOfBoundsException
- if the specified index
is out of bounds<T extends DnsRecord> T removeRecord(DnsSection section, int index)
index
of the specified section
from this DNS message.
When the specified section
is DnsSection.QUESTION
, the type of the returned record is
always DnsQuestion
.DnsMessage clear(DnsSection section)
section
of this DNS message.DnsMessage clear()
DnsMessage touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface ReferenceCounted
DnsMessage touch(Object hint)
ReferenceCounted
ResourceLeakDetector
.touch
in interface ReferenceCounted
DnsMessage retain()
ReferenceCounted
1
.retain
in interface ReferenceCounted
DnsMessage retain(int increment)
ReferenceCounted
increment
.retain
in interface ReferenceCounted
Copyright © 2008–2017 The Netty Project. All rights reserved.