ORO, Inc. Logo  All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.oroinc.net.ProtocolCommandSupport

java.lang.Object
   |
   +----com.oroinc.net.ProtocolCommandSupport

public class ProtocolCommandSupport
extends Object
implements Serializable
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.

Copyright © 1997 Original Reusable Objects, Inc. All rights reserved.

See Also:
ProtocolCommandEvent, ProtocolCommandListener

Constructor Index

 o ProtocolCommandSupport(Object)
Creates a ProtocolCommandSupport instant using the indicated source as the source of fired ProtocolCommandEvents.

Method Index

 o addProtocolCommandListener(ProtocolCommandListener)
Adds a ProtocolCommandListener.
 o fireCommandSent(String, String)
Fires a ProtocolCommandEvent signalling the sending of a command to all registered listeners, invoking their protocolCommandSent() methods.
 o fireReplyReceived(int, String)
Fires a ProtocolCommandEvent signalling the reception of a command reply to all registered listeners, invoking their protocolReplyReceived() methods.
 o getListenerCount()
Returns the number of ProtocolCommandListeners currently registered.
 o removeProtocolCommandListener(ProtocolCommandListener)
Removes a ProtocolCommandListener.

Constructors

 o ProtocolCommandSupport
 public ProtocolCommandSupport(Object source)
Creates a ProtocolCommandSupport instant using the indicated source as the source of fired ProtocolCommandEvents.

Parameters:
source - The source to use for all generated ProtocolCommandEvents.

Methods

 o fireCommandSent
 public void fireCommandSent(String command,
                             String message)
Fires a ProtocolCommandEvent signalling the sending of a command to all registered listeners, invoking their protocolCommandSent() methods.

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.
 o fireReplyReceived
 public void fireReplyReceived(int replyCode,
                               String message)
Fires a ProtocolCommandEvent signalling the reception of a command reply to all registered listeners, invoking their protocolReplyReceived() methods.

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.
 o addProtocolCommandListener
 public void addProtocolCommandListener(ProtocolCommandListener listener)
Adds a ProtocolCommandListener.

Parameters:
listener - The ProtocolCommandListener to add.
 o removeProtocolCommandListener
 public void removeProtocolCommandListener(ProtocolCommandListener listener)
Removes a ProtocolCommandListener.

Parameters:
listener - The ProtocolCommandListener to remove.
 o getListenerCount
 public int getListenerCount()
Returns the number of ProtocolCommandListeners currently registered.

Returns:
The number of ProtocolCommandListeners currently registered.

ORO, Inc. Logo  All Packages  Class Hierarchy  This Package  Previous  Next  Index