org/sonews/daemon/command/ModeReaderCommand.java
changeset 3 2fdc9cc89502
parent 1 6fceb66e1ad7
child 20 6ae5e4f8329b
     1.1 --- a/org/sonews/daemon/command/ModeReaderCommand.java	Fri Jun 26 16:48:50 2009 +0200
     1.2 +++ b/org/sonews/daemon/command/ModeReaderCommand.java	Wed Jul 22 14:04:05 2009 +0200
     1.3 @@ -19,8 +19,8 @@
     1.4  package org.sonews.daemon.command;
     1.5  
     1.6  import java.io.IOException;
     1.7 -import java.sql.SQLException;
     1.8  import org.sonews.daemon.NNTPConnection;
     1.9 +import org.sonews.storage.StorageBackendException;
    1.10  
    1.11  /**
    1.12   * Class handling the MODE READER command. This command actually does nothing
    1.13 @@ -28,14 +28,15 @@
    1.14   * @author Christian Lins
    1.15   * @since sonews/0.5.0
    1.16   */
    1.17 -public class ModeReaderCommand extends AbstractCommand
    1.18 +public class ModeReaderCommand implements Command
    1.19  {
    1.20 +  
    1.21 +  @Override
    1.22 +  public String[] getSupportedCommandStrings()
    1.23 +  {
    1.24 +    return new String[]{"MODE"};
    1.25 +  }
    1.26  
    1.27 -  public ModeReaderCommand(final NNTPConnection conn)
    1.28 -  {
    1.29 -    super(conn);
    1.30 -  }
    1.31 -  
    1.32    @Override
    1.33    public boolean hasFinished()
    1.34    {
    1.35 @@ -43,15 +44,22 @@
    1.36    }
    1.37  
    1.38    @Override
    1.39 -  public void processLine(final String line) throws IOException, SQLException
    1.40 +  public boolean isStateful()
    1.41 +  {
    1.42 +    return false;
    1.43 +  }
    1.44 +
    1.45 +  @Override
    1.46 +  public void processLine(NNTPConnection conn, final String line, byte[] raw)
    1.47 +    throws IOException, StorageBackendException
    1.48    {
    1.49      if(line.equalsIgnoreCase("MODE READER"))
    1.50      {
    1.51 -      printStatus(200, "hello you can post");
    1.52 +      conn.println("200 hello you can post");
    1.53      }
    1.54      else
    1.55      {
    1.56 -      printStatus(500, "I do not know this mode command");
    1.57 +      conn.println("500 I do not know this mode command");
    1.58      }
    1.59    }
    1.60