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 java.util.logging.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 java.net.DatagramSocket
createDatagramSocket()
Create aDatagramSocket
using the system defaults.protected java.net.Socket
createSocket()
Create aSocket
using the system defaultSocketFactory
.StandardDnsQueryResult
query(DnsMessage message, java.net.InetAddress address, int port)
protected DnsMessage
queryTcp(DnsMessage message, java.net.InetAddress address, int port)
protected DnsMessage
queryUdp(DnsMessage message, java.net.InetAddress address, int port)
-
Methods inherited from class org.minidns.source.AbstractDnsDataSource
cacheResult, getQueryMode, getTimeout, getUdpPayloadSize, queryAsync, setQueryMode, setTimeout, setUdpPayloadSize
-
-
-
-
Field Detail
-
LOGGER
protected static final java.util.logging.Logger LOGGER
-
-
Constructor Detail
-
NetworkDataSource
public NetworkDataSource()
-
-
Method Detail
-
query
public StandardDnsQueryResult query(DnsMessage message, java.net.InetAddress address, int port) throws java.io.IOException
- Specified by:
query
in interfaceDnsDataSource
- Specified by:
query
in classAbstractDnsDataSource
- Throws:
java.io.IOException
-
queryUdp
protected DnsMessage queryUdp(DnsMessage message, java.net.InetAddress address, int port) throws java.io.IOException
- Throws:
java.io.IOException
-
queryTcp
protected DnsMessage queryTcp(DnsMessage message, java.net.InetAddress address, int port) throws java.io.IOException
- Throws:
java.io.IOException
-
createSocket
protected java.net.Socket createSocket()
Create aSocket
using the system defaultSocketFactory
.- Returns:
- The new
Socket
instance
-
createDatagramSocket
protected java.net.DatagramSocket createDatagramSocket() throws java.net.SocketException
Create aDatagramSocket
using the system defaults.- Returns:
- The new
DatagramSocket
instance - Throws:
java.net.SocketException
- If creation of theDatagramSocket
fails
-
-