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

public Class DefaultDnsResponse

extends AbstractDnsMessage
implements DnsResponse
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.dns.DnsResponse, io.netty5.handler.codec.dns.DnsMessage, io.netty5.util.ReferenceCounted
Known Direct Subclasses
io.netty5.handler.codec.dns.DatagramDnsResponse
Annotations
@UnstableApi
Imports
io.netty5.util.internal.UnstableApi

The default DnsResponse implementation.

Field Summary

Modifier and TypeField and Description
private boolean
private DnsResponseCode
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
DefaultDnsResponse(int
the ID of the DNS response
id
)

Creates a new instance with the DnsOpCode#QUERY opCode and the DnsResponseCode#NOERROR RCODE.

public
DefaultDnsResponse(int
the ID of the DNS response
id
,
DnsOpCode
the opCode of the DNS response
opCode
)

Creates a new instance with the DnsResponseCode#NOERROR RCODE.

public
DefaultDnsResponse(int
the ID of the DNS response
id
,
DnsOpCode
the opCode of the DNS response
opCode
,
DnsResponseCode
the RCODE of the DNS response
code
)

Creates a new instance.

Method Summary

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

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.addRecord.

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

Adds the specified record at the end of the specified section of this DNS message.
public DnsResponse
addRecord(DnsSection section, int index, DnsRecord record)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.addRecord.

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

Adds the specified record at the specified index of the specified section of this DNS message.
public DnsResponse
clear(DnsSection section)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.clear.

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

Removes all the records in the specified section of this DNS message.
public DnsResponse
public DnsResponseCode
code()

Implements io.netty5.handler.codec.dns.DnsResponse.code.

Returns the 4 bit return code.
public boolean
isAuthoritativeAnswer()

Implements io.netty5.handler.codec.dns.DnsResponse.isAuthoritativeAnswer.

Returns true if responding server is authoritative for the domain name in the query message.
public boolean
isRecursionAvailable()

Implements io.netty5.handler.codec.dns.DnsResponse.isRecursionAvailable.

Returns true if DNS server can handle recursive queries.
public boolean
isTruncated()

Implements io.netty5.handler.codec.dns.DnsResponse.isTruncated.

Returns true if response has been truncated, usually if it is over 512 bytes.
public DnsResponse
public DnsResponse
public DnsResponse
setAuthoritativeAnswer(boolean
flag for authoritative answer
authoritativeAnswer
)

Implements io.netty5.handler.codec.dns.DnsResponse.setAuthoritativeAnswer.

Set to true if responding server is authoritative for the domain name in the query message.
public DnsResponse
setCode(DnsResponseCode
the response code
code
)

Implements io.netty5.handler.codec.dns.DnsResponse.setCode.

Sets the response code for this message.
public DnsResponse
public DnsResponse
public DnsResponse
setRecord(DnsSection section, DnsRecord record)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.setRecord.

Implements io.netty5.handler.codec.dns.DnsResponse.setRecord, 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.
public DnsResponse
setRecursionAvailable(boolean
flag for recursion availability
recursionAvailable
)

Implements io.netty5.handler.codec.dns.DnsResponse.setRecursionAvailable.

Set to true if DNS server can handle recursive queries.
public DnsResponse
public DnsResponse
setTruncated(boolean
flag for truncation
truncated
)

Implements io.netty5.handler.codec.dns.DnsResponse.setTruncated.

Set to true if response has been truncated (usually happens for responses over 512 bytes).
public DnsResponse
setZ(int z)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.setZ.

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

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

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public DnsResponse
public DnsResponse
touch(Object hint)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.touch.

Implements io.netty5.handler.codec.dns.DnsResponse.touch, 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.
Inherited from io.netty5.handler.codec.dns.AbstractDnsMessage:
countcountdeallocateequalshashCodeidisRecursionDesiredopCoderecordAtrecordAtremoveRecordsetRecordz

Field Detail

authoritativeAnswerback to summary
private boolean authoritativeAnswer
codeback to summary
private DnsResponseCode code
recursionAvailableback to summary
private boolean recursionAvailable
truncatedback to summary
private boolean truncated

Constructor Detail

DefaultDnsResponseback to summary
public DefaultDnsResponse(int id)

Creates a new instance with the DnsOpCode#QUERY opCode and the DnsResponseCode#NOERROR RCODE.

Parameters
id:int

the ID of the DNS response

DefaultDnsResponseback to summary
public DefaultDnsResponse(int id, DnsOpCode opCode)

Creates a new instance with the DnsResponseCode#NOERROR RCODE.

Parameters
id:int

the ID of the DNS response

opCode:DnsOpCode

the opCode of the DNS response

DefaultDnsResponseback to summary
public DefaultDnsResponse(int id, DnsOpCode opCode, DnsResponseCode code)

Creates a new instance.

Parameters
id:int

the ID of the DNS response

opCode:DnsOpCode

the opCode of the DNS response

code:DnsResponseCode

the RCODE of the DNS response

Method Detail

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

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.addRecord.

Implements io.netty5.handler.codec.dns.DnsResponse.addRecord, 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
public DnsResponse addRecord(DnsSection section, int index, DnsRecord record)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.addRecord.

Implements io.netty5.handler.codec.dns.DnsResponse.addRecord, 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
clearback to summary
public DnsResponse clear(DnsSection section)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.clear.

Implements io.netty5.handler.codec.dns.DnsResponse.clear, 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 DnsResponse clear()

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.clear.

Implements io.netty5.handler.codec.dns.DnsResponse.clear, 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
codeback to summary
public DnsResponseCode code()

Implements io.netty5.handler.codec.dns.DnsResponse.code.

Doc from io.netty5.handler.codec.dns.DnsResponse.code.

Returns the 4 bit return code.

Annotations
@Override
isAuthoritativeAnswerback to summary
public boolean isAuthoritativeAnswer()

Implements io.netty5.handler.codec.dns.DnsResponse.isAuthoritativeAnswer.

Doc from io.netty5.handler.codec.dns.DnsResponse.isAuthoritativeAnswer.

Returns true if responding server is authoritative for the domain name in the query message.

Annotations
@Override
isRecursionAvailableback to summary
public boolean isRecursionAvailable()

Implements io.netty5.handler.codec.dns.DnsResponse.isRecursionAvailable.

Doc from io.netty5.handler.codec.dns.DnsResponse.isRecursionAvailable.

Returns true if DNS server can handle recursive queries.

Annotations
@Override
isTruncatedback to summary
public boolean isTruncated()

Implements io.netty5.handler.codec.dns.DnsResponse.isTruncated.

Doc from io.netty5.handler.codec.dns.DnsResponse.isTruncated.

Returns true if response has been truncated, usually if it is over 512 bytes.

Annotations
@Override
retainback to summary
public DnsResponse retain()

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.retain.

Implements io.netty5.handler.codec.dns.DnsResponse.retain, 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 DnsResponse retain(int increment)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.retain.

Implements io.netty5.handler.codec.dns.DnsResponse.retain, 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
setAuthoritativeAnswerback to summary
public DnsResponse setAuthoritativeAnswer(boolean authoritativeAnswer)

Implements io.netty5.handler.codec.dns.DnsResponse.setAuthoritativeAnswer.

Doc from io.netty5.handler.codec.dns.DnsResponse.setAuthoritativeAnswer.

Set to true if responding server is authoritative for the domain name in the query message.

Parameters
authoritativeAnswer:boolean

flag for authoritative answer

Annotations
@Override
setCodeback to summary
public DnsResponse setCode(DnsResponseCode code)

Implements io.netty5.handler.codec.dns.DnsResponse.setCode.

Doc from io.netty5.handler.codec.dns.DnsResponse.setCode.

Sets the response code for this message.

Parameters
code:DnsResponseCode

the response code

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

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.setId.

Implements io.netty5.handler.codec.dns.DnsResponse.setId, 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 DnsResponse setOpCode(DnsOpCode opCode)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.setOpCode.

Implements io.netty5.handler.codec.dns.DnsResponse.setOpCode, 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 DnsResponse setRecord(DnsSection section, DnsRecord record)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.setRecord.

Implements io.netty5.handler.codec.dns.DnsResponse.setRecord, 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
setRecursionAvailableback to summary
public DnsResponse setRecursionAvailable(boolean recursionAvailable)

Implements io.netty5.handler.codec.dns.DnsResponse.setRecursionAvailable.

Doc from io.netty5.handler.codec.dns.DnsResponse.setRecursionAvailable.

Set to true if DNS server can handle recursive queries.

Parameters
recursionAvailable:boolean

flag for recursion availability

Annotations
@Override
setRecursionDesiredback to summary
public DnsResponse setRecursionDesired(boolean recursionDesired)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.setRecursionDesired.

Implements io.netty5.handler.codec.dns.DnsResponse.setRecursionDesired, 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
setTruncatedback to summary
public DnsResponse setTruncated(boolean truncated)

Implements io.netty5.handler.codec.dns.DnsResponse.setTruncated.

Doc from io.netty5.handler.codec.dns.DnsResponse.setTruncated.

Set to true if response has been truncated (usually happens for responses over 512 bytes).

Parameters
truncated:boolean

flag for truncation

Annotations
@Override
setZback to summary
public DnsResponse setZ(int z)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.setZ.

Implements io.netty5.handler.codec.dns.DnsResponse.setZ, 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
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
touchback to summary
public DnsResponse touch()

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.touch.

Implements io.netty5.handler.codec.dns.DnsResponse.touch, 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 DnsResponse touch(Object hint)

Overrides io.netty5.handler.codec.dns.AbstractDnsMessage.touch.

Implements io.netty5.handler.codec.dns.DnsResponse.touch, 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