org.apache.james.services
Interface DNSServer

All Known Implementing Classes:
DNSServer

public interface DNSServer

Provides abstraction for DNS resolutions. The interface is Mail specific. It may be a good idea to make the interface more generic or expose commonly needed DNS methods.


Field Summary
static String ROLE
          The component role used by components implementing this service
 
Method Summary
 Collection findMXRecords(String hostname)
          Get a priority-sorted collection of DNS MX records for a given hostname TODO: Change this to a list, as not all collections are sortable
 Iterator getSMTPHostAddresses(String domainName)
          Performs DNS lookups as needed to find servers which should or might support SMTP.
 

Field Detail

ROLE

public static final String ROLE
The component role used by components implementing this service

See Also:
Constant Field Values
Method Detail

findMXRecords

public Collection findMXRecords(String hostname)

Get a priority-sorted collection of DNS MX records for a given hostname

TODO: Change this to a list, as not all collections are sortable

Parameters:
hostname - the hostname to check
Returns:
collection of strings representing MX record values.

getSMTPHostAddresses

public Iterator getSMTPHostAddresses(String domainName)
Performs DNS lookups as needed to find servers which should or might support SMTP. Returns one SMTPHostAddresses for each such host discovered by DNS. If no host is found for domainName, the Iterator returned will be empty and the first call to hasNext() will return false.

Parameters:
domainName - the String domain for which SMTP host addresses are sought.
Returns:
an Enumeration in which the Objects returned by next() are instances of SMTPHostAddresses.


"Copyright © 1999-2006 Apache Jakarta Project. All Rights Reserved."