org.apache.commons.net
public class ProtocolCommandSupport extends Object implements Serializable
See Also: ProtocolCommandEvent ProtocolCommandListener
Constructor Summary | |
---|---|
ProtocolCommandSupport(Object source)
Creates a ProtocolCommandSupport instant using the indicated source
as the source of fired ProtocolCommandEvents.
|
Method Summary | |
---|---|
void | addProtocolCommandListener(ProtocolCommandListener listener)
Adds a ProtocolCommandListener.
|
void | fireCommandSent(String command, String message)
Fires a ProtocolCommandEvent signalling the sending of a command to all
registered listeners, invoking their
{@link org.apache.commons.net.ProtocolCommandListener#protocolCommandSent protocolCommandSent() }
methods.
|
void | fireReplyReceived(int replyCode, String message)
Fires a ProtocolCommandEvent signalling the reception of a command reply
to all registered listeners, invoking their
{@link org.apache.commons.net.ProtocolCommandListener#protocolReplyReceived protocolReplyReceived() }
methods.
|
int | getListenerCount()
Returns the number of ProtocolCommandListeners currently registered.
|
void | removeProtocolCommandListener(ProtocolCommandListener listener)
Removes a ProtocolCommandListener.
|
Parameters: source The source to use for all generated ProtocolCommandEvents.
Parameters: listener The ProtocolCommandListener to add.
Parameters: command The string representation of the command type sent, not including the arguments (e.g., "STAT" or "GET"). message The entire command string verbatim as sent to the server, including all arguments.
Parameters: replyCode The integer code indicating the natureof the reply. This will be the protocol integer value for protocols that use integer reply codes, or the reply class constant corresponding to the reply for protocols like POP3 that use strings like OK rather than integer codes (i.e., POP3Repy.OK). message The entire reply as received from the server.
Returns: The number of ProtocolCommandListeners currently registered.
Parameters: listener The ProtocolCommandListener to remove.