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

public Interface DnsMessage

extends ReferenceCounted
Known Direct Subinterfaces
io.netty.handler.codec.dns.DnsQuery, io.netty.handler.codec.dns.DnsResponse
Known Direct Implementers
io.netty.handler.codec.dns.AbstractDnsMessage
Annotations
@UnstableApi
Imports
io.netty.util.ReferenceCounted, io.netty.util.internal.UnstableApi

The superclass which contains core information concerning a DnsQuery and a DnsResponse.

Method Summary

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

Adds the specified record at the end of the specified section of this DNS message.

public DnsMessage
addRecord(DnsSection section, int index, DnsRecord record)

Adds the specified record at the specified index of the specified section of this DNS message.

public DnsMessage
clear(DnsSection section)

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

public DnsMessage
clear()

Removes all the records in this DNS message.

public int
count(DnsSection section)

Returns the number of records in the specified section of this DNS message.

public int
count()

Returns the number of records in this DNS message.

public int
id()

Returns the ID of this DNS message.

public boolean
isRecursionDesired()

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

public DnsOpCode
opCode()

Returns the opCode of this DNS message.

public <T extends DnsRecord> T

Returns:

null if this message doesn't have any records in the specified section
recordAt
(DnsSection section)

Returns the first record in the specified section of this DNS message.

public <T extends DnsRecord> T
recordAt(DnsSection section, int index)

Returns the record at the specified index of the specified section of this DNS message.

public <T extends DnsRecord> T

Returns:

the removed record
removeRecord
(DnsSection section, int index)

Removes the record at the specified index of the specified section from this DNS message.

public DnsMessage
retain()

Redeclares io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.
public DnsMessage
retain(int increment)

Redeclares io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.
public DnsMessage
setId(int id)

Sets the ID of this DNS message.

public DnsMessage
setOpCode(DnsOpCode opCode)

Sets the opCode of this DNS message.

public DnsMessage
setRecord(DnsSection section, DnsRecord record)

Sets the specified section of this DNS message to the specified record, making it a single-record section.

public <T extends DnsRecord> T

Returns:

the old record
setRecord
(DnsSection section, int index, DnsRecord record)

Sets the specified record at the specified index of the specified section of this DNS message.

public DnsMessage
setRecursionDesired(boolean recursionDesired)

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

public DnsMessage
setZ(int z)

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

public DnsMessage
touch()

Redeclares io.netty.util.ReferenceCounted.touch.

Records the current access location of this object for debugging purposes.
public DnsMessage
touch(Object hint)

Redeclares io.netty.util.ReferenceCounted.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
public int
z()

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

Inherited from io.netty.util.ReferenceCounted:
refCntreleaserelease

Method Detail

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

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.

addRecordback to summary
public DnsMessage addRecord(DnsSection section, int index, DnsRecord record)

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.

Exceptions
IndexOutOfBoundsException:
if the specified index is out of bounds
clearback to summary
public DnsMessage clear(DnsSection section)

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

clearback to summary
public DnsMessage clear()

Removes all the records in this DNS message.

countback to summary
public int count(DnsSection section)

Returns the number of records in the specified section of this DNS message.

countback to summary
public int count()

Returns the number of records in this DNS message.

idback to summary
public int id()

Returns the ID of this DNS message.

isRecursionDesiredback to summary
public boolean isRecursionDesired()

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

opCodeback to summary
public DnsOpCode opCode()

Returns the opCode of this DNS message.

recordAtback to summary
public <T extends DnsRecord> T recordAt(DnsSection section)

Returns the first record in the specified section of this DNS message. When the specified section is DnsSection#QUESTION, the type of the returned record is always DnsQuestion.

Returns:T

null if this message doesn't have any records in the specified section

recordAtback to summary
public <T extends DnsRecord> T recordAt(DnsSection section, int index)

Returns the record at the specified 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.

Exceptions
IndexOutOfBoundsException:
if the specified index is out of bounds
removeRecordback to summary
public <T extends DnsRecord> T removeRecord(DnsSection section, int index)

Removes the record at the specified 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.

Returns:T

the removed record

retainback to summary
public DnsMessage retain()

Redeclares io.netty.util.ReferenceCounted.retain.

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

Increases the reference count by 1.

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

Redeclares io.netty.util.ReferenceCounted.retain.

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

Increases the reference count by the specified increment.

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

Sets the ID of this DNS message.

setOpCodeback to summary
public DnsMessage setOpCode(DnsOpCode opCode)

Sets the opCode of this DNS message.

setRecordback to summary
public DnsMessage setRecord(DnsSection section, DnsRecord record)

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.

setRecordback to summary
public <T extends DnsRecord> T setRecord(DnsSection section, int index, DnsRecord record)

Sets 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.

Returns:T

the old record

Exceptions
IndexOutOfBoundsException:
if the specified index is out of bounds
setRecursionDesiredback to summary
public DnsMessage setRecursionDesired(boolean recursionDesired)

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

setZback to summary
public DnsMessage setZ(int z)

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

touchback to summary
public DnsMessage touch()

Redeclares 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 DnsMessage touch(Object hint)

Redeclares 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
zback to summary
public int z()

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