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/10/02 08:12:04 UTC

cvs commit: jakarta-james/src/java/org/apache/james/userrepository AbstractJdbcUsersRepository.java DefaultJamesUser.java JamesUsersJdbcRepository.java UsersFileRepository.java UsersLDAPRepository.java

pgoldstein    2002/10/01 23:12:04

  Modified:    src/java/org/apache/james BaseConnectionHandler.java
                        James.java
               src/java/org/apache/james/core AvalonMailStore.java
                        AvalonUsersStore.java
               src/java/org/apache/james/dnsserver DNSServer.java
               src/java/org/apache/james/fetchpop FetchPOP.java
                        FetchScheduler.java
               src/java/org/apache/james/mailrepository
                        AvalonMailRepository.java JDBCMailRepository.java
               src/java/org/apache/james/pop3server POP3Handler.java
                        POP3Server.java
               src/java/org/apache/james/remotemanager RemoteManager.java
                        RemoteManagerHandler.java
               src/java/org/apache/james/smtpserver SMTPServer.java
                        SMTPHandler.java
               src/java/org/apache/james/transport JamesSpoolManager.java
                        LinearProcessor.java MailetLoader.java
                        MatchLoader.java
               src/java/org/apache/james/userrepository
                        AbstractJdbcUsersRepository.java
                        DefaultJamesUser.java JamesUsersJdbcRepository.java
                        UsersFileRepository.java UsersLDAPRepository.java
  Log:
  Replacing comments with @see tags.
  Added some comments.
  
  Revision  Changes    Path
  1.12      +11 -7     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- BaseConnectionHandler.java	14 Sep 2002 07:25:00 -0000	1.11
  +++ BaseConnectionHandler.java	2 Oct 2002 06:12:01 -0000	1.12
  @@ -26,9 +26,14 @@
   public class BaseConnectionHandler extends AbstractLogEnabled implements Configurable {
   
       /**
  +     * The default timeout for the connection
  +     */
  +    private static int DEFAULT_TIMEOUT = 1800000;
  +
  +    /**
        * The timeout for the connection
        */
  -    protected int timeout;
  +    protected int timeout = DEFAULT_TIMEOUT;
   
       /**
        * The hello name for the connection
  @@ -60,17 +65,16 @@
   
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure( final Configuration configuration )
           throws ConfigurationException {
   
  -        timeout = configuration.getChild( "connectiontimeout" ).getValueAsInteger( 1800000 );
  +        timeout = configuration.getChild( "connectiontimeout" ).getValueAsInteger( DEFAULT_TIMEOUT );
           helloName = configHelloName(configuration);
  -        getLogger().info("Hello Name is: " + helloName);
  +        if (getLogger().isDebugEnabled()) {
  +            getLogger().debug("Hello Name is: " + helloName);
  +        }
       }
   
       /**
  
  
  
  1.35      +6 -29     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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- James.java	30 Sep 2002 23:38:57 -0000	1.34
  +++ James.java	2 Oct 2002 06:12:01 -0000	1.35
  @@ -67,11 +67,6 @@
       private final static String SOFTWARE_NAME_VERSION = Constants.SOFTWARE_NAME + " " + Constants.SOFTWARE_VERSION;
   
       /**
  -     * Whether 'deep debugging' is turned on.
  -     */
  -    private final static boolean DEEP_DEBUG = false;
  -
  -    /**
        * The component manager used both internally by James and by Mailets.
        */
       private DefaultComponentManager compMgr; //Components shared
  @@ -178,25 +173,14 @@
       private RFC822DateFormat rfc822DateFormat = new RFC822DateFormat();
   
       /**
  -     * Pass the Context to the component.
  -     * This method is called after the setLogger()
  -     * method and before any other method.
  -     *
  -     * @param context the context
  -     * @throws ContextException if context is invalid
  +     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(Context)
        */
       public void contextualize(final Context context) {
           this.myContext = context;
       }
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose(ComponentManager comp) {
           compMgr = new DefaultComponentManager(comp);
  @@ -204,21 +188,14 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration conf) {
           this.conf = conf;
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() throws Exception {
   
  @@ -365,7 +342,7 @@
           compMgr.put( MailServer.ROLE, this);
   
           spool = mailstore.getInboundSpool();
  -        if ((DEEP_DEBUG) && (getLogger().isDebugEnabled())) {
  +        if (getLogger().isDebugEnabled()) {
               getLogger().debug("Got spool");
           }
   
  
  
  
  1.17      +4 -22     jakarta-james/src/java/org/apache/james/core/AvalonMailStore.java
  
  Index: AvalonMailStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/AvalonMailStore.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AvalonMailStore.java	30 Sep 2002 23:38:57 -0000	1.16
  +++ AvalonMailStore.java	2 Oct 2002 06:12:02 -0000	1.17
  @@ -72,12 +72,7 @@
       private SpoolRepository inboundSpool;
   
       /**
  -     * Pass the Context to the component.
  -     * This method is called after the setLogger()
  -     * method and before any other method.
  -     *
  -     * @param context the context
  -     * @throws ContextException if context is invalid
  +     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(Context)
        */
       public void contextualize(final Context context)
               throws ContextException {
  @@ -85,13 +80,7 @@
       }
   
       /**
  -     * Pass the <code>ComponentManager</code> to the instance.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException
  @@ -100,10 +89,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure( final Configuration configuration )
           throws ConfigurationException
  @@ -112,11 +98,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize()
           throws Exception {
  
  
  
  1.13      +4 -22     jakarta-james/src/java/org/apache/james/core/AvalonUsersStore.java
  
  Index: AvalonUsersStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/AvalonUsersStore.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AvalonUsersStore.java	26 Sep 2002 01:25:36 -0000	1.12
  +++ AvalonUsersStore.java	2 Oct 2002 06:12:02 -0000	1.13
  @@ -56,12 +56,7 @@
       protected ComponentManager       componentManager;
   
       /**
  -     * Pass the Context to the component.
  -     * This method is called after the setLogger()
  -     * method and before any other method.
  -     *
  -     * @param context the context
  -     * @throws ContextException if context is invalid
  +     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(Context)
        */
       public void contextualize(final Context context)
               throws ContextException {
  @@ -69,13 +64,7 @@
       }
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException {
  @@ -83,10 +72,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure( final Configuration configuration )
           throws ConfigurationException {
  @@ -94,11 +80,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize()
           throws Exception {
  
  
  
  1.9       +2 -9      jakarta-james/src/java/org/apache/james/dnsserver/DNSServer.java
  
  Index: DNSServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/dnsserver/DNSServer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DNSServer.java	15 Aug 2002 21:14:53 -0000	1.8
  +++ DNSServer.java	2 Oct 2002 06:12:02 -0000	1.9
  @@ -53,10 +53,7 @@
       private Collection dnsServers = new Vector();
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure( final Configuration configuration )
           throws ConfigurationException {
  @@ -76,11 +73,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize()
           throws Exception {
  
  
  
  1.4       +2 -8      jakarta-james/src/java/org/apache/james/fetchpop/FetchPOP.java
  
  Index: FetchPOP.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/fetchpop/FetchPOP.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FetchPOP.java	27 Sep 2002 14:06:55 -0000	1.3
  +++ FetchPOP.java	2 Oct 2002 06:12:02 -0000	1.4
  @@ -117,13 +117,7 @@
       }
   
       /**
  -     * Pass the <code>ComponentManager</code> to the instance.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException {
  
  
  
  1.3       +2 -6      jakarta-james/src/java/org/apache/james/fetchpop/FetchScheduler.java
  
  Index: FetchScheduler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/fetchpop/FetchScheduler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FetchScheduler.java	24 Sep 2002 22:03:12 -0000	1.2
  +++ FetchScheduler.java	2 Oct 2002 06:12:02 -0000	1.3
  @@ -99,11 +99,7 @@
       }
   
       /**
  -     * The dispose operation is called at the end of a components lifecycle.
  -     * Instances of this class use this method to release and destroy any
  -     * resources that they own.
  -     *
  -     * @throws Exception if an error is encountered during shutdown
  +     * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
       public void dispose() {
           if (enabled) {
  
  
  
  1.20      +3 -16     jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java
  
  Index: AvalonMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/AvalonMailRepository.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AvalonMailRepository.java	27 Sep 2002 04:58:34 -0000	1.19
  +++ AvalonMailRepository.java	2 Oct 2002 06:12:02 -0000	1.20
  @@ -62,13 +62,7 @@
       private Set keys;
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
               throws ComponentException {
  @@ -77,10 +71,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration conf) throws ConfigurationException {
           destination = conf.getAttribute("destinationURL");
  @@ -100,11 +91,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize()
               throws Exception {
  
  
  
  1.28      +3 -17     jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java
  
  Index: JDBCMailRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/mailrepository/JDBCMailRepository.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- JDBCMailRepository.java	30 Sep 2002 23:38:57 -0000	1.27
  +++ JDBCMailRepository.java	2 Oct 2002 06:12:02 -0000	1.28
  @@ -145,12 +145,7 @@
       protected JDBCUtil theJDBCUtil;
   
       /**
  -     * Pass the Context to the component.
  -     * This method is called after the setLogger()
  -     * method and before any other method.
  -     *
  -     * @param context the context
  -     * @throws ContextException if context is invalid
  +     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(Context)
        */
       public void contextualize(final Context context)
               throws ContextException {
  @@ -158,13 +153,7 @@
       }
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException {
  @@ -183,10 +172,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration conf) throws ConfigurationException {
           if (getLogger().isDebugEnabled()) {
  
  
  
  1.13      +53 -34    jakarta-james/src/java/org/apache/james/pop3server/POP3Handler.java
  
  Index: POP3Handler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/pop3server/POP3Handler.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- POP3Handler.java	14 Sep 2002 07:28:55 -0000	1.12
  +++ POP3Handler.java	2 Oct 2002 06:12:02 -0000	1.13
  @@ -59,6 +59,7 @@
                                                           // error message
   
       // Authentication states for the POP3 interaction
  +
       private final static int AUTHENTICATION_READY = 0;    // Waiting for user id
   
       private final static int AUTHENTICATION_USERSET = 1;  // User id provided, waiting for
  @@ -76,27 +77,48 @@
                                                             // to whether an email has been
                                                             // deleted from the inbox.
   
  -    private MailServer mailServer;      // The internal mail server service
  -    private UsersRepository users;      // The user repository for this server - used to authenticate
  -                                        // users
  +    /**
  +     * The internal mail server service
  +     */
  +    private MailServer mailServer;
  +
  +    /**
  +     * The user repository for this server - used to authenticate users.
  +     */
  +    private UsersRepository users;
   
       private TimeScheduler scheduler;    // The scheduler used to handle timeouts for the
                                           // POP3 interaction
   
  -    private MailRepository userInbox;   // The mail server's copy of the user's inbox
  +    /**
  +     * The mail server's copy of the user's inbox
  +     */
  +    private MailRepository userInbox;
   
  -    private Socket socket;         // The TCP/IP socket over which the POP3 interaction
  -                                   // is occurring
  +    /**
  +     * The TCP/IP socket over which the POP3 interaction
  +     * is occurring
  +     */
  +    private Socket socket;
   
  -    private BufferedReader in;     // The reader associated with incoming characters.
  +    /**
  +     * The reader associated with incoming characters.
  +     */
  +    private BufferedReader in;
   
  -    private PrintWriter out;       // The writer to which outgoing messages are written.
  +    /**
  +     * The writer to which outgoing messages are written.
  +     */
  +    private PrintWriter out;
   
       private OutputStream outs;     // The socket's output stream
   
       private int state;             // The current transaction state of the handler
   
  -    private String user;           // The user id associated with the POP3 dialogue
  +    /**
  +     * The user id associated with the POP3 dialogue
  +     */
  +    private String user;
   
       private Vector userMailbox = new Vector();   // A dynamic list representing the set of
                                                    // emails in the user's inbox at any given time
  @@ -111,13 +133,7 @@
                                                // 20 seconds.
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException {
  @@ -131,10 +147,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration configuration)
               throws ConfigurationException {
  @@ -144,12 +157,7 @@
       }
   
       /**
  -     * Handle a connection.
  -     * This handler is responsible for processing connections as they occur.
  -     *
  -     * @param connection the connection
  -     * @throws IOException if an error reading from socket occurs
  -     * @throws ProtocolException if an error handling connection occurs
  +     * @see org.apache.avalon.cornerstone.services.connection.ConnectionHandler#handleConnection(Socket)
        */
       public void handleConnection( Socket connection )
               throws IOException {
  @@ -162,8 +170,8 @@
               in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
               outs = socket.getOutputStream();
               out = new InternetPrintWriter(outs, true);
  -            remoteHost = socket.getInetAddress().getHostName ();
               remoteIP = socket.getInetAddress().getHostAddress ();
  +            remoteHost = socket.getInetAddress().getHostName ();
           } catch (Exception e) {
               if (getLogger().isErrorEnabled()) {
                   StringBuffer exceptionBuffer =
  @@ -207,7 +215,18 @@
                   scheduler.resetTrigger(this.toString());
               }
               scheduler.removeTrigger(this.toString());
  -            getLogger().info("Connection closed");
  +            if (getLogger().isInfoEnabled()) {
  +                StringBuffer logBuffer =
  +                    new StringBuffer(128)
  +                        .append("Connection for ")
  +                        .append(user)
  +                        .append(" from ")
  +                        .append(remoteHost)
  +                        .append(" (")
  +                        .append(remoteIP)
  +                        .append(") closed.");
  +                getLogger().info(logBuffer.toString());
  +            }
           } catch (Exception e) {
               out.println(ERR_RESPONSE + " Error closing connection.");
               out.flush();
  @@ -277,17 +296,17 @@
        * to parse the raw command string to determine exactly which handler should
        * be called.  It returns true if expecting additional commands, false otherwise.
        *
  -     * @param commandRaw the raw command string passed in over the socket
  +     * @param rawCommand the raw command string passed in over the socket
        *
        * @return whether additional commands are expected.
        */
  -    private boolean parseCommand(String commandRaw) {
  -        if (commandRaw == null) {
  +    private boolean parseCommand(String rawCommand) {
  +        if (rawCommand == null) {
               return false;
           }
           boolean returnValue = true;
  -        String command = commandRaw.trim();
  -        commandRaw = command;
  +        String command = rawCommand.trim();
  +        rawCommand = command;
           StringTokenizer commandLine = new StringTokenizer(command, " ");
           int arguments = commandLine.countTokens();
           if (arguments == 0) {
  @@ -298,7 +317,7 @@
           if (getLogger().isDebugEnabled()) {
               // Don't display password in logger
               if (!command.equals("PASS")) {
  -                getLogger().debug("Command received: " + commandRaw);
  +                getLogger().debug("Command received: " + rawCommand);
               } else {
                   getLogger().debug("Command received: PASS <password omitted>");
               }
  
  
  
  1.11      +4 -14     jakarta-james/src/java/org/apache/james/pop3server/POP3Server.java
  
  Index: POP3Server.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/pop3server/POP3Server.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- POP3Server.java	24 Sep 2002 22:23:03 -0000	1.10
  +++ POP3Server.java	2 Oct 2002 06:12:02 -0000	1.11
  @@ -38,11 +38,9 @@
       protected ConnectionHandlerFactory createFactory() {
           return new DefaultHandlerFactory(POP3Handler.class);
       }
  +
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(final Configuration configuration) throws ConfigurationException {
           enabled = configuration.getAttributeAsBoolean("enabled", true);
  @@ -65,11 +63,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() throws Exception {
           if (enabled) {
  @@ -93,11 +87,7 @@
       }
   
       /**
  -     * The dispose operation is called at the end of a components lifecycle.
  -     * Instances of this class use this method to release and destroy any
  -     * resources that they own.
  -     *
  -     * @throws Exception if an error is encountered during shutdown
  +     * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
       public void dispose() {
           if (enabled) {
  
  
  
  1.10      +4 -16     jakarta-james/src/java/org/apache/james/remotemanager/RemoteManager.java
  
  Index: RemoteManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/remotemanager/RemoteManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- RemoteManager.java	24 Sep 2002 04:58:49 -0000	1.9
  +++ RemoteManager.java	2 Oct 2002 06:12:02 -0000	1.10
  @@ -30,16 +30,12 @@
   public class RemoteManager
       extends AbstractService implements Component {
   
  -    protected ConnectionHandlerFactory createFactory()
  -    {
  +    protected ConnectionHandlerFactory createFactory() {
           return new DefaultHandlerFactory( RemoteManagerHandler.class );
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure( final Configuration configuration )
           throws ConfigurationException {
  @@ -68,11 +64,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() throws Exception {
           getLogger().info( "RemoteManager init..." );
  @@ -90,11 +82,7 @@
       }
   
       /**
  -     * The dispose operation is called at the end of a components lifecycle.
  -     * Instances of this class use this method to release and destroy any
  -     * resources that they own.
  -     *
  -     * @throws Exception if an error is encountered during shutdown
  +     * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
       public void dispose()
       {
  
  
  
  1.18      +5 -19     jakarta-james/src/java/org/apache/james/remotemanager/RemoteManagerHandler.java
  
  Index: RemoteManagerHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/remotemanager/RemoteManagerHandler.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- RemoteManagerHandler.java	29 Sep 2002 00:03:10 -0000	1.17
  +++ RemoteManagerHandler.java	2 Oct 2002 06:12:03 -0000	1.18
  @@ -171,13 +171,7 @@
       private HashMap adminAccounts = new HashMap();
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException {
  @@ -192,10 +186,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure( final Configuration configuration )
           throws ConfigurationException {
  @@ -211,12 +202,7 @@
       }
   
       /**
  -     * Handle a connection.
  -     * This handler is responsible for processing connections as they occur.
  -     *
  -     * @param connection the connection
  -     * @throws IOException if an error reading from socket occurs
  -     * @throws ProtocolException if an error handling connection occurs
  +     * @see org.apache.avalon.cornerstone.services.connection.ConnectionHandler#handleConnection(Socket)
        */
       public void handleConnection( final Socket connection )
           throws IOException {
  @@ -224,8 +210,8 @@
           final PeriodicTimeTrigger trigger = new PeriodicTimeTrigger( timeout, -1 );
           scheduler.addTrigger( this.toString(), trigger, this );
           socket = connection;
  -        String remoteHost = socket.getInetAddress().getHostName();
           String remoteIP = socket.getInetAddress().getHostAddress();
  +        String remoteHost = socket.getInetAddress().getHostName();
   
           try {
               in = new BufferedReader(new InputStreamReader( socket.getInputStream() ));
  
  
  
  1.13      +8 -21     jakarta-james/src/java/org/apache/james/smtpserver/SMTPServer.java
  
  Index: SMTPServer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/smtpserver/SMTPServer.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SMTPServer.java	24 Sep 2002 22:23:03 -0000	1.12
  +++ SMTPServer.java	2 Oct 2002 06:12:03 -0000	1.13
  @@ -47,24 +47,17 @@
       protected ConnectionHandlerFactory createFactory() {
           return new DefaultHandlerFactory(SMTPHandler.class);
       }
  +
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose(final ComponentManager componentManager) throws ComponentException {
           super.compose(componentManager);
           mailetcontext = (MailetContext) componentManager.lookup("org.apache.mailet.MailetContext");
       }
  +
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(final Configuration configuration) throws ConfigurationException {
           enabled = configuration.getAttributeAsBoolean("enabled", true);
  @@ -88,12 +81,9 @@
               mailetcontext.setAttribute(Constants.HELLO_NAME, helloName);
           }
       }
  +
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() throws Exception {
           if (enabled) {
  @@ -115,12 +105,9 @@
               System.out.println("SMTP Server Disabled");
           }
       }
  +
       /**
  -     * The dispose operation is called at the end of a components lifecycle.
  -     * Instances of this class use this method to release and destroy any
  -     * resources that they own.
  -     *
  -     * @throws Exception if an error is encountered during shutdown
  +     * @see org.apache.avalon.framework.activity.Disposable#dispose()
        */
       public void dispose() {
           if (enabled) {
  
  
  
  1.29      +4 -15     jakarta-james/src/java/org/apache/james/smtpserver/SMTPHandler.java
  
  Index: SMTPHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/smtpserver/SMTPHandler.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- SMTPHandler.java	30 Sep 2002 23:21:04 -0000	1.28
  +++ SMTPHandler.java	2 Oct 2002 06:12:03 -0000	1.29
  @@ -248,13 +248,7 @@
       private HashMap state = new HashMap();
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose(final ComponentManager componentManager) throws ComponentException {
           mailServer = (MailServer) componentManager.lookup("org.apache.james.services.MailServer");
  @@ -287,12 +281,7 @@
       }
   
       /**
  -     * Handle a connection.
  -     * This handler is responsible for processing connections as they occur.
  -     *
  -     * @param connection the connection
  -     * @throws IOException if an error reading from socket occurs
  -     * @throws ProtocolException if an error handling connection occurs
  +     * @see org.apache.avalon.cornerstone.services.connection.ConnectionHandler#handleConnection(Socket)
        */
       public void handleConnection(Socket connection) throws IOException {
           try {
  @@ -303,8 +292,8 @@
               // to be ASCII
               inReader = new BufferedReader(new InputStreamReader(in, "ASCII"));
               out = new InternetPrintWriter(socket.getOutputStream(), true);
  -            remoteHost = socket.getInetAddress().getHostName();
               remoteIP = socket.getInetAddress().getHostAddress();
  +            remoteHost = socket.getInetAddress().getHostName();
               smtpID = random.nextInt(1024) + "";
               resetState();
           } catch (Exception e) {
  
  
  
  1.20      +4 -17     jakarta-james/src/java/org/apache/james/transport/JamesSpoolManager.java
  
  Index: JamesSpoolManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/JamesSpoolManager.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- JamesSpoolManager.java	30 Sep 2002 23:38:58 -0000	1.19
  +++ JamesSpoolManager.java	2 Oct 2002 06:12:03 -0000	1.20
  @@ -85,13 +85,7 @@
       private ThreadManager threadManager;
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose(ComponentManager comp)
           throws ComponentException {
  @@ -100,10 +94,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration conf) throws ConfigurationException {
           this.conf = conf;
  @@ -111,11 +102,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() throws Exception {
   
  
  
  
  1.10      +1 -5      jakarta-james/src/java/org/apache/james/transport/LinearProcessor.java
  
  Index: LinearProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/LinearProcessor.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LinearProcessor.java	30 Sep 2002 02:17:04 -0000	1.9
  +++ LinearProcessor.java	2 Oct 2002 06:12:03 -0000	1.10
  @@ -90,11 +90,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() {
           matchers = new ArrayList();
  
  
  
  1.7       +1 -4      jakarta-james/src/java/org/apache/james/transport/MailetLoader.java
  
  Index: MailetLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/MailetLoader.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MailetLoader.java	26 Sep 2002 01:25:36 -0000	1.6
  +++ MailetLoader.java	2 Oct 2002 06:12:03 -0000	1.7
  @@ -33,10 +33,7 @@
       private Vector mailetPackages;
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration conf) throws ConfigurationException {
           mailetPackages = new Vector();
  
  
  
  1.8       +1 -4      jakarta-james/src/java/org/apache/james/transport/MatchLoader.java
  
  Index: MatchLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/transport/MatchLoader.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MatchLoader.java	26 Sep 2002 01:25:36 -0000	1.7
  +++ MatchLoader.java	2 Oct 2002 06:12:03 -0000	1.8
  @@ -33,10 +33,7 @@
       private Vector matcherPackages;
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration conf) throws ConfigurationException {
           matcherPackages = new Vector();
  
  
  
  1.12      +2 -13     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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- AbstractJdbcUsersRepository.java	25 Sep 2002 22:53:45 -0000	1.11
  +++ AbstractJdbcUsersRepository.java	2 Oct 2002 06:12:03 -0000	1.12
  @@ -90,12 +90,7 @@
       private JDBCUtil theJDBCUtil;
   
       /**
  -     * Pass the Context to the component.
  -     * This method is called after the setLogger()
  -     * method and before any other method.
  -     *
  -     * @param context the context
  -     * @throws ContextException if context is invalid
  +     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(Context)
        */
       public void contextualize(final Context context)
               throws ContextException {
  @@ -103,13 +98,7 @@
       }
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException
  
  
  
  1.6       +2 -6      jakarta-james/src/java/org/apache/james/userrepository/DefaultJamesUser.java
  
  Index: DefaultJamesUser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/DefaultJamesUser.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultJamesUser.java	23 Sep 2002 17:36:34 -0000	1.5
  +++ DefaultJamesUser.java	2 Oct 2002 06:12:03 -0000	1.6
  @@ -54,11 +54,7 @@
   
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() {
           forwarding = false;
  
  
  
  1.6       +8 -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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JamesUsersJdbcRepository.java	19 Aug 2002 18:57:08 -0000	1.5
  +++ JamesUsersJdbcRepository.java	2 Oct 2002 06:12:03 -0000	1.6
  @@ -100,6 +100,14 @@
           setUserForStatement(user, userUpdate, true);
       }
   
  +    /**
  +     * Sets the data for the prepared statement to match the information
  +     * in the user object.
  +     *
  +     * @param user the user whose data is to be stored in the PreparedStatement.
  +     * @param stmt the PreparedStatement to be modified.
  +     * @param userNameLast whether the user id is the last or the first column
  +     */
       private void setUserForStatement(User user, PreparedStatement stmt,
                                        boolean userNameLast) throws SQLException {
           // Determine column offsets to use, based on username column pos.
  
  
  
  1.10      +29 -30    jakarta-james/src/java/org/apache/james/userrepository/UsersFileRepository.java
  
  Index: UsersFileRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/UsersFileRepository.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- UsersFileRepository.java	14 Sep 2002 09:00:58 -0000	1.9
  +++ UsersFileRepository.java	2 Oct 2002 06:12:03 -0000	1.10
  @@ -46,26 +46,22 @@
    
       /**
        * Whether 'deep debugging' is turned on.
  -     *
  -     * TODO: Shouldn't this be false by default?
        */
  -    protected static boolean DEEP_DEBUG = true;
  +    protected static boolean DEEP_DEBUG = false;
   
       /** @deprecated what was this for? */
       private static final String TYPE = "USERS";
   
       private Store store;
       private ObjectRepository or;
  +
  +    /**
  +     * The destination URL used to define the repository.
  +     */
       private String destination;
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose( final ComponentManager componentManager )
           throws ComponentException {
  @@ -81,10 +77,7 @@
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure( final Configuration configuration )
           throws ConfigurationException {
  @@ -97,11 +90,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize()
           throws Exception {
  @@ -133,10 +122,23 @@
           }
       }
   
  +    /**
  +     * List users in repository.
  +     *
  +     * @return Iterator over a collection of Strings, each being one user in the repository.
  +     */
       public Iterator list() {
           return or.list();
       }
   
  +    /**
  +     * Update the repository with the specified user object. A user object
  +     * with this username must already exist.
  +     *
  +     * @param user the user to be added.
  +     *
  +     * @return true if successful.
  +     */
       public synchronized boolean addUser(User user) {
           String username = user.getUserName();
           if (contains(username)) {
  @@ -150,7 +152,7 @@
           return true;
       }
   
  -    public synchronized void addUser(String name, Object attributes) {
  +    public void addUser(String name, Object attributes) {
           if (attributes instanceof String) {
               User newbie = new DefaultUser(name, "SHA");
               newbie.setPassword( (String) attributes);
  @@ -177,11 +179,8 @@
   
       public User getUserByNameCaseInsensitive(String name) {
           String realName = getRealName(name);
  -        // TODO: This clause is in violation of the contract for the
  -        //       interface - class should return false if the user
  -        //       doesn't exist
           if (realName == null ) {
  -            throw new RuntimeException("No such user");
  +            return null;
           }
           return getUserByName(realName);
       }
  @@ -197,15 +196,15 @@
           return null;
       }
   
  -    public Object getAttributes(String name) {       
  +    public Object getAttributes(String name) {
           throw new UnsupportedOperationException("Improper use of deprecated method - read javadocs");
       }
   
       public boolean updateUser(User user) {
  -    String username = user.getUserName();
  -    if (!contains(username)) {
  -        return false;
  -    }
  +        String username = user.getUserName();
  +        if (!contains(username)) {
  +            return false;
  +        }
           try {
               or.put(username, user);
           } catch (Exception e) {
  
  
  
  1.9       +45 -58    jakarta-james/src/java/org/apache/james/userrepository/UsersLDAPRepository.java
  
  Index: UsersLDAPRepository.java
  ===================================================================
  RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/userrepository/UsersLDAPRepository.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- UsersLDAPRepository.java	17 Aug 2002 18:33:28 -0000	1.8
  +++ UsersLDAPRepository.java	2 Oct 2002 06:12:03 -0000	1.9
  @@ -15,6 +15,7 @@
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.james.Constants;
  @@ -36,7 +37,8 @@
    * @author  Charles Bennett
    */
   public class UsersLDAPRepository
  -    implements UsersRepository, LogEnabled, Configurable, Contextualizable, Initializable{
  +    extends AbstractLogEnabled
  +    implements UsersRepository, Configurable, Contextualizable, Initializable{
   
       private ComponentManager comp;
   
  @@ -66,18 +68,8 @@
       private boolean managePasswordAttr;
       private String passwordAttr;
   
  -
  -    public void enableLogging(final Logger a_Logger) {
  -        logger = a_Logger;
  -    }
  -
       /**
  -     * Pass the Context to the component.
  -     * This method is called after the setLogger()
  -     * method and before any other method.
  -     *
  -     * @param context the context
  -     * @throws ContextException if context is invalid
  +     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(Context)
        */
       public void contextualize(Context context)
           throws ContextException {
  @@ -87,23 +79,14 @@
       }
   
       /**
  -     * Pass the <code>ComponentManager</code> to the <code>composer</code>.
  -     * The instance uses the specified <code>ComponentManager</code> to 
  -     * acquire the components it needs for execution.
  -     *
  -     * @param componentManager The <code>ComponentManager</code> which this
  -     *                <code>Composable</code> uses.
  -     * @throws ComponentException if an error occurs
  +     * @see org.apache.avalon.framework.component.Composable#compose(ComponentManager)
        */
       public void compose(ComponentManager compMgr) {
           this.comp = comp;
       }
   
       /**
  -     * Pass the <code>Configuration</code> to the instance.
  -     *
  -     * @param configuration the class configurations.
  -     * @throws ConfigurationException if an error occurs
  +     * @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
        */
       public void configure(Configuration conf)
           throws ConfigurationException {
  @@ -140,11 +123,7 @@
       }
   
       /**
  -     * Initialize the component. Initialization includes
  -     * allocating any resources required throughout the
  -     * components lifecycle.
  -     *
  -     * @throws Exception if an error occurs
  +     * @see org.apache.avalon.framework.activity.Initializable#initialize()
        */
       public void initialize() throws Exception {
           //setServerRoot();
  @@ -155,7 +134,7 @@
           rootURL = urlBuffer.toString() + rootNodeDN;
           baseURL = urlBuffer.toString() + baseNodeDN;
   
  -        logger.info("Creating initial context from " + baseURL);
  +        getLogger().info("Creating initial context from " + baseURL);
           //System.out.println("Creating initial context from " + baseURL);
   
           Hashtable env = new Hashtable();
  @@ -171,7 +150,7 @@
           }
   
   
  -        logger.info("Initial context initialized from " + baseURL);
  +        getLogger().info("Initial context initialized from " + baseURL);
       }
   
   
  @@ -194,7 +173,7 @@
                               .append(", ")
                               .append(baseNodeDN);
                   destination = destinationBuffer.toString();
  -                logger.info("Pre-exisisting LDAP node: " + destination);
  +                getLogger().info("Pre-exisisting LDAP node: " + destination);
               } else {
                   Attributes attrs = new BasicAttributes(true);
                   Attribute objclass = new BasicAttribute("objectclass");
  @@ -222,7 +201,7 @@
                               .append(", ")
                               .append(baseNodeDN);
                   destination = destinationBuffer.toString();
  -                logger.info("Created new LDAP node: " + destination);
  +                getLogger().info("Created new LDAP node: " + destination);
               }
           } catch (NamingException e) {
               System.out.println("Problem with child nodes " + e.getMessage());
  @@ -232,6 +211,11 @@
           return destination;
       }
   
  +    /**
  +     * List users in repository.
  +     *
  +     * @return Iterator over a collection of Strings, each being one user in the repository.
  +     */
       public Iterator list() {
   
           List result = new ArrayList();
  @@ -248,17 +232,20 @@
                   }
               }
           } catch (NamingException e) {
  -            logger.error("Problem listing mailboxes. " + e );
  +            getLogger().error("Problem listing mailboxes. " + e );
   
           }
           return result.iterator();
       }
   
  -
  -
  -
       // Methods from interface UsersRepository --------------------------
   
  +    /**
  +     * Update the repository with the specified user object.  Unsupported for
  +     * this user repository type.
  +     *
  +     * @return false
  +     */
       public boolean addUser(User user) {
           return false;
       }
  @@ -311,7 +298,7 @@
                               .append("Found ")
                               .append(userName)
                               .append(" already in mailGroup. ");
  -                logger.info(infoBuffer.toString());
  +                getLogger().info(infoBuffer.toString());
                   //System.out.println(infoBuffer.toString());
   
               } else {
  @@ -330,7 +317,7 @@
                               .append(userName)
                               .append(" added to mailGroup ")
                               .append(baseNodeDN);
  -                logger.info(infoBuffer.toString());
  +                getLogger().info(infoBuffer.toString());
                   //System.out.println(infoBuffer.toString());
               }
           } catch (NamingException e) {
  @@ -341,7 +328,7 @@
                           .append(" to: ")
                           .append(baseNodeDN)
                           .append(e);
  -            logger.error(exceptionBuffer.toString());
  +            getLogger().error(exceptionBuffer.toString());
           }
   
           // Add attributes to user objects, if necessary
  @@ -388,7 +375,7 @@
   
   
                   if (servers != null && servers.contains(baseNodeDN)) {//server already registered for user
  -                    logger.info(baseNodeDN + " already in user's Groups. " );
  +                    getLogger().info(baseNodeDN + " already in user's Groups. " );
                       //System.out.println(baseNodeDN + " already in user's Groups. ");
   
                   } else {
  @@ -400,7 +387,7 @@
                       rootCtx.modifyAttributes(userDN, DirContext.ADD_ATTRIBUTE, new BasicAttributes(groupAttr, baseNodeDN, true));
   
                       rootCtx.addToEnvironment(javax.naming.Context.SECURITY_AUTHENTICATION, "none");
  -                    logger.info(baseNodeDN + " added to user's groups ");
  +                    getLogger().info(baseNodeDN + " added to user's groups ");
                       //System.out.println(baseNodeDN + " added to users' groups ");
   
                   }
  @@ -411,12 +398,12 @@
                               .append("User ")
                               .append(userName)
                               .append(" not in directory.");
  -                logger.info(infoBuffer.toString());
  +                getLogger().info(infoBuffer.toString());
                   // System.out.println(infoBuffer.toString());
   
               }
           } catch (NamingException e) {
  -            logger.error("Problem adding group to user " + userName);
  +            getLogger().error("Problem adding group to user " + userName);
               //System.out.println("Problem adding group to user " + userName);
               //System.out.println(e.getMessage());
               //e.printStackTrace();
  @@ -439,7 +426,7 @@
                   System.out.println("UsersLDAPRepository - Null list attribute.");
   
               } else  if (!members.contains(userName)) {//user not here
  -                logger.info(userName + " missing from mailGroup. ");
  +                getLogger().info(userName + " missing from mailGroup. ");
                   //System.out.println(userName + " missing from mailGroup. ");
   
               } else {
  @@ -456,7 +443,7 @@
   
   
                   ctx.addToEnvironment(javax.naming.Context.SECURITY_AUTHENTICATION, "none");
  -                logger.info(userName + " removed from mailGroup. ");
  +                getLogger().info(userName + " removed from mailGroup. ");
                   //System.out.println(userName + " removed from mailGroup. ");
               }
           } catch (NamingException e) {
  @@ -466,7 +453,7 @@
                           .append(userName)
                           .append(": ")
                           .append(e);
  -            logger.error(exceptionBuffer.toString());
  +            getLogger().error(exceptionBuffer.toString());
               //System.out.println("Problem removing user " + userName);
               //System.out.println(e.getMessage());
               //e.printStackTrace();
  @@ -516,11 +503,11 @@
   
                   Attribute servers = rootCtx.getAttributes(userDN, returnAttrs).get(groupAttr);
                   if (servers == null) { //should not happen
  -                    logger.info("GroupAttribute missing from user: " + userName);
  +                    getLogger().info("GroupAttribute missing from user: " + userName);
                       // System.out.println("GroupAttribute missing from user: " + userName );
   
                   } else if (!servers.contains(baseNodeDN)) {//server not registered for user
  -                    logger.info(baseNodeDN + " missing from users' Groups. " );
  +                    getLogger().info(baseNodeDN + " missing from users' Groups. " );
                       //System.out.println(baseNodeDN + " missing from users' Groups. ");
   
                   } else {
  @@ -537,7 +524,7 @@
                       //rootCtx.modifyAttributes(userDN, DirContext.REPLACE_ATTRIBUTE, changes);
   
                       rootCtx.addToEnvironment(javax.naming.Context.SECURITY_AUTHENTICATION, "none");
  -                    logger.info(baseNodeDN + " removed from users' groups " );
  +                    getLogger().info(baseNodeDN + " removed from users' groups " );
                       //System.out.println(baseNodeDN + " removed from users' groups ");
   
                   }
  @@ -548,7 +535,7 @@
                               .append("User ")
                               .append(userName)
                               .append(" not in directory.");
  -                logger.info(infoBuffer.toString());
  +                getLogger().info(infoBuffer.toString());
                   //System.out.println(infoBuffer.toString());
   
               }
  @@ -558,7 +545,7 @@
                           .append("Problem removing user ")
                           .append(userName)
                           .append(e);
  -            logger.error(exceptionBuffer.toString());
  +            getLogger().error(exceptionBuffer.toString());
               //System.out.println("Problem removing user " + userName);
               //System.out.println(e.getMessage());
               //e.printStackTrace();
  @@ -582,7 +569,7 @@
                               .append("Found ")
                               .append(name)
                               .append(" in mailGroup. ");
  -                logger.info(infoBuffer.toString());
  +                getLogger().info(infoBuffer.toString());
                   //System.out.println(infoBuffer.toString());
               }
           } catch (NamingException e) {
  @@ -592,7 +579,7 @@
                           .append(name)
                           .append(" : ")
                           .append(e);
  -            logger.error(exceptionBuffer.toString());
  +            getLogger().error(exceptionBuffer.toString());
               //System.out.println(exceptionBuffer.toString());
           }
           return found;
  @@ -650,7 +637,7 @@
                           .append(name)
                           .append(" for password test.")
                           .append(e); 
  -            logger.error(exceptionBuffer.toString());
  +            getLogger().error(exceptionBuffer.toString());
               //e.getMessage();
               //e.printStackTrace();
           }
  @@ -677,7 +664,7 @@
                               .append(name)
                               .append(" : ")
                               .append(ae); 
  -                logger.error(exceptionBuffer.toString());
  +                getLogger().error(exceptionBuffer.toString());
                   //System.out.println(exceptionBuffer.toString());
                   //System.out.println(ae.getMessage());
                   //ae.printStackTrace();
  @@ -688,7 +675,7 @@
                               .append(name)
                               .append(" : ")
                               .append(e); 
  -                logger.error(exceptionBuffer.toString());
  +                getLogger().error(exceptionBuffer.toString());
                   //System.out.println(exceptionBuffer.toString());
                   //System.out.println(e.getMessage());
                   //e.printStackTrace();
  @@ -713,7 +700,7 @@
                   result = 0;
               }
           } catch (NamingException e) {
  -            logger.error("Problem counting users: "  + e);
  +            getLogger().error("Problem counting users: "  + e);
               //System.out.println("Problem counting users. ");
           }
           return result;
  @@ -739,7 +726,7 @@
                   ctx.close();
               }
           } catch (NamingException ne) {
  -            logger.warn("UsersLDAPRepository: Unexpected exception encountered while closing directory context: " + ne);
  +            getLogger().warn("UsersLDAPRepository: Unexpected exception encountered while closing directory context: " + ne);
           }
       }
   }
  
  
  

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