1.1 --- a/org/sonews/daemon/command/CapabilitiesCommand.java Wed Jul 01 10:48:22 2009 +0200
1.2 +++ b/org/sonews/daemon/command/CapabilitiesCommand.java Wed Jul 22 14:04:05 2009 +0200
1.3 @@ -39,20 +39,21 @@
1.4 * @author Christian Lins
1.5 * @since sonews/0.5.0
1.6 */
1.7 -public class CapabilitiesCommand extends AbstractCommand
1.8 +public class CapabilitiesCommand implements Command
1.9 {
1.10
1.11 - protected static final String[] CAPABILITIES = new String[]
1.12 + static final String[] CAPABILITIES = new String[]
1.13 {
1.14 "VERSION 2", // MUST be the first one; VERSION 2 refers to RFC3977
1.15 "READER", // Server implements commands for reading
1.16 "POST", // Server implements POST command
1.17 "OVER" // Server implements OVER command
1.18 };
1.19 -
1.20 - public CapabilitiesCommand(final NNTPConnection conn)
1.21 +
1.22 + @Override
1.23 + public String[] getSupportedCommandStrings()
1.24 {
1.25 - super(conn);
1.26 + return new String[] {"CAPABILITIES"};
1.27 }
1.28
1.29 /**
1.30 @@ -66,15 +67,21 @@
1.31 }
1.32
1.33 @Override
1.34 - public void processLine(final String line)
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
1.43 {
1.44 - printStatus(101, "Capabilities list:");
1.45 + conn.println("101 Capabilities list:");
1.46 for(String cap : CAPABILITIES)
1.47 {
1.48 - println(cap);
1.49 + conn.println(cap);
1.50 }
1.51 - println(".");
1.52 + conn.println(".");
1.53 }
1.54
1.55 }