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 no...@apache.org on 2009/10/01 21:05:04 UTC
svn commit: r820752 - in /james/server/trunk:
avalon-socket-library/src/main/java/org/apache/james/socket/
pop3server-function/src/main/java/org/apache/james/pop3server/
pop3server-function/src/main/java/org/apache/james/pop3server/core/
Author: norman
Date: Thu Oct 1 19:05:03 2009
New Revision: 820752
URL: http://svn.apache.org/viewvc?rev=820752&view=rev
Log:
cleanup and javadocs
Modified:
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractCommandDispatcher.java
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractHandlerChain.java
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerChain.java
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerConfigurationData.java
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.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/CapaCapability.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=820752&r1=820751&r2=820752&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 Thu Oct 1 19:05:03 2009
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you 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.socket;
import java.util.ArrayList;
@@ -9,6 +28,11 @@
import org.apache.commons.logging.Log;
+/**
+ * Abstract base class which CommandDispatcher implementations should extend
+ *
+ * @param <CommandHandler>
+ */
public abstract class AbstractCommandDispatcher<CommandHandler extends CommonCommandHandler> implements ExtensibleHandler {
/**
* The list of available command handlers
@@ -108,7 +132,19 @@
}
}
+
+ /**
+ * Return the Log object to use
+ *
+ * @return log
+ */
protected abstract Log getLog();
+
+ /**
+ * Return a List which holds all mandatory commands
+ *
+ * @return mCommands
+ */
protected abstract List<String> getMandatoryCommands();
protected abstract String getUnknownCommandHandlerIdentifier();
protected abstract CommandHandler getUnknownCommandHandler();
Modified: james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractHandlerChain.java
URL: http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractHandlerChain.java?rev=820752&r1=820751&r2=820752&view=diff
==============================================================================
--- james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractHandlerChain.java (original)
+++ james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/AbstractHandlerChain.java Thu Oct 1 19:05:03 2009
@@ -33,6 +33,11 @@
import org.apache.commons.logging.Log;
import org.apache.james.api.kernel.LoaderService;
+/**
+ * Abstract class which HandlerChains should extend
+ *
+ *
+ */
public abstract class AbstractHandlerChain {
protected final List<Object> handlers = new LinkedList<Object>();
@@ -199,13 +204,30 @@
}
}
}
+
+ /**
+ * Configure the chain
+ *
+ * @param commonsConf
+ * @throws Exception
+ */
public void configure(HierarchicalConfiguration commonsConf) throws Exception {
this.commonsConf = commonsConf;
loadHandlers();
wireExtensibleHandlers();
}
+ /**
+ * Return the Class which lists all core commands
+ *
+ * @return class
+ */
protected abstract Class<?> getCoreCmdHandlerLoader();
+ /**
+ * Return the Log to use
+ *
+ * @return log
+ */
protected abstract Log getLog();
}
Modified: james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerChain.java
URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerChain.java?rev=820752&r1=820751&r2=820752&view=diff
==============================================================================
--- james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerChain.java (original)
+++ james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerChain.java Thu Oct 1 19:05:03 2009
@@ -29,7 +29,7 @@
/**
* The POP3HandlerChain is per service object providing access
- * ConnectHandlers, Commandhandlers and message handlers
+ * ConnectHandlers and Commandhandlers
*/
public class POP3HandlerChain extends AbstractHandlerChain implements LogEnabled{
Modified: james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerConfigurationData.java
URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerConfigurationData.java?rev=820752&r1=820751&r2=820752&view=diff
==============================================================================
--- james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerConfigurationData.java (original)
+++ james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3HandlerConfigurationData.java Thu Oct 1 19:05:03 2009
@@ -42,6 +42,11 @@
*/
int getResetLength();
+ /**
+ * Return if starttls is supported by the POP3Server
+ *
+ * @return startTLSSupported
+ */
boolean isStartTLSSupported();
}
Modified: james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java
URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java?rev=820752&r1=820751&r2=820752&view=diff
==============================================================================
--- james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java (original)
+++ james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Server.java Thu Oct 1 19:05:03 2009
@@ -29,7 +29,6 @@
import org.apache.avalon.framework.service.ServiceManager;
import org.apache.commons.logging.impl.AvalonLogger;
import org.apache.james.api.kernel.LoaderService;
-import org.apache.james.api.user.UsersRepository;
import org.apache.james.services.MailServer;
import org.apache.james.socket.AbstractProtocolServer;
import org.apache.james.socket.ProtocolHandler;
@@ -55,10 +54,6 @@
*/
private MailServer mailServer;
- /**
- * The user repository for this server - used to authenticate users.
- */
- private UsersRepository users;
/**
* The number of bytes to read before resetting
@@ -82,9 +77,6 @@
this.mailServer = mailServer;
}
- public void setUsers(UsersRepository users) {
- this.users = users;
- }
/**
* Gets the current instance loader.
* @return the loader
@@ -111,8 +103,6 @@
super.service(componentManager);
MailServer mailServer = (MailServer)componentManager.lookup( MailServer.ROLE );
setMailServer(mailServer);
- UsersRepository users = (UsersRepository)componentManager.lookup( UsersRepository.ROLE );
- setUsers(users);
}
/**
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=820752&r1=820751&r2=820752&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 Thu Oct 1 19:05:03 2009
@@ -158,9 +158,19 @@
*/
OutputStream getOutputStream();
+ /**
+ * Write the response to the client
+ *
+ * @param response
+ */
void writePOP3Response(POP3Response response);
+ /**
+ * Write the response to the client
+ *
+ * @param string
+ */
void writeResponse(String string);
}
Modified: james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCapability.java
URL: http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCapability.java?rev=820752&r1=820751&r2=820752&view=diff
==============================================================================
--- james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCapability.java (original)
+++ james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/core/CapaCapability.java Thu Oct 1 19:05:03 2009
@@ -25,7 +25,7 @@
import org.apache.james.pop3server.POP3Session;
/**
- * A handler which support the POP$ Extension Mechanism should implement this interface
+ * A handler which support the POP3 Extension Mechanism should implement this interface
*
*
*/
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=820752&r1=820751&r2=820752&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 Thu Oct 1 19:05:03 2009
@@ -30,7 +30,7 @@
import org.apache.james.socket.ExtensibleHandler;
import org.apache.james.socket.WiringException;
-public class CapaCmdHandler implements CommandHandler, ExtensibleHandler{
+public class CapaCmdHandler implements CommandHandler, ExtensibleHandler, CapaCapability{
public final static String COMMAND_NAME = "CAPA";
private List<CapaCapability> caps;
@@ -79,4 +79,14 @@
return commands;
}
+
+ /**
+ * @see org.apache.james.pop3server.core.CapaCapability#getImplementedCapabilities(org.apache.james.pop3server.POP3Session)
+ */
+ public List<String> getImplementedCapabilities(POP3Session session) {
+ List<String> cList = new ArrayList<String>();
+ cList.add("PIPELINING");
+ return cList;
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org