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 pg...@apache.org on 2002/08/19 20:57:08 UTC

cvs commit: jakarta-james/src/java/org/apache/mailet GenericMailet.java GenericMatcher.java GenericRecipientMatcher.java MailAddress.java

pgoldstein    2002/08/19 11:57:08

  Modified:    src/java/org/apache/james BaseConnectionHandler.java
                        James.java JamesMBean.java
               src/java/org/apache/james/core MimeMessageWrapper.java
               src/java/org/apache/james/nntpserver
                        DateSinceFileFilter.java LISTGroup.java
                        NNTPException.java
               src/java/org/apache/james/transport/mailets AddFooter.java
                        AvalonListserv.java AvalonListservManager.java
                        Forward.java JDBCAlias.java JDBCListserv.java
                        LocalDelivery.java NotifyPostmaster.java
                        NotifySender.java Null.java PostmasterAlias.java
                        Redirect.java ServerTime.java ToProcessor.java
                        ToRepository.java UseHeaderRecipients.java
               src/java/org/apache/james/transport/mailets/debug
                        Counter.java DumpSystemErr.java
                        ExceptionThrowingMailet.java Identity.java
               src/java/org/apache/james/userrepository
                        AbstractJdbcUsersRepository.java DefaultUser.java
                        DefaultUsersJdbcRepository.java
                        JamesUsersJdbcRepository.java
                        ListUsersJdbcRepository.java
               src/java/org/apache/mailet GenericMailet.java
                        GenericMatcher.java GenericRecipientMatcher.java
                        MailAddress.java
  Log:
  More comments, fixed a tab
  
  Revision  Changes    Path
  1.10      +10 -0     jakarta-james/src/java/org/apache/james/BaseConnectionHandler.java
  
  Index: BaseConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/BaseConnectionHandler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BaseConnectionHandler.java	18 Aug 2002 07:32:38 -0000	1.9
  +++ BaseConnectionHandler.java	19 Aug 2002 18:57:07 -0000	1.10
  @@ -24,7 +24,15 @@
    * @author Harmeet Bedi <ha...@kodemuse.com>
    */
   public class BaseConnectionHandler extends AbstractLogEnabled implements Configurable {
  +
  +    /**
  +     * The timeout for the connection
  +     */
       protected int timeout;
  +
  +    /**
  +     * The hello name for the connection
  +     */
       protected String helloName;
   
       /**
  @@ -55,6 +63,8 @@
   
       /**
        * Release a previously created ConnectionHandler e.g. for spooling.
  +     *
  +     * @param connectionHandler the ConnectionHandler to be released
        */
       public void releaseConnectionHandler(ConnectionHandler connectionHandler) {
       }
  
  
  
  1.27      +116 -3    jakarta-james/src/java/org/apache/james/James.java
  
  Index: James.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/James.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- James.java	18 Aug 2002 07:32:38 -0000	1.26
  +++ James.java	19 Aug 2002 18:57:07 -0000	1.27
  @@ -98,7 +98,12 @@
        * thread safety and to ensure that all threads see the latest value.
        */
       private static long count;
  +
  +    /**
  +     * The address of the postmaster for this server
  +     */
       private MailAddress postmaster;
  +
       private Map mailboxes; //Not to be shared!
   
       /**
  @@ -267,6 +272,14 @@
           getLogger().info("JAMES ...init end");
       }
   
  +    /**
  +     * Place a mail on the spool for processing
  +     *
  +     * @param message the message to send
  +     *
  +     * @throws MessagingException if an exception is caught while placing the mail
  +     *                            on the spool
  +     */
       public void sendMail(MimeMessage message) throws MessagingException {
           MailAddress sender = new MailAddress((InternetAddress)message.getFrom()[0]);
           Collection recipients = new HashSet();
  @@ -277,11 +290,32 @@
           sendMail(sender, recipients, message);
       }
   
  +    /**
  +     * Place a mail on the spool for processing
  +     *
  +     * @param sender the sender of the mail
  +     * @param recipients the recipients of the mail
  +     * @param message the message to send
  +     *
  +     * @throws MessagingException if an exception is caught while placing the mail
  +     *                            on the spool
  +     */
       public void sendMail(MailAddress sender, Collection recipients, MimeMessage message)
               throws MessagingException {
           sendMail(sender, recipients, message, Mail.DEFAULT);
       }
   
  +    /**
  +     * Place a mail on the spool for processing
  +     *
  +     * @param sender the sender of the mail
  +     * @param recipients the recipients of the mail
  +     * @param message the message to send
  +     * @param state the state of the message
  +     *
  +     * @throws MessagingException if an exception is caught while placing the mail
  +     *                            on the spool
  +     */
       public void sendMail(MailAddress sender, Collection recipients, MimeMessage message, String state)
               throws MessagingException {
           MailImpl mail = new MailImpl(getId(), sender, recipients, message);
  @@ -289,6 +323,16 @@
           sendMail(mail);
       }
   
  +    /**
  +     * Place a mail on the spool for processing
  +     *
  +     * @param sender the sender of the mail
  +     * @param recipients the recipients of the mail
  +     * @param msg an <code>InputStream</code> containing the message
  +     *
  +     * @throws MessagingException if an exception is caught while placing the mail
  +     *                            on the spool
  +     */
       public void sendMail(MailAddress sender, Collection recipients, InputStream msg)
               throws MessagingException {
           // parse headers
  @@ -302,6 +346,14 @@
           sendMail(new MailImpl(getId(), sender, recipients, new SequenceInputStream(headersIn, msg)));
       }
   
  +    /**
  +     * Place a mail on the spool for processing
  +     *
  +     * @param mail the mail to place on the spool
  +     *
  +     * @throws MessagingException if an exception is caught while placing the mail
  +     *                            on the spool
  +     */
       public void sendMail(Mail mail) throws MessagingException {
           MailImpl mailimpl = (MailImpl)mail;
           try {
  @@ -324,7 +376,13 @@
       }
   
       /**
  -     * For POP3 server only - at the momment.
  +     * <p>Retrieve the mail repository for a user</p>
  +     *
  +     * <p>For POP3 server only - at the moment.</p>
  +     *
  +     * @param userName the name of the user whose inbox is to be retrieved
  +     *
  +     * @return the POP3 inbox for the user
        */
       public synchronized MailRepository getUserInbox(String userName) {
           MailRepository userInbox = (MailRepository) null;
  @@ -365,6 +423,11 @@
           }
       }
   
  +    /**
  +     * Return a new mail id.
  +     *
  +     * @return a new mail id
  +     */
       public String getId() {
           long localCount = -1;
           synchronized (James.class) {
  @@ -379,6 +442,12 @@
           return idBuffer.toString();
       }
   
  +    /**
  +     * The main method.  Should never be invoked, as James must be called
  +     * from within an Avalon framework container.
  +     *
  +     * @param args the command line arguments
  +     */
       public static void main(String[] args) {
           System.out.println("ERROR!");
           System.out.println("Cannot execute James as a stand alone application.");
  @@ -479,6 +548,10 @@
   
       /**
        * Returns whether that account has a local inbox on this server
  +     *
  +     * @param name the name to be checked
  +     *
  +     * @return whether the account has a local inbox
        */
       public boolean isLocalUser(String name) {
           if (ignoreCase) {
  @@ -490,6 +563,8 @@
   
       /**
        * Returns the address of the postmaster for this server.
  +     *
  +     * @return the <code>MailAddress</code> for the postmaster
        */
       public MailAddress getPostmaster() {
           return postmaster;
  @@ -542,22 +617,49 @@
           getUserInbox(username).store(mailImpl);
       }
   
  +    /**
  +     * Return the major version number for the server
  +     *
  +     * @return the major vesion number for the server
  +     */
       public int getMajorVersion() {
           return 2;
       }
   
  +    /**
  +     * Return the minor version number for the server
  +     *
  +     * @return the minor vesion number for the server
  +     */
       public int getMinorVersion() {
           return 1;
       }
   
  +    /**
  +     * Check whether the mail domain in question is to be 
  +     * handled by this server.
  +     *
  +     * @param serverName the name of the server to check
  +     * @return whether the server is local
  +     */
       public boolean isLocalServer( final String serverName ) {
           return serverNames.contains(serverName.toLowerCase(Locale.US));
       }
   
  +    /**
  +     * Return the type of the server
  +     *
  +     * @return the type of the server
  +     */
       public String getServerInfo() {
           return "Apache Jakarta JAMES";
       }
   
  +    /**
  +     * Return the logger for the Mailet API
  +     *
  +     * @return the logger for the Mailet API
  +     */
       private Logger getMailetLogger() {
           if (mailetLogger == null) {
               mailetLogger = getLogger().getChildLogger("Mailet");
  @@ -565,10 +667,21 @@
           return mailetLogger;
       }
   
  +    /**
  +     * Log a message to the Mailet logger
  +     *
  +     * @param message the message to pass to the Mailet logger
  +     */
       public void log(String message) {
           getMailetLogger().info(message);
       }
   
  +    /**
  +     * Log a message and a Throwable to the Mailet logger
  +     *
  +     * @param message the message to pass to the Mailet logger
  +     * @param t the <code>Throwable</code> to be logged
  +     */
       public void log(String message, Throwable t) {
           //System.err.println(message);
           //t.printStackTrace(); //DEBUG
  
  
  
  1.2       +11 -1     jakarta-james/src/java/org/apache/james/JamesMBean.java
  
  Index: JamesMBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/JamesMBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JamesMBean.java	15 Aug 2002 07:07:21 -0000	1.1
  +++ JamesMBean.java	19 Aug 2002 18:57:07 -0000	1.2
  @@ -7,7 +7,17 @@
    */
   package org.apache.james;
   
  +/**
  + * An interface to expose James management functionality through JMX.  At
  + * the time of this writing, this interface is just an example.
  + */
   public interface JamesMBean {
   
  -	boolean addUser(String userName, String password);
  +    /**
  +     * Adds a user to this mail server.
  +     *
  +     * @param userName the name of the user being added
  +     * @param password the password of the user being added
  +     */
  +    boolean addUser(String userName, String password);
   }
  
  
  
  1.13      +8 -2      jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java
  
  Index: MimeMessageWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MimeMessageWrapper.java	17 Aug 2002 18:16:24 -0000	1.12
  +++ MimeMessageWrapper.java	19 Aug 2002 18:57:07 -0000	1.13
  @@ -67,7 +67,10 @@
       }
   
       /**
  -     * Instantiate the headers
  +     * Load the message headers from the internal source.
  +     *
  +     * @throws MessagingException if an error is encountered while 
  +     *                            loading the headers
        */
       private synchronized void loadHeaders() throws MessagingException {
           if (headers != null) {
  @@ -85,7 +88,10 @@
       }
   
       /**
  -     * Internal implementations
  +     * Load the complete MimeMessage from the internal source.
  +     *
  +     * @throws MessagingException if an error is encountered while 
  +     *                            loading the message
        */
       private synchronized void loadMessage() throws MessagingException {
           if (message != null) {
  
  
  
  1.2       +23 -3     jakarta-james/src/java/org/apache/james/nntpserver/DateSinceFileFilter.java
  
  Index: DateSinceFileFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/nntpserver/DateSinceFileFilter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DateSinceFileFilter.java	15 May 2001 14:41:32 -0000	1.1
  +++ DateSinceFileFilter.java	19 Aug 2002 18:57:07 -0000	1.2
  @@ -11,21 +11,41 @@
   import java.io.FilenameFilter;
   
   /**
  - * filters files according to their date of last modification
  + * Filters files according to their last modified date
    *
    * @author  Harmeet Bedi <ha...@kodemuse.com>
    */
   public class DateSinceFileFilter implements FilenameFilter
   {
  +    /**
  +     * The date that serves as the lower bound of the region of 
  +     * interest
  +     */
       private final long m_date;
   
  +    /**
  +     * Creates a new FileFilter that returns all Files that
  +     * have been modified since the date specified.
  +     *
  +     * @param date the date that serves as the lower bound of the region of 
  +     * interest
  +     */
       public DateSinceFileFilter( long date ) 
       {
           m_date = date;
       }
   
  -    public boolean accept( final File file, final String name ) 
  +    /**
  +     * Tests if a specified file has been modified since a
  +     * specified date.
  +     *
  +     * @param dir the directory in which the file was found
  +     * @param name the name of the file
  +     *
  +     * @return true if the file meets the criteria, false otherwise
  +     */
  +    public boolean accept( final File dir, final String name ) 
       {
  -        return (new File(file,name).lastModified() >= m_date);
  +        return (new File(dir,name).lastModified() >= m_date);
       }
   }
  
  
  
  1.6       +4 -0      jakarta-james/src/java/org/apache/james/nntpserver/LISTGroup.java
  
  Index: LISTGroup.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/nntpserver/LISTGroup.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LISTGroup.java	18 Aug 2002 07:30:17 -0000	1.5
  +++ LISTGroup.java	19 Aug 2002 18:57:07 -0000	1.6
  @@ -22,7 +22,11 @@
   
       void show(NNTPGroup group);
   
  +    /**
  +     * An inner class used as a LISTGroup factory class.
  +     */
       class Factory {
  +
           static LISTGroup ACTIVE(final PrintWriter prt) {
               return new LISTGroup() {
                       public void show(NNTPGroup group) {
  
  
  
  1.3       +26 -0     jakarta-james/src/java/org/apache/james/nntpserver/NNTPException.java
  
  Index: NNTPException.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/nntpserver/NNTPException.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- NNTPException.java	10 Nov 2001 23:09:27 -0000	1.2
  +++ NNTPException.java	19 Aug 2002 18:57:07 -0000	1.3
  @@ -16,15 +16,41 @@
    * @author  Harmeet Bedi <ha...@kodemuse.com>
    */
   public class NNTPException extends RuntimeException {
  +
  +    /**
  +     * The encapsulated Throwable
  +     */
       private final Throwable t;
  +
  +    /**
  +     * Create an NNTPException with an error message and no
  +     * encapsulated <code>Throwable</code>
  +     *
  +     * @param msg the error message for this exception
  +     */
       public NNTPException(String msg) {
           super(msg);
           this.t = null;
       }
  +
  +    /**
  +     * Create an NNTPException with an error message and an
  +     * encapsulated <code>Throwable</code>
  +     *
  +     * @param msg the error message for this exception
  +     * @param t the encapsulated <code>Throwable</code>
  +     */
       public NNTPException(String msg,Throwable t) {
           super(msg+((t!=null)?": "+t.toString():""));
           this.t = t;
       }
  +
  +    /**
  +     * Create an NNTPException with an
  +     * encapsulated <code>Throwable</code>
  +     *
  +     * @param t the encapsulated <code>Throwable</code>
  +     */
       public NNTPException(Throwable t) {
           super(t.toString());
           this.t = t;
  
  
  
  1.4       +43 -1     jakarta-james/src/java/org/apache/james/transport/mailets/AddFooter.java
  
  Index: AddFooter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AddFooter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AddFooter.java	18 Jan 2002 02:48:37 -0000	1.3
  +++ AddFooter.java	19 Aug 2002 18:57:07 -0000	1.4
  @@ -24,9 +24,14 @@
    */
   public class AddFooter extends GenericMailet {
   
  -    //This is the plain text version of the footer we are going to add
  +    /**
  +     * This is the plain text version of the footer we are going to add
  +     */
       String text = "";
   
  +    /**
  +     * Initialize the mailet
  +     */
       public void init() throws MessagingException {
           text = getInitParameter("text");
       }
  @@ -35,6 +40,10 @@
        * Takes the message and attaches a footer message to it.  Right now, it only
        * supports simple messages.  Needs to have additions to make it support
        * messages with alternate content types or with attachments.
  +     *
  +     * @param mail the mail being processed
  +     *
  +     * @throws MessagingException if an error arises during message processing
        */
       public void service(Mail mail) throws MessagingException {
           try {
  @@ -71,6 +80,8 @@
       /**
        * This is exposed as a method for easy subclassing to provide alternate ways
        * to get the footer text.
  +     *
  +     * @return the footer text
        */
       public String getFooterText() {
           return text;
  @@ -80,6 +91,8 @@
        * This is exposed as a method for easy subclassing to provide alternate ways
        * to get the footer text.  By default, this will take the footer text,
        * converting the linefeeds to &lt;br&gt; tags.
  +     *
  +     * @return the HTML version of the footer text
        */
       public String getFooterHTML() {
           String text = getFooterText();
  @@ -99,10 +112,23 @@
           return sb.toString();
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "AddFooter Mailet";
       }
   
  +    /**
  +     * Prepends the content of the MimePart as text to the existing footer
  +     *
  +     * @param part the MimePart to attach
  +     *
  +     * @throws MessagingException 
  +     * @throws IOException
  +     */
       protected void addToText(MimePart part) throws MessagingException, IOException {
           String content = part.getContent().toString();
           if (!content.endsWith("\n")) {
  @@ -112,12 +138,28 @@
           part.setText(content);
       }
   
  +    /**
  +     * Prepends the content of the MimePart as HTML to the existing footer
  +     *
  +     * @param part the MimePart to attach
  +     *
  +     * @throws MessagingException 
  +     * @throws IOException
  +     */
       protected void addToHTML(MimePart part) throws MessagingException, IOException {
           String content = part.getContent().toString();
           content += "<br>" + getFooterHTML();
           part.setContent(content, part.getContentType());
       }
   
  +    /**
  +     * Attaches a MimePart as an appropriate footer
  +     *
  +     * @param part the MimePart to attach
  +     *
  +     * @throws MessagingException 
  +     * @throws IOException
  +     */
       protected void attachFooter(MimePart part) throws MessagingException, IOException {
           if (part.isMimeType("text/plain")) {
               addToText(part);
  
  
  
  1.4       +7 -2      jakarta-james/src/java/org/apache/james/transport/mailets/AvalonListserv.java
  
  Index: AvalonListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AvalonListserv.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AvalonListserv.java	18 Jan 2002 02:48:37 -0000	1.3
  +++ AvalonListserv.java	19 Aug 2002 18:57:07 -0000	1.4
  @@ -93,6 +93,11 @@
           return subjectPrefix;
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "AvalonListserv Mailet";
       }
  
  
  
  1.4       +21 -2     jakarta-james/src/java/org/apache/james/transport/mailets/AvalonListservManager.java
  
  Index: AvalonListservManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/AvalonListservManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AvalonListservManager.java	18 Jan 2002 02:48:38 -0000	1.3
  +++ AvalonListservManager.java	19 Aug 2002 18:57:07 -0000	1.4
  @@ -44,11 +44,25 @@
           }
       }
   
  +    /**
  +     * Add an address to the list.
  +     *
  +     * @param address the address to add
  +     *
  +     * @return true if successful, false otherwise
  +     */
       public boolean addAddress(MailAddress address) {
           members.addUser(address.toString(), "");
           return true;
       }
   
  +    /**
  +     * Remove an address from the list.
  +     *
  +     * @param address the address to remove
  +     *
  +     * @return true if successful, false otherwise
  +     */
       public boolean removeAddress(MailAddress address) {
           members.removeUser(address.toString());
           return true;
  @@ -58,6 +72,11 @@
           return members.contains(address.toString());
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "AvalonListservManager Mailet";
       }
  
  
  
  1.5       +12 -0     jakarta-james/src/java/org/apache/james/transport/mailets/Forward.java
  
  Index: Forward.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/Forward.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Forward.java	18 Aug 2002 08:55:33 -0000	1.4
  +++ Forward.java	19 Aug 2002 18:57:07 -0000	1.5
  @@ -34,6 +34,13 @@
           }
       }
   
  +    /**
  +     * Forwards a mail to a particular recipient.
  +     *
  +     * @param mail the mail being processed
  +     *
  +     * @throws MessagingException if an error occurs while forwarding the mail
  +     */
       public void service(Mail mail) throws MessagingException {
          if (mail.getSender() == null || getMailetContext().getMailServers(mail.getSender().getHost()).size() != 0) {
              // If we do not do this check, and somone uses Forward in a
  @@ -59,6 +66,11 @@
          }
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "Forward Mailet";
       }
  
  
  
  1.9       +5 -0      jakarta-james/src/java/org/apache/james/transport/mailets/JDBCAlias.java
  
  Index: JDBCAlias.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/JDBCAlias.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JDBCAlias.java	12 Aug 2002 07:41:36 -0000	1.8
  +++ JDBCAlias.java	19 Aug 2002 18:57:07 -0000	1.9
  @@ -170,6 +170,11 @@
           recipients.addAll(recipientsToAdd);
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "JDBC aliasing mailet";
       }
  
  
  
  1.9       +16 -1     jakarta-james/src/java/org/apache/james/transport/mailets/JDBCListserv.java
  
  Index: JDBCListserv.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/JDBCListserv.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JDBCListserv.java	12 Aug 2002 18:36:53 -0000	1.8
  +++ JDBCListserv.java	19 Aug 2002 18:57:07 -0000	1.9
  @@ -60,7 +60,9 @@
       protected String listservQuery = null;
       protected String membersQuery = null;
   
  -    // The JDBCUtil helper class
  +    /**
  +     * The JDBCUtil helper class
  +     */
       private final JDBCUtil theJDBCUtil =
               new JDBCUtil() {
                   protected void delegatedLog(String logString) {
  @@ -186,6 +188,8 @@
   
       /**
        * Returns whether listserv should add reply-to header
  +     *
  +     * @return whether listserv should add a reply-to header
        */
       public boolean isReplyToList() throws MessagingException {
           return replyToList;
  @@ -207,6 +211,12 @@
           return subjectPrefix;
       }
   
  +    /**
  +     * Loads the configuration settings for this mailet from the database.
  +     *
  +     * @throws MessagingException if a problem occurs while accessing the database or
  +     *                            the required parameters are not present
  +     */
       protected void loadSettings() throws MessagingException {
           Connection conn = null;
           PreparedStatement stmt = null;
  @@ -292,6 +302,11 @@
           }
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "JDBC listserv mailet";
       }
  
  
  
  1.5       +12 -0     jakarta-james/src/java/org/apache/james/transport/mailets/LocalDelivery.java
  
  Index: LocalDelivery.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/LocalDelivery.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LocalDelivery.java	9 Aug 2002 06:04:22 -0000	1.4
  +++ LocalDelivery.java	19 Aug 2002 18:57:07 -0000	1.5
  @@ -25,6 +25,13 @@
    */
   public class LocalDelivery extends GenericMailet {
   
  +    /**
  +     * Delivers a mail to a local mailbox.
  +     *
  +     * @param mail the mail being processed
  +     *
  +     * @throws MessagingException if an error occurs while storing the mail
  +     */
       public void service(Mail mail) throws MessagingException {
           Collection recipients = mail.getRecipients();
           Collection errors = new Vector();
  @@ -48,6 +55,11 @@
           mail.setState(Mail.GHOST);
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "Local Delivery Mailet";
       }
  
  
  
  1.6       +31 -1     jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPostmaster.java
  
  Index: NotifyPostmaster.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/NotifyPostmaster.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NotifyPostmaster.java	28 Jul 2002 11:46:41 -0000	1.5
  +++ NotifyPostmaster.java	19 Aug 2002 18:57:07 -0000	1.6
  @@ -46,12 +46,33 @@
    * @author  Danny Angus <da...@thought.co.uk>
    */
   public class NotifyPostmaster extends GenericMailet {
  +
  +    /**
  +     * The sender address for the reply message
  +     */
       MailAddress notifier = null;
  +
  +    /**
  +     * Whether exception stack traces should be attached to the error
  +     * messages
  +     */
       boolean attachStackTrace = false;
  +
  +    /**
  +     * The text of the reply notice
  +     */
       String noticeText = null;
   
  +    /**
  +     * The date format object used to generate RFC 822 compliant date headers
  +     */
       private RFC822DateFormat rfc822DateFormat = new RFC822DateFormat();
   
  +    /**
  +     * Initialize the mailet, loading all configuration parameters.
  +     *
  +     * @throws MessagingException
  +     */
       public void init() throws MessagingException {
           if (getInitParameter("sendingAddress") == null) {
               notifier = getMailetContext().getPostmaster();
  @@ -70,7 +91,11 @@
       }
   
       /**
  -     * Sends a message back to the sender indicating what time the server thinks it is.
  +     * Sends a message to the postmaster with the original message as to why it failed.
  +     *
  +     * @param mail the mail being processed
  +     *
  +     * @throws MessagingException if an error occurs while formulating the message to the sender
        */
       public void service(Mail mail) throws MessagingException {
           MimeMessage message = mail.getMessage();
  @@ -195,6 +220,11 @@
           getMailetContext().sendMail(notifier, recipients, reply);
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "NotifyPostmaster Mailet";
       }
  
  
  
  1.7       +30 -0     jakarta-james/src/java/org/apache/james/transport/mailets/NotifySender.java
  
  Index: NotifySender.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/NotifySender.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NotifySender.java	6 Aug 2002 02:26:16 -0000	1.6
  +++ NotifySender.java	19 Aug 2002 18:57:07 -0000	1.7
  @@ -45,12 +45,33 @@
    * @author  Danny Angus <da...@thought.co.uk>
    */
   public class NotifySender extends GenericMailet {
  +
  +    /**
  +     * The sender address for the reply message
  +     */
       MailAddress notifier = null;
  +
  +    /**
  +     * Whether exception stack traces should be attached to the error
  +     * messages
  +     */
       boolean attachStackTrace = false;
  +
  +    /**
  +     * The text of the reply notice
  +     */
       String noticeText = null;
   
  +    /**
  +     * The date format object used to generate RFC 822 compliant date headers
  +     */
       private RFC822DateFormat rfc822DateFormat = new RFC822DateFormat();
   
  +    /**
  +     * Initialize the mailet, loading all configuration parameters.
  +     *
  +     * @throws MessagingException
  +     */
       public void init() throws MessagingException {
           if (getInitParameter("sendingAddress") == null) {
               notifier = getMailetContext().getPostmaster();
  @@ -70,6 +91,10 @@
   
       /**
        * Sends a message back to the sender with the message as to why it failed.
  +     *
  +     * @param mail the mail being processed
  +     *
  +     * @throws MessagingException if an error occurs while formulating the message to the sender
        */
       public void service(Mail mail) throws MessagingException {
           MimeMessage message = mail.getMessage();
  @@ -180,6 +205,11 @@
           getMailetContext().sendMail(notifier, recipients, reply);
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "NotifySender Mailet";
       }
  
  
  
  1.5       +11 -0     jakarta-james/src/java/org/apache/james/transport/mailets/Null.java
  
  Index: Null.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/Null.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Null.java	17 Aug 2002 18:43:55 -0000	1.4
  +++ Null.java	19 Aug 2002 18:57:07 -0000	1.5
  @@ -17,10 +17,21 @@
    */
   public class Null extends GenericMailet {
   
  +    /**
  +     * Set this mail to GHOST state, indicating that no further processing 
  +     * should take place.
  +     *
  +     * @param mail the mail to process
  +     */
       public void service(Mail mail) {
           mail.setState(Mail.GHOST);
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "Null Mailet";
       }
  
  
  
  1.4       +13 -0     jakarta-james/src/java/org/apache/james/transport/mailets/PostmasterAlias.java
  
  Index: PostmasterAlias.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/PostmasterAlias.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PostmasterAlias.java	18 Jan 2002 02:48:38 -0000	1.3
  +++ PostmasterAlias.java	19 Aug 2002 18:57:07 -0000	1.4
  @@ -28,6 +28,14 @@
    */
   public class PostmasterAlias extends GenericMailet {
   
  +    /**
  +     * Make sure that a message that is addressed to a postmaster alias is always
  +     * sent to the postmaster address, regardless of delivery to other recipients.
  +     *
  +     * @param mail the mail to process
  +     *
  +     * @throws MessagingException if an error is encountered while modifying the message
  +     */
       public void service(Mail mail) throws MessagingException {
           Collection recipients = mail.getRecipients();
           Collection recipientsToRemove = null;
  @@ -54,6 +62,11 @@
           }
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "Postmaster aliasing mailet";
       }
  
  
  
  1.11      +2 -2      jakarta-james/src/java/org/apache/james/transport/mailets/Redirect.java
  
  Index: Redirect.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/Redirect.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Redirect.java	18 Aug 2002 19:19:32 -0000	1.10
  +++ Redirect.java	19 Aug 2002 18:57:07 -0000	1.11
  @@ -252,9 +252,9 @@
       }
   
       /**
  -     * Add Description
  +     * Return a string describing this mailet.
        *
  -     * @return Document return!
  +     * @return a string describing this mailet
        */
       public String getMailetInfo() {
           return "Resend Mailet";
  
  
  
  1.4       +9 -0      jakarta-james/src/java/org/apache/james/transport/mailets/ServerTime.java
  
  Index: ServerTime.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/ServerTime.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerTime.java	7 Aug 2002 23:26:38 -0000	1.3
  +++ ServerTime.java	19 Aug 2002 18:57:07 -0000	1.4
  @@ -27,6 +27,10 @@
   public class ServerTime extends GenericMailet {
       /**
        * Sends a message back to the sender indicating what time the server thinks it is.
  +     *
  +     * @param mail the mail being processed
  +     *
  +     * @throws MessagingException if an error is encountered while formulating the reply message
        */
       public void service(Mail mail) throws javax.mail.MessagingException {
           log("Sending timestamp");
  @@ -49,6 +53,11 @@
           getMailetContext().sendMail(sender, recipients, response);
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "ServerTime Mailet";
       }
  
  
  
  1.4       +12 -1     jakarta-james/src/java/org/apache/james/transport/mailets/ToProcessor.java
  
  Index: ToProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/ToProcessor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ToProcessor.java	7 Aug 2002 23:26:38 -0000	1.3
  +++ ToProcessor.java	19 Aug 2002 18:57:07 -0000	1.4
  @@ -38,6 +38,13 @@
           noticeText = getInitParameter("notice");
       }
   
  +    /**
  +     * Throw an exception if any mail is processed.
  +     *
  +     * @param mail the mail to process
  +     *
  +     * @throws MessagingException in all cases
  +     */
       public void service(Mail mail) throws MessagingException {
           StringBuffer logBuffer =
               new StringBuffer(128)
  @@ -61,7 +68,11 @@
           }
       }
   
  -
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "ToProcessor Mailet";
       }
  
  
  
  1.6       +27 -2     jakarta-james/src/java/org/apache/james/transport/mailets/ToRepository.java
  
  Index: ToRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/ToRepository.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ToRepository.java	7 Aug 2002 23:26:38 -0000	1.5
  +++ ToRepository.java	19 Aug 2002 18:57:07 -0000	1.6
  @@ -29,10 +29,25 @@
    */
   public class ToRepository extends GenericMailet {
   
  +    /**
  +     * The repository where this mailet stores mail.
  +     */
       private MailRepository repository;
  +
  +    /**
  +     * Whether this mailet should allow mails to be processed by additional mailets
  +     * or mark it as finished.
  +     */
       private boolean passThrough = false;
  +
  +    /**
  +     * The path to the repository
  +     */
       private String repositoryPath;
   
  +    /**
  +     * Initialize the mailet, loading configuration information.
  +     */
       public void init() {
           repositoryPath = getInitParameter("repositoryPath");
           try {
  @@ -56,6 +71,11 @@
   
       }
   
  +    /**
  +     * Store a mail in a particular repository.
  +     *
  +     * @param mail the mail to process
  +     */
       public void service(Mail genericmail) {
           MailImpl mail = (MailImpl)genericmail;
           StringBuffer logBuffer =
  @@ -71,6 +91,11 @@
           }
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "ToRepository Mailet";
       }
  
  
  
  1.4       +5 -0      jakarta-james/src/java/org/apache/james/transport/mailets/UseHeaderRecipients.java
  
  Index: UseHeaderRecipients.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/UseHeaderRecipients.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- UseHeaderRecipients.java	7 Aug 2002 23:26:38 -0000	1.3
  +++ UseHeaderRecipients.java	19 Aug 2002 18:57:07 -0000	1.4
  @@ -74,6 +74,11 @@
       }
   
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "UseHeaderRecipients Mailet";
       }
  
  
  
  1.3       +14 -1     jakarta-james/src/java/org/apache/james/transport/mailets/debug/Counter.java
  
  Index: Counter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/debug/Counter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Counter.java	18 Jan 2002 02:48:38 -0000	1.2
  +++ Counter.java	19 Aug 2002 18:57:08 -0000	1.3
  @@ -17,15 +17,28 @@
    * @author  Serge Knystautas <se...@lokitech.com>
    */
   public class Counter extends GenericMailet {
  +
  +    /**
  +     * The number of mails processed by this mailet
  +     */
       int counter = 0;
   
  +    /**
  +     * Count processed mails, marking each mail as completed after counting.
  +     *
  +     * @param mail the mail to process
  +     */
       public void service(Mail mail) {
  -        //Do nothing
           counter++;
           log(counter + "");
           mail.setState(Mail.GHOST);
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "Counter Mailet";
       }
  
  
  
  1.3       +12 -0     jakarta-james/src/java/org/apache/james/transport/mailets/debug/DumpSystemErr.java
  
  Index: DumpSystemErr.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/debug/DumpSystemErr.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DumpSystemErr.java	18 Jan 2002 02:48:38 -0000	1.2
  +++ DumpSystemErr.java	19 Aug 2002 18:57:08 -0000	1.3
  @@ -21,6 +21,13 @@
    */
   public class DumpSystemErr extends GenericMailet {
   
  +    /**
  +     * Writes the message to System.err .
  +     *
  +     * @param mail the mail to process
  +     *
  +     * @throws MessagingException if an error occurs while writing the message
  +     */
       public void service(Mail mail) throws MessagingException {
           try {
               MimeMessage message = mail.getMessage();
  @@ -30,6 +37,11 @@
           }
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "Dumps message to System.err";
       }
  
  
  
  1.3       +12 -0     jakarta-james/src/java/org/apache/james/transport/mailets/debug/ExceptionThrowingMailet.java
  
  Index: ExceptionThrowingMailet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/debug/ExceptionThrowingMailet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ExceptionThrowingMailet.java	18 Jan 2002 02:48:38 -0000	1.2
  +++ ExceptionThrowingMailet.java	19 Aug 2002 18:57:08 -0000	1.3
  @@ -20,10 +20,22 @@
    */
   public class ExceptionThrowingMailet extends GenericMailet {
   
  +    /**
  +     * Throw an exception if any mail is processed.
  +     *
  +     * @param mail the mail to process
  +     *
  +     * @throws MailetException in all cases
  +     */
       public void service(Mail mail) throws MessagingException {
           throw new MailetException("General protection fault");
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "ExceptionThrowingMailet Mailet";
       }
  
  
  
  1.3       +10 -0     jakarta-james/src/java/org/apache/james/transport/mailets/debug/Identity.java
  
  Index: Identity.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/mailets/debug/Identity.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Identity.java	18 Jan 2002 02:48:38 -0000	1.2
  +++ Identity.java	19 Aug 2002 18:57:08 -0000	1.3
  @@ -17,10 +17,20 @@
    */
   public class Identity extends GenericMailet {
   
  +    /**
  +     * Do nothing.
  +     *
  +     * @param mail the mail to be processed
  +     */
       public void service(Mail mail) {
           //Do nothing
       }
   
  +    /**
  +     * Return a string describing this mailet.
  +     *
  +     * @return a string describing this mailet
  +     */
       public String getMailetInfo() {
           return "Identity Mailet";
       }
  
  
  
  1.10      +20 -18    jakarta-james/src/java/org/apache/james/userrepository/AbstractJdbcUsersRepository.java
  
  Index: AbstractJdbcUsersRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/AbstractJdbcUsersRepository.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- AbstractJdbcUsersRepository.java	17 Aug 2002 18:33:28 -0000	1.9
  +++ AbstractJdbcUsersRepository.java	19 Aug 2002 18:57:08 -0000	1.10
  @@ -129,19 +129,21 @@
       }
   
       /**
  -     * Configures the UserRepository for JDBC access.
  -     * 
  -     * Requires a configuration element in the .conf.xml file of the form:
  -     * 
  -     *  <repository name="LocalUsers"
  -     *              class="org.apache.james.userrepository.JamesUsersJdbcRepository">
  -     *      <!-- Name of the datasource to use -->
  -     *      <data-source>MailDb</data-source>
  -     *      <!-- File to load the SQL definitions from -->
  -     *      <sqlFile>dist/conf/sqlResources.xml</sqlFile>
  -     *      <!-- replacement parameters for the sql file -->
  -     *      <sqlParameters table="JamesUsers"/>
  -     *  </repository>
  +     * Configures the UserRepository for JDBC access.<br>
  +     * <br>
  +     * Requires a configuration element in the .conf.xml file of the form:<br>
  +     * <br>
  +     * <pre>
  +     *  &lt;repository name="LocalUsers"
  +     *      class="org.apache.james.userrepository.JamesUsersJdbcRepository"&gt;
  +     *      &lt;!-- Name of the datasource to use --&gt;
  +     *      &lt;data-source&gt;MailDb&lt;/data-source&gt;
  +     *      &lt;!-- File to load the SQL definitions from -->
  +     *      &lt;sqlFile>dist/conf/sqlResources.xml&lt;/sqlFile&gt;
  +     *      &lt;!-- replacement parameters for the sql file --&gt;
  +     *      &lt;sqlParameters table="JamesUsers"/&gt;
  +     *  &lt;/repository&gt;
  +     * </pre>
        */
       public void configure(Configuration configuration) throws ConfigurationException 
       {
  @@ -217,12 +219,12 @@
       }
   
       /**
  -     * Initialises the JDBC repository.
  -     * 1) Tests the connection to the database.
  -     * 2) Loads SQL strings from the SQL definition file,
  +     * <p>Initialises the JDBC repository.</p>
  +     * <p>1) Tests the connection to the database.</p>
  +     * <p>2) Loads SQL strings from the SQL definition file,
        *     choosing the appropriate SQL for this connection, 
  -     *     and performing paramter substitution,
  -     * 3) Initialises the database with the required tables, if necessary.
  +     *     and performing parameter substitution,</p>
  +     * <p>3) Initialises the database with the required tables, if necessary.</p>
        * 
        * @throws Exception if an error occurs
        */
  
  
  
  1.5       +5 -2      jakarta-james/src/java/org/apache/james/userrepository/DefaultUser.java
  
  Index: DefaultUser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/DefaultUser.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultUser.java	7 Aug 2002 23:24:27 -0000	1.4
  +++ DefaultUser.java	19 Aug 2002 18:57:08 -0000	1.5
  @@ -33,6 +33,7 @@
        * Standard constructor.
        *
        * @param name the String name of this user
  +     * @param hashAlg the algorithm used to generate the hash of the password
        */
       public DefaultUser(String name, String hashAlg) {
           userName = name;
  @@ -106,6 +107,8 @@
   
       /**
        * Method to access the hashing algorithm of the password.
  +     *
  +     * @return the name of the hashing algorithm used for this user's password
        */
       protected String getHashAlgorithm() {
           return algorithm;
  
  
  
  1.3       +28 -0     jakarta-james/src/java/org/apache/james/userrepository/DefaultUsersJdbcRepository.java
  
  Index: DefaultUsersJdbcRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/DefaultUsersJdbcRepository.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultUsersJdbcRepository.java	18 Jan 2002 02:48:39 -0000	1.2
  +++ DefaultUsersJdbcRepository.java	19 Aug 2002 18:57:08 -0000	1.3
  @@ -25,6 +25,14 @@
    */
   public class DefaultUsersJdbcRepository extends AbstractJdbcUsersRepository
   {
  +    /**
  +     * Reads properties for a User from an open ResultSet.
  +     * 
  +     * @param rsUsers A ResultSet with a User record in the current row.
  +     * @return A User instance
  +     * @throws SQLException
  +     *                   if an exception occurs reading from the ResultSet
  +     */
       protected User readUserFromResultSet(ResultSet rsUsers) throws SQLException 
       {
           // Get the username, and build a DefaultUser with it.
  @@ -35,6 +43,16 @@
           return user;
       }
   
  +    /**
  +     * Set parameters of a PreparedStatement object with 
  +     * property values from a User instance.
  +     * 
  +     * @param user       a User instance, which should be an implementation class which
  +     *                   is handled by this Repostory implementation.
  +     * @param userInsert a PreparedStatement initialised with SQL taken from the "insert" SQL definition.
  +     * @throws SQLException
  +     *                   if an exception occurs while setting parameter values.
  +     */
       protected void setUserForInsertStatement(User user, 
                                                PreparedStatement userInsert) 
           throws SQLException 
  @@ -45,6 +63,16 @@
           userInsert.setString(3, defUser.getHashedPassword());
       }
   
  +    /**
  +     * Set parameters of a PreparedStatement object with
  +     * property values from a User instance.
  +     * 
  +     * @param user       a User instance, which should be an implementation class which
  +     *                   is handled by this Repostory implementation.
  +     * @param userUpdate a PreparedStatement initialised with SQL taken from the "update" SQL definition.
  +     * @throws SQLException
  +     *                   if an exception occurs while setting parameter values.
  +     */
       protected void setUserForUpdateStatement(User user, 
                                                PreparedStatement userUpdate) 
           throws SQLException 
  
  
  
  1.5       +28 -0     jakarta-james/src/java/org/apache/james/userrepository/JamesUsersJdbcRepository.java
  
  Index: JamesUsersJdbcRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/JamesUsersJdbcRepository.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JamesUsersJdbcRepository.java	17 Aug 2002 18:33:28 -0000	1.4
  +++ JamesUsersJdbcRepository.java	19 Aug 2002 18:57:08 -0000	1.5
  @@ -22,6 +22,14 @@
    */
   public class JamesUsersJdbcRepository extends AbstractJdbcUsersRepository
   {
  +    /**
  +     * Reads properties for a User from an open ResultSet.
  +     * 
  +     * @param rsUsers A ResultSet with a User record in the current row.
  +     * @return A User instance
  +     * @throws SQLException
  +     *                   if an exception occurs reading from the ResultSet
  +     */
       protected User readUserFromResultSet(ResultSet rsUsers) throws SQLException 
       {
           // Get the column values
  @@ -60,12 +68,32 @@
           return user;
       }
   
  +    /**
  +     * Set parameters of a PreparedStatement object with 
  +     * property values from a User instance.
  +     * 
  +     * @param user       a User instance, which should be an implementation class which
  +     *                   is handled by this Repostory implementation.
  +     * @param userInsert a PreparedStatement initialised with SQL taken from the "insert" SQL definition.
  +     * @throws SQLException
  +     *                   if an exception occurs while setting parameter values.
  +     */
       protected void setUserForInsertStatement(User user, 
                                                PreparedStatement userInsert) 
           throws SQLException {
           setUserForStatement(user, userInsert, false);
       }
   
  +    /**
  +     * Set parameters of a PreparedStatement object with
  +     * property values from a User instance.
  +     * 
  +     * @param user       a User instance, which should be an implementation class which
  +     *                   is handled by this Repostory implementation.
  +     * @param userUpdate a PreparedStatement initialised with SQL taken from the "update" SQL definition.
  +     * @throws SQLException
  +     *                   if an exception occurs while setting parameter values.
  +     */
       protected void setUserForUpdateStatement(User user, 
                                                PreparedStatement userUpdate) 
           throws SQLException {
  
  
  
  1.4       +27 -0     jakarta-james/src/java/org/apache/james/userrepository/ListUsersJdbcRepository.java
  
  Index: ListUsersJdbcRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/ListUsersJdbcRepository.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ListUsersJdbcRepository.java	17 Aug 2002 18:33:28 -0000	1.3
  +++ ListUsersJdbcRepository.java	19 Aug 2002 18:57:08 -0000	1.4
  @@ -22,6 +22,14 @@
    */
   public class ListUsersJdbcRepository extends AbstractJdbcUsersRepository
   {
  +    /**
  +     * Reads properties for a User from an open ResultSet.
  +     * 
  +     * @param rsUsers A ResultSet with a User record in the current row.
  +     * @return A User instance
  +     * @throws SQLException
  +     *                   if an exception occurs reading from the ResultSet
  +     */
       protected User readUserFromResultSet(ResultSet rsUsers) throws SQLException {
           // Get the username, and build a DefaultUser with it.
           String username = rsUsers.getString(1);
  @@ -29,12 +37,31 @@
           return user;
       }
   
  +    /**
  +     * Set parameters of a PreparedStatement object with 
  +     * property values from a User instance.
  +     * @param user       a User instance, which should be an implementation class which
  +     *                   is handled by this Repostory implementation.
  +     * @param userInsert a PreparedStatement initialised with SQL taken from the "insert" SQL definition.
  +     * @throws SQLException
  +     *                   if an exception occurs while setting parameter values.
  +     */
       protected void setUserForInsertStatement(User user, 
                                                PreparedStatement userInsert) 
           throws SQLException {
           userInsert.setString(1, user.getUserName());
       }
   
  +    /**
  +     * Set parameters of a PreparedStatement object with
  +     * property values from a User instance.
  +     * 
  +     * @param user       a User instance, which should be an implementation class which
  +     *                   is handled by this Repostory implementation.
  +     * @param userUpdate a PreparedStatement initialised with SQL taken from the "update" SQL definition.
  +     * @throws SQLException
  +     *                   if an exception occurs while setting parameter values.
  +     */
       protected void setUserForUpdateStatement(User user, 
                                                PreparedStatement userUpdate) 
           throws SQLException {
  
  
  
  1.4       +9 -9      jakarta-james/src/java/org/apache/mailet/GenericMailet.java
  
  Index: GenericMailet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/mailet/GenericMailet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GenericMailet.java	7 Aug 2002 23:21:33 -0000	1.3
  +++ GenericMailet.java	19 Aug 2002 18:57:08 -0000	1.4
  @@ -106,12 +106,12 @@
   
   
       /**
  -     * Called by the mailet container to indicate to a mailet that the
  -     * mailet is being placed into service.
  +     * <p>Called by the mailet container to indicate to a mailet that the
  +     * mailet is being placed into service.</p>
        *
  -     * This implementation stores the MailetConfig object it receives from
  +     * <p>This implementation stores the MailetConfig object it receives from
        * the mailet container for alter use. When overriding this form of the
  -     * method, call super.init(config).
  +     * method, call super.init(config).</p>
        *
        * @param MailetConfig config - the MailetConfig object that contains
        *          configutation information for this mailet
  @@ -124,8 +124,8 @@
       }
   
       /**
  -     * A convenience method which can be overridden so that there's no
  -     * need to call super.init(config).
  +     * <p>A convenience method which can be overridden so that there's no
  +     * need to call super.init(config).</p>
        *
        * Instead of overriding init(MailetConfig), simply override this
        * method and it will be called by GenericMailet.init(MailetConfig config).
  @@ -170,10 +170,10 @@
       }
   
       /**
  -     * Called by the mailet container to allow the mailet to process a
  -     * message.
  +     * <p>Called by the mailet container to allow the mailet to process a
  +     * message.</p>
        *
  -     * This method is declared abstract so subclasses must override it.
  +     * <p>This method is declared abstract so subclasses must override it.</p>
        *
        * @param mail - the Mail object that contains the MimeMessage and
        *          routing information
  
  
  
  1.4       +22 -22    jakarta-james/src/java/org/apache/mailet/GenericMatcher.java
  
  Index: GenericMatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/mailet/GenericMatcher.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GenericMatcher.java	7 Aug 2002 23:21:33 -0000	1.3
  +++ GenericMatcher.java	19 Aug 2002 18:57:08 -0000	1.4
  @@ -11,13 +11,13 @@
   import java.util.Collection;
   
   /**
  - * GenericMatcher implements the Matcher and MatcherConfig interfaces.
  - * GenericMatcher makes writing matchers easier. It provides simple versions of
  + * <p>GenericMatcher implements the Matcher and MatcherConfig interfaces.</p>
  + * <p>GenericMatcher makes writing matchers easier. It provides simple versions of
    * the lifecycle methods init and destroy and of the methods in the MatcherConfig
    * interface. GenericMatcher also implements the log method, declared in the
  - * MatcherContext interface.
  - * <p>
  - * To write a generic matcher, you need only override the abstract match method.
  + * MatcherContext interface.</p>
  + * 
  + * <p>To write a generic matcher, you need only override the abstract match method.</p>
    *
    * @version 1.0.0, 24/04/1999
    * @author Serge Knystautas <se...@lokitech.com>
  @@ -34,11 +34,11 @@
       }
   
       /**
  -     * Returns a String containing the value of the named initialization
  -     * parameter, or null if the parameter does not exist.
  -     * <p>
  -     * This method is supplied for convenience. It gets the value of the
  -     * named parameter from the matcher's MatcherConfig object.
  +     * <p>Returns a String containing the value of the named initialization
  +     * parameter, or null if the parameter does not exist.</p>
  +     * 
  +     * <p>This method is supplied for convenience. It gets the value of the
  +     * named parameter from the matcher's MatcherConfig object.</p>
        *
        * @return String a String containing the value of the initalization parameter
        */
  @@ -87,12 +87,12 @@
   
   
       /**
  -     * Called by the matcher container to indicate to a matcher that the
  -     * matcher is being placed into service.
  +     * <p>Called by the matcher container to indicate to a matcher that the
  +     * matcher is being placed into service.</p>
        *
  -     * This implementation stores the MatcherConfig object it receives from
  +     * <p>This implementation stores the MatcherConfig object it receives from
        * the matcher container for alter use. When overriding this form of the
  -     * method, call super.init(config).
  +     * method, call super.init(config).</p>
        *
        * @param MatcherConfig config - the MatcherConfig object that contains
        *          configutation information for this matcher
  @@ -105,18 +105,18 @@
       }
   
       /**
  -     * A convenience method which can be overridden so that there's no
  -     * need to call super.init(config).
  +     * <p>A convenience method which can be overridden so that there's no
  +     * need to call super.init(config).</p>
        *
  -     * Instead of overriding init(MatcherConfig), simply override this
  +     * <p>Instead of overriding init(MatcherConfig), simply override this
        * method and it will be called by GenericMatcher.init(MatcherConfig config).
  -     * The MatcherConfig object can still be retrieved via getMatcherConfig().
  +     * The MatcherConfig object can still be retrieved via getMatcherConfig().</p>
        *
        * @throws MatcherException
        *          if an exception occurs that interrupts the matcher's normal operation
        */
       public void init() throws MessagingException {
  -        //Do nothing... can be overriden
  +        //Do nothing... can be overridden
       }
   
       /**
  @@ -151,10 +151,10 @@
       }
   
       /**
  -     * Called by the matcher container to allow the matcher to process a
  -     * message.
  +     * <p>Called by the matcher container to allow the matcher to process a
  +     * message.</p>
        *
  -     * This method is declared abstract so subclasses must override it.
  +     * <p>This method is declared abstract so subclasses must override it.</p>
        *
        * @param mail - the Mail object that contains the MimeMessage and
        *          routing information
  
  
  
  1.3       +1 -2      jakarta-james/src/java/org/apache/mailet/GenericRecipientMatcher.java
  
  Index: GenericRecipientMatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/mailet/GenericRecipientMatcher.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GenericRecipientMatcher.java	18 Jan 2002 02:48:40 -0000	1.2
  +++ GenericRecipientMatcher.java	19 Aug 2002 18:57:08 -0000	1.3
  @@ -16,8 +16,7 @@
    * GenericMatcher makes writing recipient based matchers easier. It provides
    * simple versions of the lifecycle methods init and destroy and of the methods
    * in the MatcherConfig interface. GenericMatcher also implements the log method,
  - * declared in the
  - * MatcherContext interface.
  + * declared in the MatcherContext interface.
    *
    * @version 1.0.0, 24/04/1999
    * @author Federico Barbieri <sc...@pop.systemy.it>
  
  
  
  1.8       +18 -17    jakarta-james/src/java/org/apache/mailet/MailAddress.java
  
  Index: MailAddress.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/mailet/MailAddress.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MailAddress.java	7 Aug 2002 23:21:33 -0000	1.7
  +++ MailAddress.java	19 Aug 2002 18:57:08 -0000	1.8
  @@ -14,24 +14,24 @@
   /**
    * A representation of an email address.
    * <p>This class encapsulates functionalities to access to different
  - * parts of an email address without dealing with its parsing.
  - * <p>
  - * A MailAddress is an address specified in the MAIL FROM and
  + * parts of an email address without dealing with its parsing.</p>
  + * 
  + * <p>A MailAddress is an address specified in the MAIL FROM and
    * RCPT TO commands in SMTP sessions.  These are either passed by
    * an external server to the mailet-compliant SMTP server, or they
    * are created programmatically by the mailet-compliant server to
    * send to another (external) SMTP server.  Mailets and matchers
    * use the MailAddress for the purpose of evaluating the sender
  - * and recipient(s) of a message.
  - * <p>
  - * MailAddress parses an email address as defined in RFC 821
  + * and recipient(s) of a message.</p>
  + * 
  + * <p>MailAddress parses an email address as defined in RFC 821
    * (SMTP) p. 30 and 31 where addresses are defined in BNF convention.
    * As the mailet API does not support the aged "SMTP-relayed mail"
    * addressing protocol, this leaves all addresses to be a <mailbox>,
    * as per the spec.  The MailAddress's "user" is the <local-part> of
  - * the <mailbox> and "host" is the <domain> of the mailbox.
  - * <p>
  - * This class is a good way to validate email addresses as there are
  + * the <mailbox> and "host" is the <domain> of the mailbox.</p>
  + * 
  + * <p>This class is a good way to validate email addresses as there are
    * some valid addresses which would fail with a simpler approach
    * to parsing address.  It also removes parsing burden from
    * mailets and matchers that might not realize the flexibility of an
  @@ -39,11 +39,11 @@
    * SMTP address (the quoted text serge@home is the user and
    * lokitech.com is the host).  This means all current parsing to date
    * is incorrect as we just find the first @ and use that to separate
  - * user from host.
  - * <p>
  - * This parses an address as per the BNF specification for <mailbox>
  + * user from host.</p>
  + * 
  + * <p>This parses an address as per the BNF specification for <mailbox>
    * from RFC 821 on page 30 and 31, section 4.1.2. COMMAND SYNTAX.
  - * http://www.freesoft.org/CIE/RFC/821/15.htm
  + * http://www.freesoft.org/CIE/RFC/821/15.htm</p>
    *
    * @version 1.0
    * @author Roberto Lo Giacco <rl...@mail.com>
  @@ -65,8 +65,9 @@
       private int pos = 0;
   
       /**
  -     * Construct a MailAddress parsing the provided <code>String</code> object.
  -     * <p>The <code>personal</code> variable is left empty.
  +     * <p>Construct a MailAddress parsing the provided <code>String</code> object.</p>
  +     *
  +     * <p>The <code>personal</code> variable is left empty.</p>
        *
        * @param   address the email address compliant to the RFC822 format
        * @throws  ParseException    if the parse failed
  @@ -407,11 +408,11 @@
           //  in upper case and a through z in lower case
           //<d> ::= any one of the ten digits 0 through 9
   
  -        //basically, this is a series of letters, digits, and hyphens,
  +        // basically, this is a series of letters, digits, and hyphens,
           // but it can't start with a digit or hypthen
           // and can't end with a hyphen
   
  -        //by practice though, we should relax this as domain names can start
  +        // in practice though, we should relax this as domain names can start
           // with digits as well as letters.  So only check that doesn't start
           // or end with hyphen.
           while (true) {
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>