|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--wtanaka.praya.Protocol
Abstract base class for all protocols. This needs to be simplified.
Return to
or the Praya Homepage
| Field Summary | |
private java.util.Vector |
descriptionListeners
|
private boolean |
iAmGarbage
|
private java.util.Hashtable |
m_buddyList
|
protected java.awt.Component |
m_configPanel
|
private java.lang.String |
m_currentDescription
|
private java.util.Vector |
m_messageListeners
|
private java.util.Vector |
recipientListeners
|
| Constructor Summary | |
Protocol()
|
|
| Method Summary | |
void |
addDescriptionListener(ProtocolDescriptionListener list)
|
void |
addListener(Pushable listener)
Adds listener to the list of listeners that get notified when a message is generated from this protocol (i.e. |
protected void |
addRecipient(Recipient r,
Status initial)
Adds a recipient to this protocol's buddy list. |
void |
addRecipientListener(ProtocolRecipientListener list)
|
protected void |
changeRecipientStatus(Recipient r,
Status s)
Changes the status of a recipient in the buddy list, adding the recipient if she doesn't already exist. |
abstract void |
checkForNewMessages(boolean isAutomatic)
Checks for new messages on the protocol. |
void |
clearBuddyList()
Clears the buddy list. |
abstract void |
connect()
Connects to the network, if that makes any sense. |
java.lang.String |
console(java.lang.String command)
Protocol console command handler method. |
abstract CommandInterface[] |
consoleCommands()
Returns a list of commands available through this console. |
abstract void |
disconnect()
Disconnects from the network, if that makes any sense. |
private void |
fireDescriptionChanged(java.lang.String desc)
Send a descriptionChanged to all ProtocolDescriptionListener listeners |
private void |
fireRecipientAppeared(ProtocolRecipientEvent evt)
Maps from Recipient to Status |
private void |
fireRecipientChanged(ProtocolRecipientEvent evt)
|
private void |
fireRecipientDisappeared(ProtocolRecipientEvent evt)
|
java.util.Enumeration |
getBuddies()
Gets the list of Recipient representing the buddies for this Protocol. |
java.awt.Component |
getConfigPanelInstance()
Returns the sole instance of the config panel for this protocol instance, creating a new one if necessary. |
ConfigItem[] |
getConfiguration()
|
java.lang.String |
getCurrentDescription()
Gets the current description. |
abstract Recipient |
getDefaultRecipient()
|
static java.awt.Image |
getIcon()
|
ProtoObj |
getObjInstance(NormalFolder rootFolder)
Returns the sole instance of the ProtoObj for this protocol instance, creating a new one if necessary. |
static java.lang.String |
getProtocolDescription()
Used to describe the class of this protocol, before any instances have been created. |
Status |
getStatusForBuddy(Recipient r)
|
void |
initialize()
Runs any initialization for this protocol after the listener has been added. |
abstract boolean |
isConnected()
Returns if the protocol is connected right now. |
boolean |
isGarbage()
has this protocol been removed from the UI? |
void |
markAsGarbage()
sets this protocol as garbage. |
void |
pushMessage(Message m)
|
private void |
readObject(java.io.ObjectInputStream in)
|
void |
removeDescriptionListener(ProtocolDescriptionListener list)
|
void |
removeListener(Pushable listener)
|
protected void |
removeRecipient(Recipient r)
Removes a recipient from this protocol's buddy list. |
void |
removeRecipientListener(ProtocolRecipientListener list)
|
void |
setCurrentDescription(java.lang.String desc)
This sets the string that is displayed in the titlebar of the console window, next to the protocol (so that you can select it), etc. |
abstract void |
setStatus(Status status)
Sets the currently connected user's status to the given status. |
private void |
writeObject(java.io.ObjectOutputStream out)
|
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private boolean iAmGarbage
private java.util.Vector m_messageListeners
private java.lang.String m_currentDescription
setCurrentDescription(java.lang.String)private java.util.Hashtable m_buddyList
protected java.awt.Component m_configPanel
private java.util.Vector descriptionListeners
private java.util.Vector recipientListeners
| Constructor Detail |
public Protocol()
| Method Detail |
private void writeObject(java.io.ObjectOutputStream out)
throws java.io.IOException
private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
public void initialize()
public abstract void disconnect()
public abstract void connect()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOException - if the connection fails due to an I/O error.java.lang.InterruptedException - todo, why does it throw this?
public abstract void setStatus(Status status)
throws java.io.IOException
public abstract boolean isConnected()
public ConfigItem[] getConfiguration()
public java.awt.Component getConfigPanelInstance()
public ProtoObj getObjInstance(NormalFolder rootFolder)
public abstract void checkForNewMessages(boolean isAutomatic)
throws java.io.IOException
isAutomatic - true if the check is generated automatically with a
timer. false if the check is generated manually by the user.public void addListener(Pushable listener)
public void removeListener(Pushable listener)
public void pushMessage(Message m)
public final void addDescriptionListener(ProtocolDescriptionListener list)
public final void removeDescriptionListener(ProtocolDescriptionListener list)
private final void fireDescriptionChanged(java.lang.String desc)
public void setCurrentDescription(java.lang.String desc)
getCurrentDescription()public java.lang.String getCurrentDescription()
setCurrentDescription(java.lang.String)public final void addRecipientListener(ProtocolRecipientListener list)
public final void removeRecipientListener(ProtocolRecipientListener list)
private void fireRecipientAppeared(ProtocolRecipientEvent evt)
private void fireRecipientDisappeared(ProtocolRecipientEvent evt)
private void fireRecipientChanged(ProtocolRecipientEvent evt)
protected void addRecipient(Recipient r,
Status initial)
protected void removeRecipient(Recipient r)
protected void changeRecipientStatus(Recipient r,
Status s)
public java.util.Enumeration getBuddies()
Recipientpublic Status getStatusForBuddy(Recipient r)
public void clearBuddyList()
public abstract Recipient getDefaultRecipient()
public void markAsGarbage()
public boolean isGarbage()
public final java.lang.String console(java.lang.String command)
throws IllegalCommandException,
java.io.IOException
IllegalCommandException - if the command is invalidjava.io.IOException - if an i/o exception occurs processing the
command.consoleCommands()public abstract CommandInterface[] consoleCommands()
public static java.awt.Image getIcon()
public static java.lang.String getProtocolDescription()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||