public class DNSUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DNSUtil.HostAddress
Encapsulates a hostname and port.
|
static class |
DNSUtil.WeightedHostAddress
The representation of weighted address.
|
| Constructor and Description |
|---|
DNSUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,DNSUtil.HostAddress> |
getDnsOverride()
Returns the internal DNS that allows to specify target IP addresses and ports
to use for domains.
|
static boolean |
isNameCoveredByPattern(String name,
String pattern)
Checks if the provided DNS pattern matches the provided name.
|
static List<DNSUtil.WeightedHostAddress> |
prioritize(DNSUtil.WeightedHostAddress[] records) |
static List<DNSUtil.HostAddress> |
resolveXMPPDomain(String domain,
int defaultPort)
Returns a sorted list of host names and ports that the specified XMPP domain
can be reached at for server-to-server communication.
|
static void |
setDnsOverride(Map<String,DNSUtil.HostAddress> dnsOverride)
Sets the internal DNS that allows to specify target IP addresses and ports
to use for domains.
|
static List<DNSUtil.WeightedHostAddress> |
srvLookup(String service,
String proto,
String name)
Performs a DNS SRV lookup.
|
public static List<DNSUtil.HostAddress> resolveXMPPDomain(String domain, int defaultPort)
As an example, a lookup for "example.com" may return "im.example.com:5269".
domain - the domain.defaultPort - default port to return if the DNS look up fails.public static Map<String,DNSUtil.HostAddress> getDnsOverride()
public static void setDnsOverride(Map<String,DNSUtil.HostAddress> dnsOverride)
dnsOverride - the internal DNS that allows to specify target IP addresses and ports
to use for domains.public static List<DNSUtil.WeightedHostAddress> srvLookup(String service, String proto, String name)
service - the symbolic name of the desired service (cannot be null).proto - the transport protocol of the desired service; this is usually either TCP or UDP (cannot be null).name - the domain name for which this record is valid (cannot be null).public static boolean isNameCoveredByPattern(String name, String pattern)
name - The name to check against a pattern (cannot be null or empty).pattern - the pattern (cannot be null or empty).public static List<DNSUtil.WeightedHostAddress> prioritize(DNSUtil.WeightedHostAddress[] records)
Copyright © 2003-2008 Jive Software.