![]() |
Quadcap Embeddable Server |
Definition at line 69 of file Session.java.
Public Member Functions | |
| Session (String host, int port) | |
| Construct a POP3 client object. | |
| int | connect () throws IOException, UnknownHostException |
| Open the socket to the server and return the status code for the server's greeting. | |
| int | getResponse () throws IOException |
| Read a response line from the server. | |
| InputStream | getResponse (boolean get) throws IOException |
| Prepare to read multi-line response. | |
| int | user (String name) throws IOException |
| int | pass (String pass) throws IOException |
| InputStream | list () throws IOException |
| Vector | list (String msg) throws IOException |
| Vector | stat () throws IOException |
| InputStream | uidl () throws IOException |
| Vector | uidl (String msg) throws IOException |
| InputStream | retr (String msg) throws IOException |
| InputStream | retr (int i) throws IOException |
| int | dele (String msg) throws IOException |
| int | dele (int i) throws IOException |
| InputStream | top (String msg, int lines) throws IOException |
| int | rset () throws IOException |
| int | quit () throws IOException |
Static Public Attributes | |
| final int | CR = '\r' |
| Useful constant for CR. | |
| final int | LF = '\n' |
| Useful constant for LF. | |
| final int | OK = 0 |
| Useful constant for OK status. | |
| final int | ERR = 1 |
| Useful constant for ERR status. | |
Package Functions | |
| void | writeCmd (byte[]cmd, String val) throws IOException |
| Write a POP3 command and arguments. | |
| int | simpleCmd (byte[] cmd, String val) throws IOException |
| Execute a simple command which just expects an OR or ERR response. | |
| InputStream | responseCmd (byte[] cmd, String val) throws IOException |
| Execute a command which expects a multi-line response. | |
| Vector | vectorCmd (byte[] cmd, String val) throws IOException |
| Execute a command which needs to parse the response line. | |
Package Attributes | |
| String | host = null |
| server portion of host address. | |
| int | port = -1 |
| the port portion of the host address. | |
| Socket | socket = null |
| Sockect used to communicate with the server. | |
| InputStream | in = null |
| Input (responses) from server. | |
| OutputStream | out = null |
| Output (commands) to the server. | |
| ByteArrayOutputStream | resp = new ByteArrayOutputStream() |
| A temporary area used to collect server responses. | |
| String | response = null |
| The last response, as a string. | |
Static Private Attributes | |
| final byte[] | CRLF = { CR, LF } |
| Handy constant for CRLF sequence. | |
| final byte[] | userBytes |
| The USER command. | |
| final byte[] | passBytes |
| The PASS command. | |
| final byte[] | listBytes |
| The LIST command. | |
| final byte[] | statBytes |
| The STAT command. | |
| final byte[] | uidlBytes |
| The UIDL command. | |
| final byte[] | retrBytes |
| The RETR command. | |
| final byte[] | deleBytes |
| The DELE command. | |
| final byte[] | topBytes |
| The TOP command. | |
| final byte[] | rsetBytes |
| The RSET command. | |
| final byte[] | quitBytes |
| THE QUIT command. | |
| final byte[] | noopBytes |
| The NOOP command. | |
| final byte[] | apopBytes |
| THE APOP command. | |
|
||||||||||||
|
Construct a POP3 client object. Initialize the host/port information, but don't actually open the socket.
Definition at line 112 of file Session.java. |
|
|
Open the socket to the server and return the status code for the server's greeting.
Definition at line 121 of file Session.java. References com.quadcap.pop3.client.Session.getResponse(), com.quadcap.pop3.client.Session.host, com.quadcap.pop3.client.Session.in, com.quadcap.pop3.client.Session.out, com.quadcap.pop3.client.Session.port, and com.quadcap.pop3.client.Session.socket. Referenced by com.quadcap.pop3.client.Pop3Agent.run(), com.quadcap.pop3.client.Agent.run(), and com.quadcap.pop3.client.Test.test0(). |
|
|
Definition at line 294 of file Session.java. |
|
|
Definition at line 291 of file Session.java. References com.quadcap.pop3.client.Session.dele(), and com.quadcap.pop3.client.Session.deleBytes. Referenced by com.quadcap.pop3.client.Session.dele(), com.quadcap.pop3.client.Pop3Agent.deleteMessages(), com.quadcap.pop3.client.Agent.getAndDeleteMail(), and com.quadcap.pop3.client.Pop3Agent.getMessages(). |
|
|
Prepare to read multi-line response. Return an input stream which must be read to actually get the response. Definition at line 188 of file Session.java. References com.quadcap.pop3.client.Session.getResponse(), com.quadcap.pop3.client.Session.in, and com.quadcap.pop3.client.Session.OK. |
|
|
Read a response line from the server. We expect this to be a string of the form '+OK ...' or '-ERR ...'.
Definition at line 152 of file Session.java. References com.quadcap.pop3.client.Session.CR, com.quadcap.pop3.client.Session.ERR, com.quadcap.pop3.client.Session.in, com.quadcap.pop3.client.Session.LF, com.quadcap.pop3.client.Session.OK, com.quadcap.pop3.client.Session.out, com.quadcap.pop3.client.Session.resp, and com.quadcap.pop3.client.Session.response. Referenced by com.quadcap.pop3.client.Session.connect(), com.quadcap.pop3.client.Session.getResponse(), com.quadcap.pop3.client.Session.responseCmd(), com.quadcap.pop3.client.Session.simpleCmd(), and com.quadcap.pop3.client.Session.vectorCmd(). |
|
|
Definition at line 255 of file Session.java. References com.quadcap.pop3.client.Session.listBytes. |
|
|
Definition at line 252 of file Session.java. References com.quadcap.pop3.client.Session.listBytes. Referenced by com.quadcap.pop3.client.Test.test0(). |
|
|
Definition at line 244 of file Session.java. References com.quadcap.pop3.client.Session.pass(), and com.quadcap.pop3.client.Session.passBytes. Referenced by com.quadcap.pop3.client.Session.pass(), com.quadcap.pop3.client.Pop3Agent.run(), com.quadcap.pop3.client.Agent.run(), and com.quadcap.pop3.client.Test.test0(). |
|
|
Definition at line 315 of file Session.java. References com.quadcap.pop3.client.Session.OK, com.quadcap.pop3.client.Session.quitBytes, and com.quadcap.pop3.client.Session.socket. Referenced by com.quadcap.pop3.client.Pop3Agent.run(), com.quadcap.pop3.client.Agent.run(), and com.quadcap.pop3.client.Test.test0(). |
|
||||||||||||
|
Execute a command which expects a multi-line response.
Definition at line 218 of file Session.java. References com.quadcap.pop3.client.Session.getResponse(), and com.quadcap.pop3.client.Session.responseCmd(). Referenced by com.quadcap.pop3.client.Session.responseCmd(). |
|
|
Definition at line 285 of file Session.java. |
|
|
Definition at line 282 of file Session.java. References com.quadcap.pop3.client.Session.retr(), and com.quadcap.pop3.client.Session.retrBytes. Referenced by com.quadcap.pop3.client.Agent.getAndDeleteMail(), com.quadcap.pop3.client.Pop3Agent.getMessages(), com.quadcap.pop3.client.Session.retr(), and com.quadcap.pop3.client.Test.test0(). |
|
|
Definition at line 307 of file Session.java. References com.quadcap.pop3.client.Session.rsetBytes. Referenced by com.quadcap.pop3.client.Test.test0(). |
|
||||||||||||
|
Execute a simple command which just expects an OR or ERR response.
Definition at line 210 of file Session.java. References com.quadcap.pop3.client.Session.getResponse(), and com.quadcap.pop3.client.Session.simpleCmd(). Referenced by com.quadcap.pop3.client.Session.simpleCmd(). |
|
|
Definition at line 263 of file Session.java. References com.quadcap.pop3.client.Session.statBytes. Referenced by com.quadcap.pop3.client.Agent.getAndDeleteMail(), and com.quadcap.pop3.client.Test.test0(). |
|
||||||||||||
|
Definition at line 299 of file Session.java. References com.quadcap.pop3.client.Session.top(), and com.quadcap.pop3.client.Session.topBytes. Referenced by com.quadcap.pop3.client.Pop3Agent.getMessages(), com.quadcap.pop3.client.Test.test0(), and com.quadcap.pop3.client.Session.top(). |
|
|
Definition at line 274 of file Session.java. References com.quadcap.pop3.client.Session.uidlBytes. |
|
|
Definition at line 271 of file Session.java. References com.quadcap.pop3.client.Session.uidlBytes. Referenced by com.quadcap.pop3.client.Pop3Agent.getMail(), and com.quadcap.pop3.client.Test.test0(). |
|
|
Definition at line 236 of file Session.java. References com.quadcap.pop3.client.Session.user(), and com.quadcap.pop3.client.Session.userBytes. Referenced by com.quadcap.pop3.client.Pop3Agent.run(), com.quadcap.pop3.client.Agent.run(), com.quadcap.pop3.client.Test.test0(), and com.quadcap.pop3.client.Session.user(). |
|
||||||||||||
|
Execute a command which needs to parse the response line.
Definition at line 226 of file Session.java. References com.quadcap.pop3.client.Session.getResponse(), com.quadcap.pop3.client.Session.response, and com.quadcap.pop3.client.Session.vectorCmd(). Referenced by com.quadcap.pop3.client.Session.vectorCmd(). |
|
||||||||||||
|
Write a POP3 command and arguments.
Definition at line 201 of file Session.java. References com.quadcap.pop3.client.Session.CRLF, com.quadcap.pop3.client.Session.out, and com.quadcap.pop3.client.Session.writeCmd(). Referenced by com.quadcap.pop3.client.Session.writeCmd(). |
|
|
Initial value: THE APOP command.
Definition at line 330 of file Session.java. |
|
|
Useful constant for CR.
Definition at line 137 of file Session.java. Referenced by com.quadcap.pop3.client.Session.getResponse(). |
|
|
Handy constant for CRLF sequence.
Definition at line 194 of file Session.java. Referenced by com.quadcap.pop3.client.Session.writeCmd(). |
|
|
Initial value: The DELE command.
Definition at line 288 of file Session.java. Referenced by com.quadcap.pop3.client.Session.dele(). |
|
|
Useful constant for ERR status.
Definition at line 144 of file Session.java. Referenced by com.quadcap.pop3.client.Session.getResponse(). |
|
|
server portion of host address.
Definition at line 73 of file Session.java. Referenced by com.quadcap.pop3.client.Session.connect(). |
|
|
Input (responses) from server.
Definition at line 87 of file Session.java. Referenced by com.quadcap.pop3.client.Session.connect(), and com.quadcap.pop3.client.Session.getResponse(). |
|
|
Useful constant for LF.
Definition at line 139 of file Session.java. Referenced by com.quadcap.pop3.client.Session.getResponse(). |
|
|
Initial value: The LIST command.
Definition at line 249 of file Session.java. Referenced by com.quadcap.pop3.client.Session.list(). |
|
|
Initial value: The NOOP command.
Definition at line 325 of file Session.java. |
|
|
Useful constant for OK status.
Definition at line 142 of file Session.java. Referenced by com.quadcap.pop3.client.Session.getResponse(), and com.quadcap.pop3.client.Session.quit(). |
|
|
Output (commands) to the server.
Definition at line 92 of file Session.java. Referenced by com.quadcap.pop3.client.Session.connect(), com.quadcap.pop3.client.Session.getResponse(), and com.quadcap.pop3.client.Session.writeCmd(). |
|
|
Initial value: The PASS command.
Definition at line 241 of file Session.java. Referenced by com.quadcap.pop3.client.Session.pass(). |
|
|
the port portion of the host address.
Definition at line 77 of file Session.java. Referenced by com.quadcap.pop3.client.Session.connect(). |
|
|
Initial value: THE QUIT command.
Definition at line 312 of file Session.java. Referenced by com.quadcap.pop3.client.Session.quit(). |
|
|
A temporary area used to collect server responses.
Definition at line 97 of file Session.java. Referenced by com.quadcap.pop3.client.Session.getResponse(). |
|
|
The last response, as a string.
Definition at line 102 of file Session.java. Referenced by com.quadcap.pop3.client.Session.getResponse(), and com.quadcap.pop3.client.Session.vectorCmd(). |
|
|
Initial value: The RETR command.
Definition at line 279 of file Session.java. Referenced by com.quadcap.pop3.client.Session.retr(). |
|
|
Initial value: The RSET command.
Definition at line 304 of file Session.java. Referenced by com.quadcap.pop3.client.Session.rset(). |
|
|
Sockect used to communicate with the server.
Definition at line 82 of file Session.java. Referenced by com.quadcap.pop3.client.Session.connect(), and com.quadcap.pop3.client.Session.quit(). |
|
|
Initial value: The STAT command.
Definition at line 260 of file Session.java. Referenced by com.quadcap.pop3.client.Session.stat(). |
|
|
Initial value: The TOP command.
Definition at line 297 of file Session.java. Referenced by com.quadcap.pop3.client.Session.top(). |
|
|
Initial value: The UIDL command.
Definition at line 268 of file Session.java. Referenced by com.quadcap.pop3.client.Session.uidl(). |
|
|
Initial value: The USER command.
Definition at line 233 of file Session.java. Referenced by com.quadcap.pop3.client.Session.user(). |