james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harmeet Bedi" <harm...@kodemuse.com>
Subject Re: [PATCH] Upgrade to DnsJava 1.3.1, add DNS Server autodetect, Make use of higher level api
Date Sun, 19 Jan 2003 09:09:13 GMT
---- Original Message -----
From: "Serge Knystautas" <sergek@lokitech.com>
.. DNSServer API
>
> Are you saying it's returning a Collection right now?  If it is, then it
> should be returned as a List.  MX records have an order, and if we put the
> results in a Collection, it seems that we risk losing the ordering,
doesn't
> it?


DNSServer block returs a sorted collection now and has been from the first
instance of the block. One could loose ordering in a collection but
converting to list does not help as list is a collection. Iterator may be
the best to express the idea of order.

Sorting is the responsibility of DNSServer implementation not the user of
API. The collection returns MX Records sorted by priority. Remote Delivery
gets hold of and collection through mailet context(o.a.j.James), converts to
an iterator and attempts to send email to the first mail server address than
second if first fails and so on. The only 2 methods called on Collection are
Collection::size and Collection::iterator.

Converting to a List will not really help as the returned collection/list
contains only contains the IP address. There is not enough context like
priority in the returned collection/list to allow the user of the API to
effectively sort on.

I think it may be better to narrow the API to use Iterator rather than
broadening to use List and taking the sorting responsibility out of the
DNSServer implementation.


Having said all this, it doesn't really matter. The returned collection can
be cast to a List. But to expose List instead of Collection effectively,
would also mean the MailetContext API will need to expose List not
Collection. At present MailetContext exposes

    /**
     * Returns a Collection of Strings of hostnames or ip addresses that
     * are specified as mail server listeners for the given hostname.
     * This is done using MX records, and the hostnames or ip addresses
     * are returned sorted by MX priority.
     *
     * @param host - the domain name for which to find mail servers
     * @return a Collection of Strings of hostnames, sorted by priority
     */
    Collection getMailServers(String host);

This API wraps call to DNSServer:findMXRecords.


>
> > One general question. Do we ever need to do autoritative lookups for MX
> > record ? Wouldn't that slow up.
>
> I thought there was a conf option for whether to do authoritative lookups,
> no?

Yes it does and it seems good to have the config option.
The default is false and that is probably the better option. I am not
suggesting the config option should be removed but curious if folks ever
change the authoritative lookup setting.

Harmeet


--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message