diff -r 6fceb66e1ad7 -r 2fdc9cc89502 org/sonews/daemon/command/QuitCommand.java --- a/org/sonews/daemon/command/QuitCommand.java Fri Jun 26 16:48:50 2009 +0200 +++ b/org/sonews/daemon/command/QuitCommand.java Wed Jul 22 14:04:05 2009 +0200 @@ -19,20 +19,21 @@ package org.sonews.daemon.command; import java.io.IOException; -import java.sql.SQLException; import org.sonews.daemon.NNTPConnection; +import org.sonews.storage.StorageBackendException; /** * Implementation of the QUIT command; client wants to shutdown the connection. * @author Christian Lins * @since sonews/0.5.0 */ -public class QuitCommand extends AbstractCommand +public class QuitCommand implements Command { - public QuitCommand(final NNTPConnection conn) + @Override + public String[] getSupportedCommandStrings() { - super(conn); + return new String[]{"QUIT"}; } @Override @@ -42,13 +43,19 @@ } @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 { - printStatus(205, "cya"); + conn.println("205 cya"); - this.connection.shutdownInput(); - this.connection.shutdownOutput(); + conn.shutdownInput(); + conn.shutdownOutput(); } }