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 hb...@apache.org on 2001/04/29 09:42:45 UTC
cvs commit: jakarta-james/src/org/apache/james/nntpserver NNTPHandler.java
hbedi 01/04/29 00:42:45
Modified: src/org/apache/james/nntpserver NNTPHandler.java
Log:
The Hello Name(greeting) is obtained from the configuration file.
james/BaseConnectionHandler handles the hello name and other
ConnectionHandlers derive from it.
Revision Changes Path
1.9 +5 -18 jakarta-james/src/org/apache/james/nntpserver/NNTPHandler.java
Index: NNTPHandler.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/org/apache/james/nntpserver/NNTPHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- NNTPHandler.java 2001/04/28 15:14:38 1.8
+++ NNTPHandler.java 2001/04/29 07:42:44 1.9
@@ -41,6 +41,7 @@
import org.apache.avalon.cornerstone.services.scheduler.TimeScheduler;
import org.apache.avalon.excalibur.collections.ListUtils;
import org.apache.james.Constants;
+import org.apache.james.BaseConnectionHandler;
import org.apache.james.nntpserver.repository.NNTPArticle;
import org.apache.james.nntpserver.repository.NNTPGroup;
import org.apache.james.nntpserver.repository.NNTPLineReaderImpl;
@@ -59,21 +60,17 @@
* @author Fedor Karpelevitch
* @author Harmeet <hb...@apache.org>
*/
-public class NNTPHandler extends AbstractLoggable
- implements ConnectionHandler, Contextualizable, Composable, Configurable, Target {
+public class NNTPHandler extends BaseConnectionHandler
+ implements ConnectionHandler, Composable, Configurable, Target {
// timeout controllers
private TimeScheduler scheduler;
- private int timeout;
// communciation.
private Socket socket;
private BufferedReader reader;
private PrintWriter writer;
- // server greeting.
- private String servername;
-
// authentication.
private AuthState authState;
private boolean authRequired = false;
@@ -83,18 +80,8 @@
private NNTPGroup group;
private NNTPRepository repo;
- public void contextualize( final Context context )
- throws ContextException {
- //System.out.println(getClass().getName()+": contextualize");
- servername = (String)context.get( Constants.HELO_NAME );
- if ( servername == null )
- servername = "NNTPServer";
- }
-
public void configure( Configuration configuration ) throws ConfigurationException {
- //System.out.println(getClass().getName()+": configure");
- //NNTPUtil.show(configuration,System.out);
- timeout = configuration.getChild( "connectiontimeout" ).getValueAsInteger( 120000 );
+ super.configure(configuration);
authRequired=configuration.getChild("authRequired").getValueAsBoolean(false);
authState = new AuthState(authRequired,users);
}
@@ -132,7 +119,7 @@
scheduler.addTrigger( this.toString(), trigger, this );
// section 7.1
- writer.println("200 "+servername+
+ writer.println("200 "+helloName+
(repo.isReadOnly()?" Posting Not Premitted":" Posting Permitted"));
while (parseCommand(reader.readLine()))
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org