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

public abstract Class AbstractDnsMessage

extends AbstractReferenceCounted
implements DnsMessage
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.dns.DnsMessage, io.netty5.util.ReferenceCounted
Known Direct Subclasses
io.netty5.handler.codec.dns.DefaultDnsQuery, io.netty5.handler.codec.dns.DefaultDnsResponse
Annotations
@UnstableApi
Imports
io.netty5.util.Resource, .AbstractReferenceCounted, .ResourceLeakDetector, .ResourceLeakDetectorFactory, .ResourceLeakTracker, io.netty5.util.internal.StringUtil, .UnstableApi, java.util.ArrayList, .List

A skeletal implementation of DnsMessage.

Field Summary

Modifier and TypeField and Description
private Object
private Object
private Object
private short
private final ResourceLeakTracker<DnsMessage>
private static final ResourceLeakDetector<DnsMessage>
private DnsOpCode
private Object
private boolean
private static final int
private static final int
private byte
z

Constructor Summary

AccessConstructor and Description
protected
AbstractDnsMessage(int id)

Creates a new instance with the specified id and DnsOpCode#QUERY opCode.

protected
AbstractDnsMessage(int id, DnsOpCode opCode)

Creates a new instance with the specified id and opCode.

Method Summary

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

Implements io.netty5.handler.codec.dns.DnsMessage.addRecord.

Adds the specified record at the end of the specified section of this DNS message.
private void
addRecord(int section, DnsRecord record)

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

Implements io.netty5.handler.codec.dns.DnsMessage.addRecord.

Adds the specified record at the specified index of the specified section of this DNS message.
private void
addRecord(int section, int index, DnsRecord record)

private static <T extends DnsRecord> T
private static DnsRecord
checkQuestion(int section, DnsRecord record)

public DnsMessage
clear(DnsSection section)

Implements io.netty5.handler.codec.dns.DnsMessage.clear.

Removes all the records in the specified section of this DNS message.
public DnsMessage
clear()

Implements io.netty5.handler.codec.dns.DnsMessage.clear.

Removes all the records in this DNS message.
private void
clear(int section)

public int
count(DnsSection section)

Implements io.netty5.handler.codec.dns.DnsMessage.count.

Returns the number of records in the specified section of this DNS message.
private int
count(int section)

public int
count()

Implements io.netty5.handler.codec.dns.DnsMessage.count.

Returns the number of records in this DNS message.
protected void
deallocate()

Implements abstract io.netty5.util.AbstractReferenceCounted.deallocate.

Called once refCnt() is equals 0.
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public int
id()

Implements io.netty5.handler.codec.dns.DnsMessage.id.

Returns the ID of this DNS message.
public boolean
isRecursionDesired()

Implements io.netty5.handler.codec.dns.DnsMessage.isRecursionDesired.

Returns the RD (recursion desired} field of this DNS message.
private static ArrayList<DnsRecord>
public DnsOpCode
opCode()

Implements io.netty5.handler.codec.dns.DnsMessage.opCode.

Returns the opCode of this DNS message.
public <T extends DnsRecord> T
recordAt(DnsSection section)

Implements io.netty5.handler.codec.dns.DnsMessage.recordAt.

Returns the first record in the specified section of this DNS message.
private <T extends DnsRecord> T
recordAt(int section)

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

Implements io.netty5.handler.codec.dns.DnsMessage.recordAt.

Returns the record at the specified index of the specified section of this DNS message.
private <T extends DnsRecord> T
recordAt(int section, int index)

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

Implements io.netty5.handler.codec.dns.DnsMessage.removeRecord.

Removes the record at the specified index of the specified section from this DNS message.
private <T extends DnsRecord> T
removeRecord(int section, int index)

public DnsMessage
public DnsMessage
retain(int increment)

Overrides io.netty5.util.AbstractReferenceCounted.retain.

Implements io.netty5.handler.codec.dns.DnsMessage.retain, io.netty5.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.
private Object
sectionAt(int section)

private static int
public DnsMessage
setId(int id)

Implements io.netty5.handler.codec.dns.DnsMessage.setId.

Sets the ID of this DNS message.
public DnsMessage
setOpCode(DnsOpCode opCode)

Implements io.netty5.handler.codec.dns.DnsMessage.setOpCode.

Sets the opCode of this DNS message.
public DnsMessage
setRecord(DnsSection section, DnsRecord record)

Implements io.netty5.handler.codec.dns.DnsMessage.setRecord.

Sets the specified section of this DNS message to the specified record, making it a single-record section.
private void
setRecord(int section, DnsRecord record)

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

Implements io.netty5.handler.codec.dns.DnsMessage.setRecord.

Sets the specified record at the specified index of the specified section of this DNS message.
private <T extends DnsRecord> T
setRecord(int section, int index, DnsRecord record)

public DnsMessage
setRecursionDesired(boolean recursionDesired)

Implements io.netty5.handler.codec.dns.DnsMessage.setRecursionDesired.

Sets the RD (recursion desired} field of this DNS message.
private void
setSection(int section, Object value)

public DnsMessage
setZ(int z)

Implements io.netty5.handler.codec.dns.DnsMessage.setZ.

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

Overrides io.netty5.util.AbstractReferenceCounted.touch.

Implements io.netty5.handler.codec.dns.DnsMessage.touch, io.netty5.util.ReferenceCounted.touch.

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

Implements io.netty5.handler.codec.dns.DnsMessage.touch, io.netty5.util.ReferenceCounted.touch.

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

Implements io.netty5.handler.codec.dns.DnsMessage.z.

Returns the Z (reserved for future use) field of this DNS message.
Inherited from io.netty5.util.AbstractReferenceCounted:
refCntreleasereleasesetRefCnt

Field Detail

additionalsback to summary
private Object additionals
answersback to summary
private Object answers
authoritiesback to summary
private Object authorities
idback to summary
private short id
leakback to summary
private final ResourceLeakTracker<DnsMessage> leak
leakDetectorback to summary
private static final ResourceLeakDetector<DnsMessage> leakDetector
opCodeback to summary
private DnsOpCode opCode
questionsback to summary
private Object questions
recursionDesiredback to summary
private boolean recursionDesired
SECTION_COUNTback to summary
private static final int SECTION_COUNT
SECTION_QUESTIONback to summary
private static final int SECTION_QUESTION
zback to summary
private byte z

Constructor Detail

AbstractDnsMessageback to summary
protected AbstractDnsMessage(int id)

Creates a new instance with the specified id and DnsOpCode#QUERY opCode.

AbstractDnsMessageback to summary
protected AbstractDnsMessage(int id, DnsOpCode opCode)

Creates a new instance with the specified id and opCode.

Method Detail

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

Implements io.netty5.handler.codec.dns.DnsMessage.addRecord.

Doc from io.netty5.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
private void addRecord(int section, DnsRecord record)
addRecordback to summary
public DnsMessage addRecord(DnsSection section, int index, DnsRecord record)

Implements io.netty5.handler.codec.dns.DnsMessage.addRecord.

Doc from io.netty5.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
addRecordback to summary
private void addRecord(int section, int index, DnsRecord record)
castRecordback to summary
private static <T extends DnsRecord> T castRecord(Object record)
Annotations
@SuppressWarnings:unchecked
checkQuestionback to summary
private static DnsRecord checkQuestion(int section, DnsRecord record)
clearback to summary
public DnsMessage clear(DnsSection section)

Implements io.netty5.handler.codec.dns.DnsMessage.clear.

Doc from io.netty5.handler.codec.dns.DnsMessage.clear.

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

Annotations
@Override
clearback to summary
public DnsMessage clear()

Implements io.netty5.handler.codec.dns.DnsMessage.clear.

Doc from io.netty5.handler.codec.dns.DnsMessage.clear.

Removes all the records in this DNS message.

Annotations
@Override
clearback to summary
private void clear(int section)
countback to summary
public int count(DnsSection section)

Implements io.netty5.handler.codec.dns.DnsMessage.count.

Doc from io.netty5.handler.codec.dns.DnsMessage.count.

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

Annotations
@Override
countback to summary
private int count(int section)
countback to summary
public int count()

Implements io.netty5.handler.codec.dns.DnsMessage.count.

Doc from io.netty5.handler.codec.dns.DnsMessage.count.

Returns the number of records in this DNS message.

Annotations
@Override
deallocateback to summary
protected void deallocate()

Implements abstract io.netty5.util.AbstractReferenceCounted.deallocate.

Doc from io.netty5.util.AbstractReferenceCounted.deallocate.

Called once refCnt() is equals 0.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.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 java.lang.Object.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
idback to summary
public int id()

Implements io.netty5.handler.codec.dns.DnsMessage.id.

Doc from io.netty5.handler.codec.dns.DnsMessage.id.

Returns the ID of this DNS message.

Annotations
@Override
isRecursionDesiredback to summary
public boolean isRecursionDesired()

Implements io.netty5.handler.codec.dns.DnsMessage.isRecursionDesired.

Doc from io.netty5.handler.codec.dns.DnsMessage.isRecursionDesired.

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

Annotations
@Override
newRecordListback to summary
private static ArrayList<DnsRecord> newRecordList()
opCodeback to summary
public DnsOpCode opCode()

Implements io.netty5.handler.codec.dns.DnsMessage.opCode.

Doc from io.netty5.handler.codec.dns.DnsMessage.opCode.

Returns the opCode of this DNS message.

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

Implements io.netty5.handler.codec.dns.DnsMessage.recordAt.

Doc from io.netty5.handler.codec.dns.DnsMessage.recordAt.

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

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

Implements io.netty5.handler.codec.dns.DnsMessage.recordAt.

Doc from io.netty5.handler.codec.dns.DnsMessage.recordAt.

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.

Annotations
@Override
recordAtback to summary
private <T extends DnsRecord> T recordAt(int section, int index)
removeRecordback to summary
public <T extends DnsRecord> T removeRecord(DnsSection section, int index)

Implements io.netty5.handler.codec.dns.DnsMessage.removeRecord.

Doc from io.netty5.handler.codec.dns.DnsMessage.removeRecord.

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

Annotations
@Override
removeRecordback to summary
private <T extends DnsRecord> T removeRecord(int section, int index)
retainback to summary
public DnsMessage retain()

Overrides io.netty5.util.AbstractReferenceCounted.retain.

Implements io.netty5.handler.codec.dns.DnsMessage.retain, io.netty5.util.ReferenceCounted.retain.

Doc from io.netty5.util.ReferenceCounted.retain.

Increases the reference count by 1.

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

Overrides io.netty5.util.AbstractReferenceCounted.retain.

Implements io.netty5.handler.codec.dns.DnsMessage.retain, io.netty5.util.ReferenceCounted.retain.

Doc from io.netty5.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@Override
sectionAtback to summary
private Object sectionAt(int section)
sectionOrdinalback to summary
private static int sectionOrdinal(DnsSection section)
setIdback to summary
public DnsMessage setId(int id)

Implements io.netty5.handler.codec.dns.DnsMessage.setId.

Doc from io.netty5.handler.codec.dns.DnsMessage.setId.

Sets the ID of this DNS message.

Annotations
@Override
setOpCodeback to summary
public DnsMessage setOpCode(DnsOpCode opCode)

Implements io.netty5.handler.codec.dns.DnsMessage.setOpCode.

Doc from io.netty5.handler.codec.dns.DnsMessage.setOpCode.

Sets the opCode of this DNS message.

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

Implements io.netty5.handler.codec.dns.DnsMessage.setRecord.

Doc from io.netty5.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
setRecordback to summary
private void setRecord(int section, DnsRecord record)
setRecordback to summary
public <T extends DnsRecord> T setRecord(DnsSection section, int index, DnsRecord record)

Implements io.netty5.handler.codec.dns.DnsMessage.setRecord.

Doc from io.netty5.handler.codec.dns.DnsMessage.setRecord.

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

Annotations
@Override
setRecordback to summary
private <T extends DnsRecord> T setRecord(int section, int index, DnsRecord record)
setRecursionDesiredback to summary
public DnsMessage setRecursionDesired(boolean recursionDesired)

Implements io.netty5.handler.codec.dns.DnsMessage.setRecursionDesired.

Doc from io.netty5.handler.codec.dns.DnsMessage.setRecursionDesired.

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

Annotations
@Override
setSectionback to summary
private void setSection(int section, Object value)
setZback to summary
public DnsMessage setZ(int z)

Implements io.netty5.handler.codec.dns.DnsMessage.setZ.

Doc from io.netty5.handler.codec.dns.DnsMessage.setZ.

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

Annotations
@Override
touchback to summary
public DnsMessage touch()

Overrides io.netty5.util.AbstractReferenceCounted.touch.

Implements io.netty5.handler.codec.dns.DnsMessage.touch, io.netty5.util.ReferenceCounted.touch.

Doc from io.netty5.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)

Implements io.netty5.handler.codec.dns.DnsMessage.touch, io.netty5.util.ReferenceCounted.touch.

Doc from io.netty5.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()

Implements io.netty5.handler.codec.dns.DnsMessage.z.

Doc from io.netty5.handler.codec.dns.DnsMessage.z.

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

Annotations
@Override