Package org.minidns.source
Class AbstractDnsDataSource
java.lang.Object
org.minidns.source.AbstractDnsDataSource
- All Implemented Interfaces:
DnsDataSource
- Direct Known Subclasses:
AsyncNetworkDataSource
,NetworkDataSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.minidns.source.DnsDataSource
DnsDataSource.OnResponseCallback
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
cacheResult
(DnsMessage request, DnsQueryResult response) int
Retrieve the current dns query timeout, in milliseconds.int
abstract DnsQueryResult
query
(DnsMessage message, InetAddress address, int port) queryAsync
(DnsMessage message, InetAddress address, int port, DnsDataSource.OnResponseCallback onResponseCallback) void
setQueryMode
(AbstractDnsDataSource.QueryMode queryMode) void
setTimeout
(int timeout) Change the dns query timeout for all future queries.void
setUdpPayloadSize
(int udpPayloadSize)
-
Field Details
-
udpPayloadSize
-
timeout
DNS timeout.
-
-
Constructor Details
-
AbstractDnsDataSource
public AbstractDnsDataSource()
-
-
Method Details
-
query
public abstract DnsQueryResult query(DnsMessage message, InetAddress address, int port) throws IOException - Specified by:
query
in interfaceDnsDataSource
- Throws:
IOException
-
queryAsync
public MiniDnsFuture<DnsQueryResult,IOException> queryAsync(DnsMessage message, InetAddress address, int port, DnsDataSource.OnResponseCallback onResponseCallback) - Specified by:
queryAsync
in interfaceDnsDataSource
-
getTimeout
Description copied from interface:DnsDataSource
Retrieve the current dns query timeout, in milliseconds.- Specified by:
getTimeout
in interfaceDnsDataSource
- Returns:
- the current dns query timeout in milliseconds.
-
setTimeout
Description copied from interface:DnsDataSource
Change the dns query timeout for all future queries. The timeout must be specified in milliseconds.- Specified by:
setTimeout
in interfaceDnsDataSource
- Parameters:
timeout
- new dns query timeout in milliseconds.
-
getUdpPayloadSize
- Specified by:
getUdpPayloadSize
in interfaceDnsDataSource
-
setUdpPayloadSize
-
cacheResult
-
setQueryMode
-
getQueryMode
-