01: /*
02: * Copyright 2001-2005 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
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: public static final int ARTICLE = 0;
30: public static final int BODY = 1;
31: public static final int GROUP = 2;
32: public static final int HEAD = 3;
33: public static final int HELP = 4;
34: public static final int IHAVE = 5;
35: public static final int LAST = 6;
36: public static final int LIST = 7;
37: public static final int NEWGROUPS = 8;
38: public static final int NEWNEWS = 9;
39: public static final int NEXT = 10;
40: public static final int POST = 11;
41: public static final int QUIT = 12;
42: public static final int SLAVE = 13;
43: public static final int STAT = 14;
44: public static final int AUTHINFO = 15;
45: public static final int XOVER = 16;
46: public static final int XHDR = 17;
47:
48: // Cannot be instantiated
49: private NNTPCommand() {
50: }
51:
52: static final String[] _commands = { "ARTICLE", "BODY", "GROUP",
53: "HEAD", "HELP", "IHAVE", "LAST", "LIST", "NEWGROUPS",
54: "NEWNEWS", "NEXT", "POST", "QUIT", "SLAVE", "STAT",
55: "AUTHINFO", "XOVER", "XHDR" };
56:
57: /***
58: * Retrieve the NNTP protocol command string corresponding to a specified
59: * command code.
60: * <p>
61: * @param command The command code.
62: * @return The NNTP protcol command string corresponding to a specified
63: * command code.
64: ***/
65: public static final String getCommand(int command) {
66: return _commands[command];
67: }
68:
69: }
70:
71: /* Emacs configuration
72: * Local variables: **
73: * mode: java **
74: * c-basic-offset: 4 **
75: * indent-tabs-mode: nil **
76: * End: **
77: */
|