org/sonews/daemon/command/QuitCommand.java
changeset 3 2fdc9cc89502
parent 1 6fceb66e1ad7
child 20 6ae5e4f8329b
     1.1 --- a/org/sonews/daemon/command/QuitCommand.java	Fri Jun 26 16:48:50 2009 +0200
     1.2 +++ b/org/sonews/daemon/command/QuitCommand.java	Wed Jul 22 14:04:05 2009 +0200
     1.3 @@ -19,20 +19,21 @@
     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   * Implementation of the QUIT command; client wants to shutdown the connection.
    1.13   * @author Christian Lins
    1.14   * @since sonews/0.5.0
    1.15   */
    1.16 -public class QuitCommand extends AbstractCommand
    1.17 +public class QuitCommand implements Command
    1.18  {
    1.19  
    1.20 -  public QuitCommand(final NNTPConnection conn)
    1.21 +  @Override
    1.22 +  public String[] getSupportedCommandStrings()
    1.23    {
    1.24 -    super(conn);
    1.25 +    return new String[]{"QUIT"};
    1.26    }
    1.27    
    1.28    @Override
    1.29 @@ -42,13 +43,19 @@
    1.30    }
    1.31  
    1.32    @Override
    1.33 -  public void processLine(final String line) 
    1.34 -    throws IOException, SQLException
    1.35 +  public boolean isStateful()
    1.36 +  {
    1.37 +    return false;
    1.38 +  }
    1.39 +
    1.40 +  @Override
    1.41 +  public void processLine(NNTPConnection conn, final String line, byte[] raw)
    1.42 +    throws IOException, StorageBackendException
    1.43    {    
    1.44 -    printStatus(205, "cya");
    1.45 +    conn.println("205 cya");
    1.46      
    1.47 -    this.connection.shutdownInput();
    1.48 -    this.connection.shutdownOutput();
    1.49 +    conn.shutdownInput();
    1.50 +    conn.shutdownOutput();
    1.51    }
    1.52  
    1.53  }