1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.net.nntp;
17
18 /***
19 * NNTPCommand stores a set of constants for NNTP command codes. To interpret
20 * the meaning of the codes, familiarity with RFC 977 is assumed.
21 * <p>
22 * @author Daniel F. Savarese
23 * @author Rory Winston
24 * @author Ted Wise
25 ***/
26
27 public final class NNTPCommand
28 {
29
30 public static final int ARTICLE = 0;
31 public static final int BODY = 1;
32 public static final int GROUP = 2;
33 public static final int HEAD = 3;
34 public static final int HELP = 4;
35 public static final int IHAVE = 5;
36 public static final int LAST = 6;
37 public static final int LIST = 7;
38 public static final int NEWGROUPS = 8;
39 public static final int NEWNEWS = 9;
40 public static final int NEXT = 10;
41 public static final int POST = 11;
42 public static final int QUIT = 12;
43 public static final int SLAVE = 13;
44 public static final int STAT = 14;
45 public static final int AUTHINFO = 15;
46 public static final int XOVER = 16;
47 public static final int XHDR = 17;
48
49
50 private NNTPCommand()
51 {}
52
53 static final String[] _commands = {
54 "ARTICLE", "BODY", "GROUP", "HEAD", "HELP", "IHAVE", "LAST", "LIST",
55 "NEWGROUPS", "NEWNEWS", "NEXT", "POST", "QUIT", "SLAVE", "STAT",
56 "AUTHINFO", "XOVER", "XHDR"
57 };
58
59
60 /***
61 * Retrieve the NNTP protocol command string corresponding to a specified
62 * command code.
63 * <p>
64 * @param command The command code.
65 * @return The NNTP protcol command string corresponding to a specified
66 * command code.
67 ***/
68 public static final String getCommand(int command)
69 {
70 return _commands[command];
71 }
72
73 }
74
75
76
77
78
79
80
81