Package tigase.util.dns
Interface DNSResolverIfc
- All Known Implementing Classes:
DNSResolverDefault
public interface DNSResolverIfc
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final System.Loggerstatic final Randomstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionMethod provides default host information for the installation.default String[]Method provides an array of all local host informations, by default it contains defaultHost.default StringResolve IP address for the givenhostnameString[]getHostIPs(String hostname) Resolve all IP addresses for the givenhostnamedefault DNSEntry[]getHostSRV_Entries(String hostname) Retrieves list of SRV DNS entries for givenhostname.default DNSEntry[]getHostSRV_Entries(String hostname, String service, int defPort) Retrieves list of DNS entries for givenhostname.default DNSEntrygetHostSRV_Entry(String hostname) Retrieves service DNS entry with highest priority for givenhostname.default DNSEntrygetHostSRV_Entry(String hostname, String service, int defPort) Retrieves list of DNS entries for givenhostname.default StringgetHostSRV_IP(String hostname) ReturnsIP addressof the machine providing the service.default StringMethod provides alternative host information for the current instance.
-
Field Details
-
TIGASE_PRIMARY_ADDRESS
- See Also:
-
TIGASE_SECONDARY_ADDRESS
- See Also:
-
log
-
rand
-
-
Method Details
-
getDefaultHost
String getDefaultHost()Method provides default host information for the installation. It can be both hostname or IP address.- Returns:
- a default host information.
-
getDefaultHosts
Method provides an array of all local host informations, by default it contains defaultHost.- Returns:
- an array of all local hosts.
-
getSecondaryHost
Method provides alternative host information for the current instance. By default falls back to the default host information.- Returns:
- alternative host information.
-
getHostIP
Resolve IP address for the givenhostname- Parameters:
hostname- the domain name for which this record is valid- Returns:
IP addressof the machine providing the service.- Throws:
UnknownHostException
-
getHostIPs
Resolve all IP addresses for the givenhostname- Parameters:
hostname- the domain name for which this record is valid- Returns:
- Array of all
IP addresseson which target host provide service. - Throws:
UnknownHostException
-
getHostSRV_Entries
Retrieves list of SRV DNS entries for givenhostname. Performs lookup for_xmpp-server._tcpSRV records.- Parameters:
hostname- the domain name for which this record is valid- Returns:
- Array of the DNSEntry objects containing SRV DNS records
- Throws:
UnknownHostException
-
getHostSRV_Entries
default DNSEntry[] getHostSRV_Entries(String hostname, String service, int defPort) throws 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._tcpdefPort- default port number in case DNS records is missing one.- Returns:
- Array of the DNSEntry records
- Throws:
UnknownHostException
-
getHostSRV_Entry
Retrieves service DNS entry with highest priority for givenhostname. Performs lookup for_xmpp-server._tcpSRV records.- Parameters:
hostname- name to resolve- Returns:
- DNSEntry object containing DNS record with highest priority for given
hostname - Throws:
UnknownHostException
-
getHostSRV_Entry
default DNSEntry getHostSRV_Entry(String hostname, String service, int defPort) throws 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._tcpdefPort- default port number in case DNS records is missing one.- Returns:
- DNSEntry object containing DNS record with highest priority for given
hostname - Throws:
UnknownHostException
-
getHostSRV_IP
ReturnsIP addressof the machine providing the service.- Parameters:
hostname- the domain name for which this record is valid- Throws:
UnknownHostException
-