|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.email.proxy.imap.ImapConnection
public class ImapConnection
A Socket
wrapper for use by ImapCommands
.
Field Summary | |
---|---|
java.io.BufferedReader |
_in
|
java.io.PrintWriter |
_out
|
protected Logger |
logger
|
Constructor Summary | |
---|---|
ImapConnection(Quittable handler,
java.net.Socket sock,
Environment env)
|
Method Summary | |
---|---|
java.lang.String |
getClientAddress()
Returns identifying information (IP and/or hostname) of the client. |
Environment |
getEnvironment()
returns the environment |
java.io.BufferedReader |
getReader()
Allows reading directly from the input stream. |
void |
print(java.io.Reader in)
Sends the entire contents of a Reader to the client, and closes it. |
void |
print(java.lang.String string)
Sometimes you don't need a newline. |
void |
println(java.lang.String line)
Writes a string and newline to the output stream. |
void |
quit()
Specifies that no more commands should be processed after the current on finishes. |
java.lang.String |
readLine()
Reads a line sent by the client. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.io.PrintWriter _out
public java.io.BufferedReader _in
protected Logger logger
Constructor Detail |
---|
public ImapConnection(Quittable handler, java.net.Socket sock, Environment env) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public void println(java.lang.String line)
Command implementations, in general, should not this method.
They should instead use one of the methods in AbstractImapCommand
.
public void print(java.lang.String string)
Most command implementations should use one of the methods in
AbstractImapCommand
. Some
commands, like FETCH, require complex replies that are best
implemented by writing to an ImapConnection in small chunks.
public void print(java.io.Reader in) throws java.io.IOException
This method is useful for commands like FETCH, which need to send the contents of StoredMessages.
The data written will not be logged
java.io.IOException
public java.io.BufferedReader getReader()
There is only one command at the moment which has a good excuse to use this method: APPEND. If at some point it seems like a good idea to allow IMAP literals in any part of any command, then excuses might be given to other classes.
The data written will not be logged
public java.lang.String readLine() throws java.io.IOException
The only classes with an excuse to use this method at the moment are AppendCommand and ParserImapHandler.
DisconnectedException
- If the socket has been disconnected
java.io.IOException
public void quit()
Quittable.quit()
public java.lang.String getClientAddress()
For debugging/logging only, at present. The output format of this method may change.
public Environment getEnvironment()
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |