Package org.minidns.source
Class NetworkDataSource
- java.lang.Object
-
- org.minidns.source.AbstractDnsDataSource
-
- org.minidns.source.NetworkDataSource
-
- All Implemented Interfaces:
DnsDataSource
- Direct Known Subclasses:
NetworkDataSourceWithAccounting
public class NetworkDataSource extends AbstractDnsDataSource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.minidns.source.AbstractDnsDataSource
AbstractDnsDataSource.QueryMode
-
Nested classes/interfaces inherited from interface org.minidns.source.DnsDataSource
DnsDataSource.OnResponseCallback
-
-
Field Summary
Fields Modifier and Type Field Description protected static Logger
LOGGER
-
Fields inherited from class org.minidns.source.AbstractDnsDataSource
timeout, udpPayloadSize
-
-
Constructor Summary
Constructors Constructor Description NetworkDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DatagramSocket
createDatagramSocket()
Create aDatagramSocket
using the system defaults.protected Socket
createSocket()
Create aSocket
using the system defaultSocketFactory
.StandardDnsQueryResult
query(DnsMessage message, InetAddress address, int port)
protected DnsMessage
queryTcp(DnsMessage message, InetAddress address, int port)
protected DnsMessage
queryUdp(DnsMessage message, InetAddress address, int port)
-
Methods inherited from class org.minidns.source.AbstractDnsDataSource
cacheResult, getQueryMode, getTimeout, getUdpPayloadSize, queryAsync, setQueryMode, setTimeout, setUdpPayloadSize
-
-
-
-
Constructor Detail
-
NetworkDataSource
public NetworkDataSource()
-
-
Method Detail
-
query
public StandardDnsQueryResult query(DnsMessage message, InetAddress address, int port) throws IOException
- Specified by:
query
in interfaceDnsDataSource
- Specified by:
query
in classAbstractDnsDataSource
- Throws:
IOException
-
queryUdp
protected DnsMessage queryUdp(DnsMessage message, InetAddress address, int port) throws IOException
- Throws:
IOException
-
queryTcp
protected DnsMessage queryTcp(DnsMessage message, InetAddress address, int port) throws IOException
- Throws:
IOException
-
createSocket
protected Socket createSocket()
Create aSocket
using the system defaultSocketFactory
.- Returns:
- The new
Socket
instance
-
createDatagramSocket
protected DatagramSocket createDatagramSocket() throws SocketException
Create aDatagramSocket
using the system defaults.- Returns:
- The new
DatagramSocket
instance - Throws:
SocketException
- If creation of theDatagramSocket
fails
-
-