diff -r 6fceb66e1ad7 -r 91dc9acb03ed org/sonews/daemon/command/ModeReaderCommand.java --- a/org/sonews/daemon/command/ModeReaderCommand.java Fri Jun 26 16:48:50 2009 +0200 +++ b/org/sonews/daemon/command/ModeReaderCommand.java Fri Aug 21 17:40:54 2009 +0200 @@ -19,8 +19,8 @@ package org.sonews.daemon.command; import java.io.IOException; -import java.sql.SQLException; import org.sonews.daemon.NNTPConnection; +import org.sonews.storage.StorageBackendException; /** * Class handling the MODE READER command. This command actually does nothing @@ -28,14 +28,15 @@ * @author Christian Lins * @since sonews/0.5.0 */ -public class ModeReaderCommand extends AbstractCommand +public class ModeReaderCommand implements Command { + + @Override + public String[] getSupportedCommandStrings() + { + return new String[]{"MODE"}; + } - public ModeReaderCommand(final NNTPConnection conn) - { - super(conn); - } - @Override public boolean hasFinished() { @@ -43,15 +44,22 @@ } @Override - public void processLine(final String line) throws IOException, SQLException + public boolean isStateful() + { + return false; + } + + @Override + public void processLine(NNTPConnection conn, final String line, byte[] raw) + throws IOException, StorageBackendException { if(line.equalsIgnoreCase("MODE READER")) { - printStatus(200, "hello you can post"); + conn.println("200 hello you can post"); } else { - printStatus(500, "I do not know this mode command"); + conn.println("500 I do not know this mode command"); } }