You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2004/03/03 06:37:26 UTC
Need location for new class: o.a.javamail or o.a.mailet
Related to the general issue we discussed on general@ regarding
org.apache.javamail, I have a new class, HostAddress, that I was planning to
commit in the Mailet API as part of the merger. It replaces the
SMTPHostAddresses interface that Richard and Soren introduced to handle the
multiple A record situation.
HostAddress is precisely a subclass of javax.mail.URLName with one
additional behavior: you can query the host name provided on the
constructor. Test code for the class looks like:
url = new HostAddress(<host name>, "smtp://" + <IP-address> + ":25");
System.out.println("Hostname: " + url.getHostName());
System.out.println("The protocol is: " + url.getProtocol());
System.out.println("The host is: " + url.getHost());
System.out.println("The port is: " + url.getPort());
System.out.println("The user is: " + url.getUsername());
System.out.println("The password is: " + url.getPassword());
System.out.println("The file is: " + url.getFile());
System.out.println("The ref is: " + url.getRef());
Instances of HostAddress are provided by the DNS service. This allows us to
have an interface like:
Iterator getSMTPHostAddresses(String domainName);
where the Iterator is over HostAddress instances, and we can simply iterate
along, using the HostAddress as a URLName with JavaMail.
So ... do I create src/java/org/apache/javamail and start populating it, or
do I leave HostAddress in org.apache.mailet?
Assuming no one objects to the class in the first place.
--- Noel
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org