| java.lang.Object org.apache.commons.net.ProtocolCommandSupport
ProtocolCommandSupport | public class ProtocolCommandSupport implements Serializable(Code) | | ProtocolCommandSupport is a convenience class for managing a list of
ProtocolCommandListeners and firing ProtocolCommandEvents. You can
simply delegate ProtocolCommandEvent firing and listener
registering/unregistering tasks to this class.
See Also: ProtocolCommandEvent See Also: ProtocolCommandListener author: Daniel F. Savarese |
Constructor Summary | |
public | ProtocolCommandSupport(Object source) Creates a ProtocolCommandSupport instant using the indicated source
as the source of fired ProtocolCommandEvents. |
ProtocolCommandSupport | public ProtocolCommandSupport(Object source)(Code) | | Creates a ProtocolCommandSupport instant using the indicated source
as the source of fired ProtocolCommandEvents.
Parameters: source - The source to use for all generated ProtocolCommandEvents. |
addProtocolCommandListener | public void addProtocolCommandListener(ProtocolCommandListener listener)(Code) | | Adds a ProtocolCommandListener.
Parameters: listener - The ProtocolCommandListener to add. |
fireCommandSent | public void fireCommandSent(String command, String message)(Code) | | Fires a ProtocolCommandEvent signalling the sending of a command to all
registered listeners, invoking their
org.apache.commons.net.ProtocolCommandListener.protocolCommandSent protocolCommandSent() methods.
Parameters: command - The string representation of the command type sent, notincluding the arguments (e.g., "STAT" or "GET"). Parameters: message - The entire command string verbatim as sent to the server,including all arguments. |
fireReplyReceived | public void fireReplyReceived(int replyCode, String message)(Code) | | Fires a ProtocolCommandEvent signalling the reception of a command reply
to all registered listeners, invoking their
org.apache.commons.net.ProtocolCommandListener.protocolReplyReceived protocolReplyReceived() methods.
Parameters: replyCode - The integer code indicating the natureof the reply.This will be the protocol integer value for protocolsthat use integer reply codes, or the reply class constantcorresponding to the reply for protocols like POP3 that usestrings like OK rather than integer codes (i.e., POP3Repy.OK). Parameters: message - The entire reply as received from the server. |
getListenerCount | public int getListenerCount()(Code) | | Returns the number of ProtocolCommandListeners currently registered.
The number of ProtocolCommandListeners currently registered. |
removeProtocolCommandListener | public void removeProtocolCommandListener(ProtocolCommandListener listener)(Code) | | Removes a ProtocolCommandListener.
Parameters: listener - The ProtocolCommandListener to remove. |
|
|