public abstract class DnsMessage extends AbstractReferenceCounted
Modifier and Type | Method and Description |
---|---|
DnsMessage |
addAdditionalResource(DnsResource resource)
Adds an additional resource record to this message.
|
DnsMessage |
addAnswer(DnsResource answer)
Adds an answer resource record to this message.
|
DnsMessage |
addAuthorityResource(DnsResource resource)
Adds an authority resource record to this message.
|
List<DnsResource> |
additionalResources()
Returns a list of all the additional resource records in this message.
|
DnsMessage |
addQuestion(DnsQuestion question)
Adds a question to this message.
|
List<DnsResource> |
answers()
Returns a list of all the answer resource records in this message.
|
List<DnsResource> |
authorityResources()
Returns a list of all the authority resource records in this message.
|
protected void |
deallocate()
Called once
AbstractReferenceCounted.refCnt() is equals 0. |
DnsHeader |
header()
Returns the header belonging to this message.
|
protected abstract DnsHeader |
newHeader(int id) |
List<DnsQuestion> |
questions()
Returns a list of all the questions in this message.
|
boolean |
release()
Decreases the reference count by
1 and deallocates this object if the reference count reaches at
0 . |
boolean |
release(int decrement)
Decreases the reference count by the specified
decrement and deallocates this object if the reference
count reaches at 0 . |
DnsMessage |
retain()
Increases the reference count by
1 . |
DnsMessage |
retain(int increment)
Increases the reference count by the specified
increment . |
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 additonal arbitrary information for debugging
purposes.
|
refCnt, setRefCnt
public DnsHeader header()
public List<DnsQuestion> questions()
public List<DnsResource> answers()
public List<DnsResource> authorityResources()
public List<DnsResource> additionalResources()
public DnsMessage addAnswer(DnsResource answer)
answer
- the answer resource record to be addedpublic DnsMessage addQuestion(DnsQuestion question)
question
- the question to be addedpublic DnsMessage addAuthorityResource(DnsResource resource)
resource
- the authority resource record to be addedpublic DnsMessage addAdditionalResource(DnsResource resource)
resource
- the additional resource record to be addedprotected void deallocate()
AbstractReferenceCounted
AbstractReferenceCounted.refCnt()
is equals 0.deallocate
in class AbstractReferenceCounted
public boolean release()
ReferenceCounted
1
and deallocates this object if the reference count reaches at
0
.release
in interface ReferenceCounted
release
in class AbstractReferenceCounted
true
if and only if the reference count became 0
and this object has been deallocatedpublic boolean release(int decrement)
ReferenceCounted
decrement
and deallocates this object if the reference
count reaches at 0
.release
in interface ReferenceCounted
release
in class AbstractReferenceCounted
true
if and only if the reference count became 0
and this object has been deallocatedpublic DnsMessage touch(Object hint)
ReferenceCounted
ResourceLeakDetector
.public DnsMessage retain()
ReferenceCounted
1
.retain
in interface ReferenceCounted
retain
in class AbstractReferenceCounted
public DnsMessage retain(int increment)
ReferenceCounted
increment
.retain
in interface ReferenceCounted
retain
in class AbstractReferenceCounted
public DnsMessage touch()
ReferenceCounted
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface ReferenceCounted
touch
in class AbstractReferenceCounted
protected abstract DnsHeader newHeader(int id)
Copyright © 2008–2015 The Netty Project. All rights reserved.