|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DnsResolver
Helper class for DNS operations.
Method Summary | |
---|---|
java.lang.String |
resolveIpAddress(java.lang.String hostname)
Resolves the IP Address (A record) to the specified host name. |
java.lang.String |
resolveServiceEntry(java.lang.String serviceType,
java.lang.String domain)
Resolves the host name for the specified service in the specified domain |
java.lang.String |
resolveServiceIpAddress(java.lang.String serviceType,
java.lang.String domain)
Resolves the host name for the specified service and then the IP Address for this host in one call. |
Method Detail |
---|
java.lang.String resolveIpAddress(java.lang.String hostname) throws DnsEntryNotFoundException, DnsLookupException
hostname
- The hostname for which you need the IP Address
DnsEntryNotFoundException
- No record found
DnsLookupException
- Unknown DNS errorjava.lang.String resolveServiceEntry(java.lang.String serviceType, java.lang.String domain) throws DnsEntryNotFoundException, DnsLookupException
Resolves the host name for the specified service in the specified domain
For example, if you need the host name for an LDAP server running in the domain springsource.com, you would call resolveServiceEntry("ldap", "springsource.com").
The DNS server needs to provide the service records for this, in the example above, it would look like this:
_ldap._tcp.springsource.com IN SRV 10 0 88 ldap.springsource.com.The method will return the record with highest priority (which means the lowest number in the DNS record) and if there are more than one records with the same priority, it will return the one with the highest weight. You will find more informatione about DNS service records at Wikipedia.
serviceType
- The service type you are searching for, e.g. ldap, kerberos, ...domain
- The domain, in which you are searching for the service
DnsEntryNotFoundException
- No record found
DnsLookupException
- Unknown DNS errorjava.lang.String resolveServiceIpAddress(java.lang.String serviceType, java.lang.String domain) throws DnsEntryNotFoundException, DnsLookupException
serviceType
- The service type you are searching for, e.g. ldap, kerberos, ...domain
- The domain, in which you are searching for the service
DnsEntryNotFoundException
- No record found
DnsLookupException
- Unknown DNS errorresolveServiceEntry(String, String)
,
resolveIpAddress(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |