Package tigase.util.dns
Interface DNSResolverIfc
-
- All Known Implementing Classes:
DNSResolverDefault
public interface DNSResolverIfc
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.logging.Logger
log
static java.util.Random
rand
static java.lang.String
TIGASE_PRIMARY_ADDRESS
static java.lang.String
TIGASE_SECONDARY_ADDRESS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.lang.String
getDefaultHost()
Method provides default host information for the installation.default java.lang.String[]
getDefaultHosts()
Method provides an array of all local host informations, by default it contains defaultHost.default java.lang.String
getHostIP(java.lang.String hostname)
Resolve IP address for the givenhostname
java.lang.String[]
getHostIPs(java.lang.String hostname)
Resolve all IP addresses for the givenhostname
default DNSEntry[]
getHostSRV_Entries(java.lang.String hostname)
Retrieves list of SRV DNS entries for givenhostname
.default DNSEntry[]
getHostSRV_Entries(java.lang.String hostname, java.lang.String service, int defPort)
Retrieves list of DNS entries for givenhostname
.default DNSEntry
getHostSRV_Entry(java.lang.String hostname)
Retrieves service DNS entry with highest priority for givenhostname
.default DNSEntry
getHostSRV_Entry(java.lang.String hostname, java.lang.String service, int defPort)
Retrieves list of DNS entries for givenhostname
.default java.lang.String
getHostSRV_IP(java.lang.String hostname)
ReturnsIP address
of the machine providing the service.default java.lang.String
getSecondaryHost()
Method provides alternative host information for the current instance.
-
-
-
Field Detail
-
TIGASE_PRIMARY_ADDRESS
static final java.lang.String TIGASE_PRIMARY_ADDRESS
- See Also:
- Constant Field Values
-
TIGASE_SECONDARY_ADDRESS
static final java.lang.String TIGASE_SECONDARY_ADDRESS
- See Also:
- Constant Field Values
-
log
static final java.util.logging.Logger log
-
rand
static final java.util.Random rand
-
-
Method Detail
-
getDefaultHost
java.lang.String getDefaultHost()
Method provides default host information for the installation. It can be both hostname or IP address.- Returns:
- a default host information.
-
getDefaultHosts
default java.lang.String[] getDefaultHosts()
Method provides an array of all local host informations, by default it contains defaultHost.- Returns:
- an array of all local hosts.
-
getSecondaryHost
default java.lang.String getSecondaryHost()
Method provides alternative host information for the current instance. By default falls back to the default host information.- Returns:
- alternative host information.
-
getHostIP
default java.lang.String getHostIP(java.lang.String hostname) throws java.net.UnknownHostException
Resolve IP address for the givenhostname
- Parameters:
hostname
- the domain name for which this record is valid- Returns:
IP address
of the machine providing the service.- Throws:
java.net.UnknownHostException
-
getHostIPs
java.lang.String[] getHostIPs(java.lang.String hostname) throws java.net.UnknownHostException
Resolve all IP addresses for the givenhostname
- Parameters:
hostname
- the domain name for which this record is valid- Returns:
- Array of all
IP addresses
on which target host provide service. - Throws:
java.net.UnknownHostException
-
getHostSRV_Entries
default DNSEntry[] getHostSRV_Entries(java.lang.String hostname) throws java.net.UnknownHostException
Retrieves list of SRV DNS entries for givenhostname
. Performs lookup for_xmpp-server._tcp
SRV records.- Parameters:
hostname
- the domain name for which this record is valid- Returns:
- Array of the DNSEntry objects containing SRV DNS records
- Throws:
java.net.UnknownHostException
-
getHostSRV_Entries
default DNSEntry[] getHostSRV_Entries(java.lang.String hostname, java.lang.String service, int defPort) throws java.net.UnknownHostException
Retrieves list of DNS entries for givenhostname
. Allow specifying particular type of SRV record.- Parameters:
hostname
- the domain name for which this record is validservice
- type of SRV records, for example_xmpp-server._tcp
defPort
- default port number in case DNS records is missing one.- Returns:
- Array of the DNSEntry records
- Throws:
java.net.UnknownHostException
-
getHostSRV_Entry
default DNSEntry getHostSRV_Entry(java.lang.String hostname) throws java.net.UnknownHostException
Retrieves service DNS entry with highest priority for givenhostname
. Performs lookup for_xmpp-server._tcp
SRV records.- Parameters:
hostname
- name to resolve- Returns:
- DNSEntry object containing DNS record with highest priority for given
hostname
- Throws:
java.net.UnknownHostException
-
getHostSRV_Entry
default DNSEntry getHostSRV_Entry(java.lang.String hostname, java.lang.String service, int defPort) throws java.net.UnknownHostException
Retrieves list of DNS entries for givenhostname
. Allow specifying particular type of SRV record.- Parameters:
hostname
- name to resolveservice
- type of SRV records, for example_xmpp-server._tcp
defPort
- default port number in case DNS records is missing one.- Returns:
- DNSEntry object containing DNS record with highest priority for given
hostname
- Throws:
java.net.UnknownHostException
-
getHostSRV_IP
default java.lang.String getHostSRV_IP(java.lang.String hostname) throws java.net.UnknownHostException
ReturnsIP address
of the machine providing the service.- Parameters:
hostname
- the domain name for which this record is valid- Throws:
java.net.UnknownHostException
-
-