| java.lang.Object org.apache.commons.net.SocketClient org.apache.commons.net.pop3.POP3
All known Subclasses: org.apache.commons.net.pop3.POP3Client,
POP3 | public class POP3 extends SocketClient (Code) | | The POP3 class is not meant to be used by itself and is provided
only so that you may easily implement your own POP3 client if
you so desire. If you have no need to perform your own implementation,
you should use
org.apache.commons.net.pop3.POP3Client .
Rather than list it separately for each method, we mention here that
every method communicating with the server and throwing an IOException
can also throw a
org.apache.commons.net.MalformedServerReplyException , which is a subclass
of IOException. A MalformedServerReplyException will be thrown when
the reply received from the server deviates enough from the protocol
specification that it cannot be interpreted in a useful manner despite
attempts to be as lenient as possible.
author: Daniel F. Savarese See Also: POP3Client See Also: org.apache.commons.net.MalformedServerReplyException |
Constructor Summary | |
public | POP3() The default POP3Client constructor. |
Method Summary | |
protected void | _connectAction_() Performs connection initialization and sets state to
AUTHORIZATION_STATE . | public void | addProtocolCommandListener(ProtocolCommandListener listener) Adds a ProtocolCommandListener. | public void | disconnect() Disconnects the client from the server, and sets the state to
DISCONNECTED_STATE . | public void | getAdditionalReply() Retrieves the additional lines of a multi-line server reply. | public String | getReplyString() Returns the reply to the last command sent to the server.
The value is a single string containing all the reply lines including
newlines. | public String[] | getReplyStrings() Returns an array of lines received as a reply to the last command
sent to the server. | public int | getState() Returns the current POP3 client state. | public void | removeProtocolCommandistener(ProtocolCommandListener listener) Removes a ProtocolCommandListener. | public int | sendCommand(String command, String args) Sends a command an arguments to the server and returns the reply code.
Parameters: command - The POP3 command to send. Parameters: args - The command arguments. | public int | sendCommand(String command) Sends a command with no arguments to the server and returns the
reply code.
Parameters: command - The POP3 command to send. | public int | sendCommand(int command, String args) Sends a command an arguments to the server and returns the reply code.
Parameters: command - The POP3 command to send(one of the POP3Command constants). Parameters: args - The command arguments. | public int | sendCommand(int command) Sends a command with no arguments to the server and returns the
reply code.
Parameters: command - The POP3 command to send(one of the POP3Command constants). | public void | setState(int state) Sets POP3 client state. |
AUTHORIZATION_STATE | final public static int AUTHORIZATION_STATE(Code) | | A constant representing the POP3 authorization state. **
|
DEFAULT_PORT | final public static int DEFAULT_PORT(Code) | | The default POP3 port. Set to 110 according to RFC 1288. **
|
DISCONNECTED_STATE | final public static int DISCONNECTED_STATE(Code) | | A constant representing the state where the client is not yet connected
to a POP3 server.
|
TRANSACTION_STATE | final public static int TRANSACTION_STATE(Code) | | A constant representing the POP3 transaction state. **
|
UPDATE_STATE | final public static int UPDATE_STATE(Code) | | A constant representing the POP3 update state. **
|
_commandSupport_ | protected ProtocolCommandSupport _commandSupport_(Code) | | A ProtocolCommandSupport object used to manage the registering of
ProtocolCommandListeners and te firing of ProtocolCommandEvents.
|
_replyCode | int _replyCode(Code) | | |
POP3 | public POP3()(Code) | | The default POP3Client constructor. Initializes the state
to DISCONNECTED_STATE .
|
_connectAction_ | protected void _connectAction_() throws IOException(Code) | | Performs connection initialization and sets state to
AUTHORIZATION_STATE .
|
addProtocolCommandListener | public void addProtocolCommandListener(ProtocolCommandListener listener)(Code) | | Adds a ProtocolCommandListener. Delegates this task to
POP3._commandSupport_ _commandSupport_ .
Parameters: listener - The ProtocolCommandListener to add. |
disconnect | public void disconnect() throws IOException(Code) | | Disconnects the client from the server, and sets the state to
DISCONNECTED_STATE . The reply text information
from the last issued command is voided to allow garbage collection
of the memory used to store that information.
exception: IOException - If there is an error in disconnecting. |
getAdditionalReply | public void getAdditionalReply() throws IOException(Code) | | Retrieves the additional lines of a multi-line server reply.
|
getReplyString | public String getReplyString()(Code) | | Returns the reply to the last command sent to the server.
The value is a single string containing all the reply lines including
newlines. If the reply is a single line, but its format ndicates it
should be a multiline reply, then you must call
POP3.getAdditionalReply getAdditionalReply() to
fetch the rest of the reply, and then call getReplyString
again. You only have to worry about this if you are implementing
your own client using the
POP3.sendCommand sendCommand methods.
The last server response. |
getReplyStrings | public String[] getReplyStrings()(Code) | | Returns an array of lines received as a reply to the last command
sent to the server. The lines have end of lines truncated. If
the reply is a single line, but its format ndicates it should be
a multiline reply, then you must call
POP3.getAdditionalReply getAdditionalReply() to
fetch the rest of the reply, and then call getReplyStrings
again. You only have to worry about this if you are implementing
your own client using the
POP3.sendCommand sendCommand methods.
The last server response. |
getState | public int getState()(Code) | | Returns the current POP3 client state.
The current POP3 client state. |
removeProtocolCommandistener | public void removeProtocolCommandistener(ProtocolCommandListener listener)(Code) | | Removes a ProtocolCommandListener. Delegates this task to
POP3._commandSupport_ _commandSupport_ .
Parameters: listener - The ProtocolCommandListener to remove. |
sendCommand | public int sendCommand(String command, String args) throws IOException(Code) | | Sends a command an arguments to the server and returns the reply code.
Parameters: command - The POP3 command to send. Parameters: args - The command arguments. The server reply code (either POP3Reply.OK or POP3Reply.ERROR). |
sendCommand | public int sendCommand(String command) throws IOException(Code) | | Sends a command with no arguments to the server and returns the
reply code.
Parameters: command - The POP3 command to send. The server reply code (either POP3Reply.OK or POP3Reply.ERROR). |
sendCommand | public int sendCommand(int command, String args) throws IOException(Code) | | Sends a command an arguments to the server and returns the reply code.
Parameters: command - The POP3 command to send(one of the POP3Command constants). Parameters: args - The command arguments. The server reply code (either POP3Reply.OK or POP3Reply.ERROR). |
sendCommand | public int sendCommand(int command) throws IOException(Code) | | Sends a command with no arguments to the server and returns the
reply code.
Parameters: command - The POP3 command to send(one of the POP3Command constants). The server reply code (either POP3Reply.OK or POP3Reply.ERROR). |
setState | public void setState(int state)(Code) | | Sets POP3 client state. This must be one of the
_STATE constants.
Parameters: state - The new state. |
Methods inherited from org.apache.commons.net.SocketClient | protected void _connectAction_() throws IOException(Code)(Java Doc) public void connect(InetAddress host, int port) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname, int port) throws SocketException, IOException(Code)(Java Doc) public void connect(InetAddress host, int port, InetAddress localAddr, int localPort) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname, int port, InetAddress localAddr, int localPort) throws SocketException, IOException(Code)(Java Doc) public void connect(InetAddress host) throws SocketException, IOException(Code)(Java Doc) public void connect(String hostname) throws SocketException, IOException(Code)(Java Doc) public void disconnect() throws IOException(Code)(Java Doc) public int getDefaultPort()(Code)(Java Doc) public int getDefaultTimeout()(Code)(Java Doc) public InetAddress getLocalAddress()(Code)(Java Doc) public int getLocalPort()(Code)(Java Doc) public InetAddress getRemoteAddress()(Code)(Java Doc) public int getRemotePort()(Code)(Java Doc) public int getSoLinger() throws SocketException(Code)(Java Doc) public int getSoTimeout() throws SocketException(Code)(Java Doc) public boolean getTcpNoDelay() throws SocketException(Code)(Java Doc) public boolean isConnected()(Code)(Java Doc) public void setDefaultPort(int port)(Code)(Java Doc) public void setDefaultTimeout(int timeout)(Code)(Java Doc) public void setSoLinger(boolean on, int val) throws SocketException(Code)(Java Doc) public void setSoTimeout(int timeout) throws SocketException(Code)(Java Doc) public void setSocketFactory(SocketFactory factory)(Code)(Java Doc) public void setTcpNoDelay(boolean on) throws SocketException(Code)(Java Doc) public boolean verifyRemote(Socket socket)(Code)(Java Doc)
|
|
|