wtanaka.praya.zhongwen
Class ZhongWenClient

java.lang.Object
  |
  +--wtanaka.praya.Protocol
        |
        +--wtanaka.praya.zhongwen.ZhongWenClient
All Implemented Interfaces:
java.io.Serializable

public class ZhongWenClient
extends Protocol

This is the main Protocol class for the zhongwen.com protocol implementation.

Return to Sourceforge or the Praya Homepage

Version:
$Name: $ $Date: 2002/07/14 23:16:40 $
Author:
$Author: wtanaka $
See Also:
Serialized Form

Field Summary
private static int CONF_ITEM_COUNT
           
private static int CONF_NAME
           
private static int CONF_STATUS
           
private  ConfigItem[] m_configItems
           
private  ZhongWenWatcher m_thread
           
private  java.lang.Object m_watcherMemento
           
private static java.lang.String STATUS_OFFLINE
           
private static java.lang.String STATUS_ONLINE
           
private static java.lang.String[] statusList
           
 
Fields inherited from class wtanaka.praya.Protocol
descriptionListeners, iAmGarbage, m_buddyList, m_configPanel, m_currentDescription, m_messageListeners, recipientListeners
 
Constructor Summary
ZhongWenClient()
           
 
Method Summary
 void checkForNewMessages(boolean isAutomatic)
          Checks for new messages on the protocol.
 void connect()
          Connects to the network, if that makes any sense.
 CommandInterface[] consoleCommands()
          Returns a list of commands available through this console.
 void disconnect()
          Disconnects from the network, if that makes any sense.
 ConfigItem[] getConfiguration()
           
 Recipient getDefaultRecipient()
           
static java.awt.Image getIcon()
           
 java.lang.String getName()
           
static java.lang.String getProtocolDescription()
          Used to describe the class of this protocol, before any instances have been created.
 boolean isConnected()
          Returns if the protocol is connected right now.
 void sendMessage(java.lang.String msg)
           
 void setStatus(Status status)
          zhongwen.com chat does not support status information, so we ignore this call.
private  void updateDescription(java.lang.String server)
           
 
Methods inherited from class wtanaka.praya.Protocol
addDescriptionListener, addListener, addRecipient, addRecipientListener, changeRecipientStatus, clearBuddyList, console, fireDescriptionChanged, fireRecipientAppeared, fireRecipientChanged, fireRecipientDisappeared, getBuddies, getConfigPanelInstance, getCurrentDescription, getObjInstance, getStatusForBuddy, initialize, isGarbage, markAsGarbage, pushMessage, readObject, removeDescriptionListener, removeListener, removeRecipient, removeRecipientListener, setCurrentDescription, writeObject
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

m_thread

private ZhongWenWatcher m_thread

m_watcherMemento

private java.lang.Object m_watcherMemento

CONF_NAME

private static final int CONF_NAME

CONF_STATUS

private static final int CONF_STATUS

CONF_ITEM_COUNT

private static final int CONF_ITEM_COUNT

m_configItems

private ConfigItem[] m_configItems

STATUS_ONLINE

private static final java.lang.String STATUS_ONLINE

STATUS_OFFLINE

private static final java.lang.String STATUS_OFFLINE

statusList

private static final java.lang.String[] statusList
Constructor Detail

ZhongWenClient

public ZhongWenClient()
Method Detail

getConfiguration

public ConfigItem[] getConfiguration()
Overrides:
getConfiguration in class Protocol
Following copied from class: wtanaka.praya.Protocol
Returns:
(self != null) list of configuration items for this protocol.

checkForNewMessages

public void checkForNewMessages(boolean isAutomatic)
Description copied from class: Protocol
Checks for new messages on the protocol. This might make sense for nntp/usenet, email, etc. but not for irc, gale, zephyr, icq. If any new messages are found, push them.
Overrides:
checkForNewMessages in class Protocol
Following copied from class: wtanaka.praya.Protocol
Parameters:
isAutomatic - true if the check is generated automatically with a timer. false if the check is generated manually by the user.

connect

public void connect()
             throws java.io.IOException
Description copied from class: Protocol
Connects to the network, if that makes any sense. skip if it does not.
Overrides:
connect in class Protocol
Following copied from class: wtanaka.praya.Protocol
Throws:
java.io.IOException - if the connection fails due to an I/O error.
java.lang.InterruptedException - todo, why does it throw this?

disconnect

public void disconnect()
Description copied from class: Protocol
Disconnects from the network, if that makes any sense. skip if it does not.
Overrides:
disconnect in class Protocol

setStatus

public void setStatus(Status status)
zhongwen.com chat does not support status information, so we ignore this call.
Overrides:
setStatus in class Protocol

isConnected

public boolean isConnected()
Description copied from class: Protocol
Returns if the protocol is connected right now. Good for telling if you need to call connect() again after the connection dies.
Overrides:
isConnected in class Protocol

updateDescription

private final void updateDescription(java.lang.String server)

getDefaultRecipient

public Recipient getDefaultRecipient()
Overrides:
getDefaultRecipient in class Protocol

getName

public java.lang.String getName()

sendMessage

public void sendMessage(java.lang.String msg)

consoleCommands

public CommandInterface[] consoleCommands()
Description copied from class: Protocol
Returns a list of commands available through this console.
Overrides:
consoleCommands in class Protocol

getIcon

public static java.awt.Image getIcon()

getProtocolDescription

public static java.lang.String getProtocolDescription()
Used to describe the class of this protocol, before any instances have been created.