public class DNSResolverDefault extends Object implements DNSResolverIfc
Modifier and Type | Field and Description |
---|---|
static Map<String,DNSEntry> |
ip_cache |
static Map<String,DNSEntry[]> |
srv_cache |
rand, TIGASE_PRIMARY_ADDRESS, TIGASE_SECONDARY_ADDRESS
Modifier | Constructor and Description |
---|---|
protected |
DNSResolverDefault() |
Modifier and Type | Method and Description |
---|---|
String |
getDefaultHost()
Method provides default host information for the installation.
|
String[] |
getDefaultHosts()
Method provides an array of all local host informations, by default it contains defaultHost.
|
String[] |
getHostIPs(String hostname)
Resolve all IP addresses for the given
hostname |
DNSEntry[] |
getHostSRV_Entries(String hostname,
String service,
int defPort)
Retrieves list of DNS entries for given
hostname . |
String |
getPrimaryHost() |
String |
getSecondaryHost()
Method provides alternative host information for the current instance.
|
protected static boolean |
isHostValid(String host) |
static void |
main(String[] args)
main method outputting various information about hostnames |
void |
setPrimaryHost(String tigasePrimaryHost) |
void |
setSecondaryHost(String tigaseSecondaryHost) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getHostIP, getHostSRV_Entries, getHostSRV_Entry, getHostSRV_Entry, getHostSRV_IP
protected static boolean isHostValid(String host)
public static void main(String[] args) throws Exception
main
method outputting various information about hostnamesargs
- a String[]
containing domains to query, if none provided default one will be usedException
public String[] getDefaultHosts()
DNSResolverIfc
getDefaultHosts
in interface DNSResolverIfc
public String getDefaultHost()
DNSResolverIfc
getDefaultHost
in interface DNSResolverIfc
public String getPrimaryHost()
public void setPrimaryHost(String tigasePrimaryHost)
public String getSecondaryHost()
DNSResolverIfc
getSecondaryHost
in interface DNSResolverIfc
public void setSecondaryHost(String tigaseSecondaryHost)
public String[] getHostIPs(String hostname) throws UnknownHostException
hostname
getHostIPs
in interface DNSResolverIfc
hostname
- the domain name for which this record is validIP addresses
on which target host provide service.UnknownHostException
public DNSEntry[] getHostSRV_Entries(String hostname, String service, int defPort) throws UnknownHostException
DNSResolverIfc
hostname
. Allow specifying particular type of SRV record.getHostSRV_Entries
in interface DNSResolverIfc
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.UnknownHostException
Copyright © 2004–2020 "Tigase, Inc.". All rights reserved.