james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r419171 - in /james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver: ./ basefilter/ fastfailfilter/
Date Wed, 05 Jul 2006 06:01:30 GMT
Author: norman
Date: Tue Jul  4 23:01:29 2006
New Revision: 419171

URL: http://svn.apache.org/viewvc?rev=419171&view=rev
Log:
Replace interface CommandHandler with abstract class AbstractCommandHandler 

Added:
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AbstractCommandHandler.java
Removed:
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/CommandHandler.java
Modified:
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AuthCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/DataCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/EhloCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/ExpnCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HeloCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HelpCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/MailCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/NoopCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/QuitCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RcptCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RsetCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandlerChain.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPSession.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/UnknownCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/VrfyCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/DataBaseFilterCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/EhloBaseFilterCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/HeloBaseFilterCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/MailBaseFilterCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/RcptBaseFilterCmdHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/MaxRcptHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ResolvableEhloHeloHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ReverseEqualsEhloHeloHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/TarpitHandler.java
    james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ValidSenderDomainHandler.java

Added: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AbstractCommandHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AbstractCommandHandler.java?rev=419171&view=auto
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AbstractCommandHandler.java
(added)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AbstractCommandHandler.java
Tue Jul  4 23:01:29 2006
@@ -0,0 +1,63 @@
+/***********************************************************************
+ * Copyright (c) 1999-2006 The Apache Software Foundation.             *
+ * All rights reserved.                                                *
+ * ------------------------------------------------------------------- *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you *
+ * may not use this file except in compliance with the License. You    *
+ * may obtain a copy of the License at:                                *
+ *                                                                     *
+ *     http://www.apache.org/licenses/LICENSE-2.0                      *
+ *                                                                     *
+ * Unless required by applicable law or agreed to in writing, software *
+ * distributed under the License is distributed on an "AS IS" BASIS,   *
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or     *
+ * implied.  See the License for the specific language governing       *
+ * permissions and limitations under the License.                      *
+ ***********************************************************************/
+
+package org.apache.james.smtpserver;
+
+import java.util.List;
+
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+
+/**
+ * Custom CommandHandlers must extend this class.
+ */
+public abstract class AbstractCommandHandler extends AbstractLogEnabled {
+
+    /**
+     * If set to true all handler processing is stopped (fastfail)
+     */
+    private boolean stopHandlerProcessing = false;
+    
+    
+    /**
+     * Method to set if a after the handler no other command handlers should processed
+     * @param stopHandlerProcessing true or false
+     */
+    public void setStopHandlerProcessing(boolean stopHandlerProcessing) {
+        this.stopHandlerProcessing = stopHandlerProcessing;
+    }
+    
+    /**
+     * Return if the processing of other commandHandlers should be done
+     * @return true or false
+     */
+    public boolean stopHandlerProcessing() {
+        return stopHandlerProcessing;
+    }
+    
+    /**
+     * Handle the command
+    **/
+    public abstract void onCommand(SMTPSession session);
+
+    /**
+     * Return a List of implemented commands
+     * 
+     * @return List which contains implemented commands
+     */
+    public abstract List getImplCommands();
+    
+}

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AuthCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AuthCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AuthCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/AuthCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -17,23 +17,21 @@
 
 package org.apache.james.smtpserver;
 
-import org.apache.james.util.mail.dsn.DSNStatus;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 import java.util.StringTokenizer;
+
 import org.apache.james.util.Base64;
-import java.io.IOException;
+import org.apache.james.util.mail.dsn.DSNStatus;
 
 
 /**
   * handles AUTH command
   */
 public class AuthCmdHandler
-    extends AbstractLogEnabled
-    implements CommandHandler {
+    extends AbstractCommandHandler {
 
     /**
      * The text string for the SMTP AUTH type PLAIN.

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/DataCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/DataCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/DataCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/DataCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -17,7 +17,19 @@
 
 package org.apache.james.smtpserver;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.SequenceInputStream;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.mail.MessagingException;
+
 import org.apache.james.Constants;
 import org.apache.james.core.MailHeaders;
 import org.apache.james.core.MailImpl;
@@ -30,26 +42,12 @@
 import org.apache.mailet.RFC2822Headers;
 import org.apache.mailet.dates.RFC822DateFormat;
 
-import javax.mail.MessagingException;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.SequenceInputStream;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.List;
-
 
 /**
   * handles DATA command
  */
 public class DataCmdHandler
-    extends AbstractLogEnabled
-    implements CommandHandler {
+    extends AbstractCommandHandler {
 
     private final static String SOFTWARE_TYPE = "JAMES SMTP Server "
                                                  + Constants.SOFTWARE_VERSION;

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/EhloCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/EhloCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/EhloCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/EhloCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -20,13 +20,10 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-
 /**
  * Handles EHLO command
  */
-public class EhloCmdHandler extends AbstractLogEnabled implements
-        CommandHandler {
+public class EhloCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/ExpnCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/ExpnCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/ExpnCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/ExpnCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -25,7 +25,7 @@
 /**
   * Handles EXPN command
   */
-public class ExpnCmdHandler implements CommandHandler {
+public class ExpnCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HeloCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HeloCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HeloCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HeloCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -21,13 +21,11 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-
 
 /**
   * Handles HELO command
   */
-public class HeloCmdHandler extends AbstractLogEnabled implements CommandHandler {
+public class HeloCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HelpCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HelpCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HelpCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/HelpCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -25,7 +25,7 @@
 /**
   * Handles HELP command
   */
-public class HelpCmdHandler implements CommandHandler {
+public class HelpCmdHandler extends AbstractCommandHandler {
     /**
      * The name of the command handled by the command handler
      */

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/MailCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/MailCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/MailCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/MailCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -20,7 +20,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.james.util.mail.dsn.DSNStatus;
 import org.apache.mailet.MailAddress;
 
@@ -28,8 +27,7 @@
   * Handles MAIL command
   */
 public class MailCmdHandler
-    extends AbstractLogEnabled
-    implements CommandHandler {
+    extends AbstractCommandHandler{
 
     
     /**

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/NoopCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/NoopCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/NoopCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/NoopCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -25,7 +25,7 @@
 /**
   * Handles NOOP command
   */
-public class NoopCmdHandler implements CommandHandler {
+public class NoopCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/QuitCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/QuitCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/QuitCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/QuitCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -25,7 +25,7 @@
 /**
   * Handles QUIT command
   */
-public class QuitCmdHandler implements CommandHandler {
+public class QuitCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RcptCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RcptCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RcptCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RcptCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -21,15 +21,13 @@
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.james.util.mail.dsn.DSNStatus;
 import org.apache.mailet.MailAddress;
 
 /**
   * Handles RCPT command
   */
-public class RcptCmdHandler extends AbstractLogEnabled implements
-        CommandHandler {
+public class RcptCmdHandler extends AbstractCommandHandler {
 
     /**
      * handles RCPT command

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RsetCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RsetCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RsetCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/RsetCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -25,7 +25,7 @@
 /**
   * Handles RSET command
   */
-public class RsetCmdHandler implements CommandHandler {
+public class RsetCmdHandler extends AbstractCommandHandler {
     /**
      * The name of the command handled by the command handler
      */

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandler.java
Tue Jul  4 23:01:29 2006
@@ -158,8 +158,6 @@
      * The per-handler response buffer used to marshal responses.
      */
     private StringBuffer responseBuffer = new StringBuffer(256);
-    
-    private boolean stopHandlerProcessing = false;
 
     /**
      * Set the configuration data for the handler
@@ -270,13 +268,15 @@
           } else {
               int count = commandHandlers.size();
               for(int i = 0; i < count; i++) {
-                  setStopHandlerProcessing(false);
-                  ((CommandHandler)commandHandlers.get(i)).onCommand(this);
+                  AbstractCommandHandler aHandler = (AbstractCommandHandler)commandHandlers.get(i);
+                  aHandler.setStopHandlerProcessing(false);
+                  aHandler.onCommand(this);
+                  boolean stopHandlerProcessing = aHandler.stopHandlerProcessing();
                   
                   theWatchdog.reset();
                   
                   //if the response is received, stop processing of command handlers
-                  if(mode != COMMAND_MODE || getStopHandlerProcessing()) {
+                  if(mode != COMMAND_MODE || stopHandlerProcessing) {
                       break;
                   }
               }
@@ -571,19 +571,4 @@
 
         return count;
     }
-    
-    /**
-     * @see org.apache.james.smtpserver.SMTPSession#setStopHandlerProcessing(boolean)
-     */
-    public void setStopHandlerProcessing(boolean stopHandlerProcessing) {
-        this.stopHandlerProcessing = stopHandlerProcessing;
-    }
-    
-    /**
-     * @see org.apache.james.smtpserver.SMTPSession#getStopHandlerProcessing()
-     */
-    public boolean getStopHandlerProcessing() {
-        return stopHandlerProcessing;
-    }
-
 }

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandlerChain.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandlerChain.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandlerChain.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPHandlerChain.java
Tue Jul  4 23:01:29 2006
@@ -52,7 +52,7 @@
     private ArrayList messageHandlers = new ArrayList();
     private ArrayList connectHandlers = new ArrayList();
 
-    private final CommandHandler unknownHandler = new UnknownCmdHandler();
+    private final AbstractCommandHandler unknownHandler = new UnknownCmdHandler();
     private ServiceManager serviceManager;
     private Context context;
     
@@ -242,17 +242,17 @@
 
             // if it is a command handler add it to the map with key as command
             // name
-            if (handler instanceof CommandHandler) {
+            if (handler instanceof AbstractCommandHandler) {
                 String commandName = config.getAttribute("command");
                 String cmds[] = commandName.split(",");
-                List implCmds = ((CommandHandler) handler).getImplCommands();
+                List implCmds = ((AbstractCommandHandler) handler).getImplCommands();
 
                 for (int i = 0; i < cmds.length; i++) {
                     commandName = cmds[i].trim().toUpperCase(Locale.US);
 
                     // Check if the commandHandler implement the configured command
                     if (implCmds.contains(commandName)) {
-                        addToMap(commandName, (CommandHandler) handler);
+                        addToMap(commandName, (AbstractCommandHandler) handler);
                         if (getLogger().isInfoEnabled()) {
                             getLogger().info(
                                     "Added Commandhandler: " + className);
@@ -333,7 +333,7 @@
      * @param commandName the command name which will be key
      * @param cmdHandler The commandhandler object
      */
-    private void addToMap(String commandName, CommandHandler cmdHandler) {
+    private void addToMap(String commandName, AbstractCommandHandler cmdHandler) {
         ArrayList handlers = (ArrayList)commandHandlerMap.get(commandName);
         if(handlers == null) {
             handlers = new ArrayList();

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPSession.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPSession.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPSession.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/SMTPSession.java
Tue Jul  4 23:01:29 2006
@@ -241,10 +241,5 @@
      * @return recipient count
      */
     int getRcptCount();
-
-    void setStopHandlerProcessing(boolean b);
-    
-    boolean getStopHandlerProcessing();
-
 }
 

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/UnknownCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/UnknownCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/UnknownCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/UnknownCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -25,7 +25,7 @@
 /**
   * Default command handler for handling unknown commands
   */
-public class UnknownCmdHandler implements CommandHandler {
+public class UnknownCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/VrfyCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/VrfyCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/VrfyCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/VrfyCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -25,10 +25,9 @@
 /**
   * Command handler for handling VRFY command
   */
-public class VrfyCmdHandler implements CommandHandler {
+public class VrfyCmdHandler extends AbstractCommandHandler {
 
     private final String COMMAND_NAME = "VRFY";
-    private boolean stopHandlerProcessing = true;
 
     /**
      * Handler method called upon receipt of a VRFY command.
@@ -51,12 +50,4 @@
         
         return implCommands;
     }
-
-    /**
-     * @see org.apache.james.smtpserver.CommandHandler#stopHandlerProcessing()
-     */
-    public boolean stopHandlerProcessing() {
-        return stopHandlerProcessing ;
-    }
-
 }

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/DataBaseFilterCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/DataBaseFilterCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/DataBaseFilterCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/DataBaseFilterCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -20,8 +20,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 
@@ -30,8 +29,7 @@
   * handles DATA command
  */
 public class DataBaseFilterCmdHandler
-    extends AbstractLogEnabled
-    implements CommandHandler {
+    extends AbstractCommandHandler {
 
     /**
      * process DATA command
@@ -60,14 +58,14 @@
             session.writeResponse(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
         } else if (!session.getState().containsKey(SMTPSession.RCPT_LIST)) {
             responseString = "503 "+DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.DELIVERY_OTHER)+"
No recipients specified";
             session.writeResponse(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
         }
     }
     

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/EhloBaseFilterCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/EhloBaseFilterCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/EhloBaseFilterCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/EhloBaseFilterCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -20,15 +20,14 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 
 /**
   * Handles EHLO command
   */
-public class EhloBaseFilterCmdHandler extends AbstractLogEnabled implements CommandHandler
{
+public class EhloBaseFilterCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler
@@ -56,7 +55,7 @@
             session.writeResponse(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
         }
     }
     

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/HeloBaseFilterCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/HeloBaseFilterCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/HeloBaseFilterCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/HeloBaseFilterCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -21,15 +21,14 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 
 
 /**
   * Handles HELO command
   */
-public class HeloBaseFilterCmdHandler extends AbstractLogEnabled implements CommandHandler
{
+public class HeloBaseFilterCmdHandler extends AbstractCommandHandler {
 
     /**
      * The name of the command handled by the command handler
@@ -58,7 +57,7 @@
             getLogger().info(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
          
         }
     }

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/MailBaseFilterCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/MailBaseFilterCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/MailBaseFilterCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/MailBaseFilterCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -22,8 +22,7 @@
 import java.util.Locale;
 import java.util.StringTokenizer;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 import org.apache.mailet.MailAddress;
@@ -32,8 +31,7 @@
   * Handles MAIL command
   */
 public class MailBaseFilterCmdHandler
-    extends AbstractLogEnabled
-    implements CommandHandler {
+    extends AbstractCommandHandler {
 
     private final static String MAIL_OPTION_SIZE = "SIZE";
 
@@ -67,14 +65,14 @@
             session.writeResponse(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
         } else if (!session.getState().containsKey(SMTPSession.CURRENT_HELO_MODE) &&
session.useHeloEhloEnforcement()) {
             responseString = "503 "+DSNStatus.getStatus(DSNStatus.PERMANENT,DSNStatus.DELIVERY_OTHER)+"
Need HELO or EHLO before MAIL";
             session.writeResponse(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
         } else if (argument == null || !argument.toUpperCase(Locale.US).equals("FROM")
                    || sender == null) {
@@ -82,7 +80,7 @@
             session.writeResponse(responseString);
         
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
         } else {
             sender = sender.trim();
@@ -139,7 +137,7 @@
                     getLogger().error(errorBuffer.toString());
                 }
                 // After this filter match we should not call any other handler!
-                session.setStopHandlerProcessing(true);
+                setStopHandlerProcessing(true);
                 
                 return;
             }
@@ -170,7 +168,7 @@
                     }
                     
                     // After this filter match we should not call any other handler!
-                    session.setStopHandlerProcessing(true);
+                    setStopHandlerProcessing(true);
                     
                     return;
                 }
@@ -200,7 +198,7 @@
             getLogger().error("Rejected syntactically incorrect value for SIZE parameter.");
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
             return false;
         }
@@ -233,7 +231,7 @@
             getLogger().error(errorBuffer.toString());
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
             return false;
         } else {

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/RcptBaseFilterCmdHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/RcptBaseFilterCmdHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/RcptBaseFilterCmdHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/basefilter/RcptBaseFilterCmdHandler.java
Tue Jul  4 23:01:29 2006
@@ -23,8 +23,7 @@
 import java.util.Locale;
 import java.util.StringTokenizer;
 
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 import org.apache.mailet.MailAddress;
@@ -32,8 +31,7 @@
 /**
   * Handles RCPT command
   */
-public class RcptBaseFilterCmdHandler extends AbstractLogEnabled implements
-        CommandHandler {
+public class RcptBaseFilterCmdHandler extends AbstractCommandHandler {
 
 
     /**
@@ -64,7 +62,7 @@
             session.writeResponse(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
         } else if (argument == null || !argument.toUpperCase(Locale.US).equals("TO")
                    || recipient == null) {
@@ -72,7 +70,7 @@
             session.writeResponse(responseString);
             
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
             
         } else {
             Collection rcptColl = (Collection) session.getState().get(SMTPSession.RCPT_LIST);
@@ -103,7 +101,7 @@
                 }
                 
                 // After this filter match we should not call any other handler!
-                session.setStopHandlerProcessing(true);
+                setStopHandlerProcessing(true);
                 
                 return;
             }
@@ -135,7 +133,7 @@
                 }
                 
                 // After this filter match we should not call any other handler!
-                session.setStopHandlerProcessing(true);
+                setStopHandlerProcessing(true);
                 
                 return;
             }
@@ -153,7 +151,7 @@
                 session.writeResponse(responseString);
                 
                 // After this filter match we should not call any other handler!
-                session.setStopHandlerProcessing(true);
+                setStopHandlerProcessing(true);
                 
                 return;
             }
@@ -172,7 +170,7 @@
                         getLogger().error(sb.toString());
                         
                         // After this filter match we should not call any other handler!
-                        session.setStopHandlerProcessing(true);
+                        setStopHandlerProcessing(true);
                         
                         return;
                     }
@@ -198,7 +196,7 @@
                             }
                             
                             // After this filter match we should not call any other handler!
-                            session.setStopHandlerProcessing(true);
+                            setStopHandlerProcessing(true);
                             
                             return;
                         }
@@ -218,7 +216,7 @@
                     getLogger().error(errorBuffer.toString());
                     
                     // After this filter match we should not call any other handler!
-                    session.setStopHandlerProcessing(true);
+                    setStopHandlerProcessing(true);
                     
                     return;
                 }
@@ -248,7 +246,7 @@
                   }
                   
                   // After this filter match we should not call any other handler!
-                  session.setStopHandlerProcessing(true);
+                  setStopHandlerProcessing(true);
                   
               }
               optionTokenizer = null;

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/MaxRcptHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/MaxRcptHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/MaxRcptHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/MaxRcptHandler.java
Tue Jul  4 23:01:29 2006
@@ -20,16 +20,13 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 
-public class MaxRcptHandler extends AbstractLogEnabled implements
-        CommandHandler, Configurable {
+public class MaxRcptHandler extends AbstractCommandHandler {
 
     private int maxRcpt = 0;
 
@@ -77,7 +74,7 @@
             getLogger().error(responseString);
 
             // After this filter match we should not call any other handler!
-            session.setStopHandlerProcessing(true);
+            setStopHandlerProcessing(true);
         }
     }
     
@@ -90,5 +87,4 @@
         
         return implCommands;
     }
-
 }

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ResolvableEhloHeloHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ResolvableEhloHeloHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ResolvableEhloHeloHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ResolvableEhloHeloHandler.java
Tue Jul  4 23:01:29 2006
@@ -17,24 +17,22 @@
 
 package org.apache.james.smtpserver.fastfailfilter;
 
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.james.services.DNSServer;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ResolvableEhloHeloHandler extends AbstractLogEnabled
-        implements CommandHandler, Configurable, Serviceable {
+public class ResolvableEhloHeloHandler extends AbstractCommandHandler implements Configurable,
Serviceable {
 
     private boolean checkAuthNetworks = false;
 
@@ -105,7 +103,7 @@
                 getLogger().info(responseString);
 
                 // After this filter match we should not call any other handler!
-                session.setStopHandlerProcessing(true);
+                setStopHandlerProcessing(true);
             }
         }
     }

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ReverseEqualsEhloHeloHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ReverseEqualsEhloHeloHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ReverseEqualsEhloHeloHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ReverseEqualsEhloHeloHandler.java
Tue Jul  4 23:01:29 2006
@@ -17,24 +17,22 @@
 
 package org.apache.james.smtpserver.fastfailfilter;
 
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.james.services.DNSServer;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ReverseEqualsEhloHeloHandler extends AbstractLogEnabled
-        implements CommandHandler, Configurable, Serviceable {
+public class ReverseEqualsEhloHeloHandler extends AbstractCommandHandler implements Configurable,
Serviceable {
 
     private boolean checkAuthNetworks = false;
 
@@ -52,6 +50,7 @@
         }
     }
 
+
     /**
      * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
      */
@@ -108,7 +107,7 @@
                     getLogger().info(responseString);
 
                     // After this filter match we should not call any other handler!
-                    session.setStopHandlerProcessing(true);
+                    setStopHandlerProcessing(true);
                 }
             } catch (UnknownHostException e) {
                 responseString = "501 "
@@ -120,7 +119,7 @@
                 getLogger().info(responseString);
 
                 // After this filter match we should not call any other handler!
-                session.setStopHandlerProcessing(true);
+                setStopHandlerProcessing(true);
             }
         }
     }
@@ -137,3 +136,4 @@
     }
 
 }
+

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/TarpitHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/TarpitHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/TarpitHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/TarpitHandler.java
Tue Jul  4 23:01:29 2006
@@ -23,12 +23,10 @@
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 
-public class TarpitHandler extends AbstractLogEnabled implements
-        CommandHandler, Configurable {
+public class TarpitHandler extends AbstractCommandHandler implements Configurable {
 
     private int tarpitRcptCount = 0;
 

Modified: james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ValidSenderDomainHandler.java
URL: http://svn.apache.org/viewvc/james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ValidSenderDomainHandler.java?rev=419171&r1=419170&r2=419171&view=diff
==============================================================================
--- james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ValidSenderDomainHandler.java
(original)
+++ james/server/sandbox/handlerapi/src/java/org/apache/james/smtpserver/fastfailfilter/ValidSenderDomainHandler.java
Tue Jul  4 23:01:29 2006
@@ -24,19 +24,17 @@
 import org.apache.avalon.framework.configuration.Configurable;
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
 import org.apache.james.services.DNSServer;
-import org.apache.james.smtpserver.CommandHandler;
+import org.apache.james.smtpserver.AbstractCommandHandler;
 import org.apache.james.smtpserver.SMTPSession;
 import org.apache.james.util.mail.dsn.DSNStatus;
 import org.apache.mailet.MailAddress;
 
 public class ValidSenderDomainHandler
-    extends AbstractLogEnabled
-    implements CommandHandler, Configurable, Serviceable {
+    extends AbstractCommandHandler implements Configurable, Serviceable {
     
     private boolean checkAuthClients = false;
     
@@ -104,7 +102,7 @@
                 getLogger().info(responseString);
                 
                 // After this filter match we should not call any other handler!
-                session.setStopHandlerProcessing(true);
+                setStopHandlerProcessing(true);
             }
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message