Author: norman
Date: Fri Oct  2 15:15:04 2009
New Revision: 821048

URL: http://svn.apache.org/viewvc?rev=821048&view=rev
Log:
add javadocs and cleanup

Modified:
    
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractCommandDispatcher.java
    
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
    
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
    
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCmdHandler.java

Modified: 
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractCommandDispatcher.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractCommandDispatcher.java?rev=821048&r1=821047&r2=821048&view=diff
==============================================================================
--- 
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractCommandDispatcher.java
 (original)
+++ 
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractCommandDispatcher.java
 Fri Oct  2 15:15:04 2009
@@ -146,6 +146,18 @@
      * @return mCommands
      */
     protected abstract List<String> getMandatoryCommands();
+    
+    /**
+     * Return the identifier to lookup the UnknownCmdHandler in the handler map
+     * 
+     * @return identifier
+     */
     protected abstract String getUnknownCommandHandlerIdentifier();
+    
+    /**
+     * Return the CommandHandler which should use to handle unknown commands
+     * 
+     * @return unknownCmdHandler
+     */
     protected abstract CommandHandler getUnknownCommandHandler();
 }

Modified: 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java?rev=821048&r1=821047&r2=821048&view=diff
==============================================================================
--- 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
 (original)
+++ 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Handler.java
 Fri Oct  2 15:15:04 2009
@@ -99,11 +99,6 @@
      */
     private List<Mail> backupUserMailbox;  
 
-    /**
-     * The per-handler response buffer used to marshal responses.
-     */
-    private StringBuilder responseBuffer = new StringBuilder(256);
-
 
     /**
      * The POP3HandlerChain object set by POP3Server
@@ -168,11 +163,17 @@
 
         context.getWatchdog().start();
         while(!sessionEnded) {
-          //parse the command
-          String line =  null;
-         
-          line = readCommandLine();
-        
+            String line = null;
+            // parse the command
+            try {
+                line = context.getInputReader().readLine();
+                if (line != null) {
+                    line = line.trim();
+                }
+            } catch (CRLFTerminatedReader.TerminationException te) {
+                context.writeLoggedFlushedResponse("-ERR Syntax error at 
character position " + te.position() + ". CR and LF must be CRLF paired.  See 
RFC 1939 #3.");
+            }
+
           if (line == null) {
               break;
           }
@@ -244,23 +245,6 @@
         lineHandlers = handlerChain.getHandlers(LineHandler.class);
     }
 
-    /**
-     * Reads a line of characters off the command line.
-     *
-     * @return the trimmed input line
-     * @throws IOException if an exception is generated reading in the input 
characters
-     */
-    private String readCommandLine() throws IOException {
-        for (;;) try {
-            String commandLine = context.getInputReader().readLine();
-            if (commandLine != null) {
-                commandLine = commandLine.trim();
-            }
-            return commandLine;
-        } catch (CRLFTerminatedReader.TerminationException te) {
-            context.writeLoggedFlushedResponse("-ERR Syntax error at character 
position " + te.position() + ". CR and LF must be CRLF paired.  See RFC 1939 
#3.");
-        }
-    }
 
     /**
      * This method parses POP3 commands read off the wire in handleConnection.
@@ -314,15 +298,6 @@
     }
 
     /**
-     * @see org.apache.james.pop3server.POP3Session#clearResponseBuffer()
-     */
-    public String clearResponseBuffer() {
-        String responseString = responseBuffer.toString();
-        responseBuffer.delete(0,responseBuffer.length());
-        return responseString;
-    }
-
-    /**
      * @see org.apache.james.pop3server.POP3Session#getWatchdog()
      */
     public Watchdog getWatchdog() {

Modified: 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java?rev=821048&r1=821047&r2=821048&view=diff
==============================================================================
--- 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
 (original)
+++ 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
 Fri Oct  2 15:15:04 2009
@@ -38,14 +38,6 @@
 public interface POP3Session extends TLSSupportedSession{
 
     /**
-     * Clears the response buffer, returning the String of characters in the 
buffer.
-     *
-     * @return the data in the response buffer
-     */
-    String clearResponseBuffer();
-
-
-    /**
      * Returns host name of the client
      *
      * @return hostname of the client

Modified: 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCmdHandler.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCmdHandler.java?rev=821048&r1=821047&r2=821048&view=diff
==============================================================================
--- 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCmdHandler.java
 (original)
+++ 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCmdHandler.java
 Fri Oct  2 15:15:04 2009
@@ -30,11 +30,18 @@
 import org.apache.james.socket.ExtensibleHandler;
 import org.apache.james.socket.WiringException;
 
+/**
+ * This handler is used to handle CAPA commands
+ *
+ */
 public class CapaCmdHandler implements CommandHandler, ExtensibleHandler, 
CapaCapability{
        public final static String COMMAND_NAME = "CAPA";
        private List<CapaCapability> caps;
 
 
+       /**
+        * @see 
org.apache.james.pop3server.CommandHandler#onCommand(org.apache.james.pop3server.POP3Session,
 java.lang.String, java.lang.String)
+        */
     public POP3Response onCommand(POP3Session session, String command, String 
parameters) {
            POP3Response response = new 
POP3Response(POP3Response.OK_RESPONSE,"Capability list follows");
                



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to