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