Constructor and Description |
---|
Dns.Builder()
Create a new builder using the defaults:
|
Dns.Builder(Dns dns)
Copy constructor builder initialized from the passed in protocol.
|
Modifier and Type | Method and Description |
---|---|
<T> Dns.Builder |
additional(String name,
Dns.RecordType rt,
int ttl,
T d)
Sets the additionals array for a single resource record.
|
Dns.Builder |
additionals(Dns.ResRecord<?>... additionals)
Sets the additionals array.
|
<T> Dns.Builder |
answer(String name,
Dns.RecordType rt,
int ttl,
T d)
Sets the answers array for a single resource record.
|
Dns.Builder |
answers(Dns.ResRecord<?>... answers)
Sets the answers array.
|
Dns.Builder |
authData(boolean authData)
Sets whether the response data is authorized.
|
Dns.Builder |
authorities(Dns.ResRecord<?>... authorities)
Sets the authorities array.
|
<T> Dns.Builder |
authority(String name,
Dns.RecordType rt,
int ttl,
T d)
Sets the authorities array for a single resource record.
|
Dns |
build()
Creates a new protocol instance from this builder.
|
Dns.Builder |
checkDisabled(boolean checkDisabled)
Sets the check disabled flag.
|
Dns.Builder |
opCode(Dns.OpCode opCode)
Sets the opcode.
|
Dns.Builder |
queries(Dns.Record... queries)
Sets the queries array.
|
Dns.Builder |
query(boolean query)
Sets the query flag.
|
Dns.Builder |
query(String name,
Dns.RecordType rt)
Sets up the query array for a single name query.
|
Dns.Builder |
recurDesired(boolean recurDesired)
Specifies whether recursion is desired for a query.
|
Dns.Builder |
respCode(Dns.ResponseCode respCode)
Sets the response code.
|
Dns.Builder |
responderAuth(boolean responderAuth)
Sets the authoritative flag.
|
Dns.Builder |
responseFor(Dns query)
A convenience method to construct a response object for the given
query.
|
Dns.Builder |
svrRecurAvail(boolean svrRecurAvail)
Sets whether recursion is available on the server.
|
Dns.Builder |
trunc(boolean trunc)
Sets the truncated flag.
|
Dns.Builder |
txId(int txId)
Sets the transaction ID.
|
public Dns.Builder()
txId = 0 query = false opCode = QUERY responderAuth = false trunc = false recurDesired = false svrRecurAvail = false authData = false checkDisabled = false retCode = NO_ERROR queries = NO_REQUESTS answers = NO_RESPONSES authorities = NO_RESPONSES additionals = NO_RESPONSES
public Dns.Builder(Dns dns)
dns
- builder is initialed from this protocol's datapublic Dns build()
public Dns.Builder txId(int txId)
txId
- the transaction ID of this query or responsepublic Dns.Builder query(boolean query)
query
- the query flag.public Dns.Builder opCode(Dns.OpCode opCode)
opCode
- the DNS opcodepublic Dns.Builder responderAuth(boolean responderAuth)
responderAuth
- the responder authoritative flagpublic Dns.Builder trunc(boolean trunc)
trunc
- the truncated flagpublic Dns.Builder recurDesired(boolean recurDesired)
recurDesired
- the recursion is desired flagpublic Dns.Builder svrRecurAvail(boolean svrRecurAvail)
svrRecurAvail
- the server recursion is available flagpublic Dns.Builder authData(boolean authData)
authData
- the response data is authorized flagpublic Dns.Builder checkDisabled(boolean checkDisabled)
checkDisabled
- the check disabled flagpublic Dns.Builder respCode(Dns.ResponseCode respCode)
respCode
- the response codepublic Dns.Builder queries(Dns.Record... queries)
queries
- array of query requestspublic Dns.Builder query(String name, Dns.RecordType rt)
name
- the name text to queryrt
- the record typepublic Dns.Builder answers(Dns.ResRecord<?>... answers)
answers
- array of answers responsespublic <T> Dns.Builder answer(String name, Dns.RecordType rt, int ttl, T d)
name
- the name textrt
- the resource record typettl
- the time to live in secondsd
- the resource datapublic Dns.Builder authorities(Dns.ResRecord<?>... authorities)
authorities
- array of authority responsespublic <T> Dns.Builder authority(String name, Dns.RecordType rt, int ttl, T d)
name
- the name textrt
- the resource record typettl
- the time to live in secondsd
- the resource datapublic Dns.Builder additionals(Dns.ResRecord<?>... additionals)
additionals
- array of additional responsespublic <T> Dns.Builder additional(String name, Dns.RecordType rt, int ttl, T d)
name
- the name textrt
- the resource record typettl
- the time to live in secondsd
- the resource datapublic Dns.Builder responseFor(Dns query)
query
- the original DNS query requestCopyright © 2015. All Rights Reserved.