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.pop3;
17:
18: /***
19: * POP3Command stores POP3 command code constants.
20: * <p>
21: * <p>
22: * @author Daniel F. Savarese
23: ***/
24:
25: public final class POP3Command {
26: /*** Send user name. ***/
27: public static final int USER = 0;
28: /*** Send password. ***/
29: public static final int PASS = 1;
30: /*** Quit session. ***/
31: public static final int QUIT = 2;
32: /*** Get status. ***/
33: public static final int STAT = 3;
34: /*** List message(s). ***/
35: public static final int LIST = 4;
36: /*** Retrieve message(s). ***/
37: public static final int RETR = 5;
38: /*** Delete message(s). ***/
39: public static final int DELE = 6;
40: /*** No operation. Used as a session keepalive. ***/
41: public static final int NOOP = 7;
42: /*** Reset session. ***/
43: public static final int RSET = 8;
44: /*** Authorization. ***/
45: public static final int APOP = 9;
46: /*** Retrieve top number lines from message. ***/
47: public static final int TOP = 10;
48: /*** List unique message identifier(s). ***/
49: public static final int UIDL = 11;
50:
51: static final String[] _commands = { "USER", "PASS", "QUIT", "STAT",
52: "LIST", "RETR", "DELE", "NOOP", "RSET", "APOP", "TOP",
53: "UIDL" };
54:
55: // Cannot be instantiated.
56: private POP3Command() {
57: }
58:
59: /***
60: * Get the POP3 protocol string command corresponding to a command code.
61: * <p>
62: * @return The POP3 protocol string command corresponding to a command code.
63: ***/
64: public static final String getCommand(int command) {
65: return _commands[command];
66: }
67: }
|