Class DnsResolveTest
- java.lang.Object
-
- com.dkfqs.measuringagent.javascript.executor.DnsResolveTest
-
public class DnsResolveTest extends java.lang.ObjectResolve a host name to the corresponding IPV4 and IPV6 addresses and get the TTL(s). In addition, it also measures how long the DNS queries take.
-
-
Constructor Summary
Constructors Constructor Description DnsResolveTest(java.lang.String dnsServer)Create a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearResolveLog()Clear the resolve log.JsonArraygetResolvedAAAARecords()Get a JSON array of the resolved AAAA records which contains for each array element the resolved IP address and the TTL.JsonArraygetResolvedARecords()Get a JSON array of the resolved A records which contains for each array element the resolved IP address and the TTL.java.util.ArrayList<java.lang.String>getResolveLog()Get the resolve log.longgetResolveTimeMillis()Get the resolve time of the last performed resolve.booleanresolveRecordTypeA(java.lang.String hostname)Resolve the IPv4 addresses for a host name.booleanresolveRecordTypeAAAA(java.lang.String hostname)Resolve the IPv6 addresses for a host name.
-
-
-
Method Detail
-
resolveRecordTypeA
public boolean resolveRecordTypeA(java.lang.String hostname)
Resolve the IPv4 addresses for a host name.- Parameters:
hostname- the host name- Returns:
- true if at least one IPv4 address could be resolved, else false
- See Also:
getResolvedARecords()
-
getResolvedARecords
public JsonArray getResolvedARecords()
Get a JSON array of the resolved A records which contains for each array element the resolved IP address and the TTL.- Returns:
- a JSON array of the resolved A records which contains for each array element the resolved IP address and the TTL
- See Also:
resolveRecordTypeA(String)
-
resolveRecordTypeAAAA
public boolean resolveRecordTypeAAAA(java.lang.String hostname)
Resolve the IPv6 addresses for a host name.- Parameters:
hostname- the host name- Returns:
- true if at least one IPv6 address could be resolved, else false
- See Also:
getResolvedAAAARecords()
-
getResolvedAAAARecords
public JsonArray getResolvedAAAARecords()
Get a JSON array of the resolved AAAA records which contains for each array element the resolved IP address and the TTL.- Returns:
- a JSON array of the resolved AAAA records which contains for each array element the resolved IP address and the TTL
- See Also:
resolveRecordTypeAAAA(String)
-
getResolveLog
public java.util.ArrayList<java.lang.String> getResolveLog()
Get the resolve log.- Returns:
- the resolve log
-
clearResolveLog
public void clearResolveLog()
Clear the resolve log.
-
getResolveTimeMillis
public long getResolveTimeMillis()
Get the resolve time of the last performed resolve.- Returns:
- the resolve time of the last performed resolve in milliseconds, or -1 if no such data are available
-
-