public class ProtocolCommandSupport
extends java.lang.Object
implements java.io.Serializable
构造器和说明 |
---|
ProtocolCommandSupport(java.lang.Object source)
Creates a ProtocolCommandSupport instance using the indicated source
as the source of ProtocolCommandEvents.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addProtocolCommandListener(ProtocolCommandListener listener)
Adds a ProtocolCommandListener.
|
void |
fireCommandSent(java.lang.String command,
java.lang.String message)
Fires a ProtocolCommandEvent signalling the sending of a command to all
registered listeners, invoking their
protocolCommandSent()
methods. |
void |
fireReplyReceived(int replyCode,
java.lang.String message)
Fires a ProtocolCommandEvent signalling the reception of a command reply
to all registered listeners, invoking their
protocolReplyReceived()
methods. |
int |
getListenerCount()
Returns the number of ProtocolCommandListeners currently registered.
|
void |
removeProtocolCommandListener(ProtocolCommandListener listener)
Removes a ProtocolCommandListener.
|
public ProtocolCommandSupport(java.lang.Object source)
source
- The source to use for all generated ProtocolCommandEvents.public void fireCommandSent(java.lang.String command, java.lang.String message)
protocolCommandSent()
methods.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.public void fireReplyReceived(int replyCode, java.lang.String message)
protocolReplyReceived()
methods.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.public void addProtocolCommandListener(ProtocolCommandListener listener)
listener
- The ProtocolCommandListener to add.public void removeProtocolCommandListener(ProtocolCommandListener listener)
listener
- The ProtocolCommandListener to remove.public int getListenerCount()