org.xnap.plugin.joscar
Class JOscarPlugin

java.lang.Object
  extended by org.xnap.plugin.AbstractPlugin
      extended by org.xnap.plugin.joscar.JOscarPlugin
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, JOscarLib.Integration.Event.MessagingListener, JOscarLib.Integration.Event.StatusListener, StateListener, Plugin

public class JOscarPlugin
extends AbstractPlugin
implements StateListener, JOscarLib.Integration.Event.MessagingListener, JOscarLib.Integration.Event.StatusListener, java.beans.PropertyChangeListener

Provides a simple chat plugin for ICQ. This class creates the connection to the oscar server and is responsible of managing the buddies and open chat channels, it also updates the online status of each buddy.


Field Summary
static java.lang.String BUDDY_FILE
           
static javax.swing.Icon ICON_16
           
static java.lang.String ICON_FILENAME
           
 
Constructor Summary
JOscarPlugin()
           
 
Method Summary
 JOscarPeer addBuddy(JOscarPeer buddy)
          Creates a new JOscarPeer if it's not already in the buddies hashtable.
 JOscarPeer addBuddy(java.lang.String uin)
          Creates a new JOscarPeer if it's not already in the buddies hashtable.
 void addChannel(JOscarChannel channel)
           
 JOscarConnection getConnection()
          Returns the oscar connection for listeners to subscribe to.
static JOscarPlugin getInstance()
           
 JOscarPeer getLocalPeer()
          Returns the local peer.
 java.lang.String getName()
          Returns the name of the plugin.
 void onIncomingMessage(JOscarLib.Integration.Event.IncomingMessageEvent event)
          Implements the OscarListener interface.
 void onIncomingUrl(JOscarLib.Integration.Event.IncomingUrlEvent e)
          Implements the OscarListener interface.
 void onIncomingUser(JOscarLib.Integration.Event.IncomingUserEvent e)
          Implements the OscarListener interface.
 void onOffgoingUser(JOscarLib.Integration.Event.OffgoingUserEvent e)
          Implements the OscarListener interface.
 void onOfflineMessage(JOscarLib.Integration.Event.OfflineMessageEvent e)
          Implements the OscarListener interface.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void removeBuddy(JOscarPeer buddy)
          Removes a buddy.
 void removeChannel(JOscarChannel channel)
           
 void sendMessage(java.lang.String uin, java.lang.String message)
           
 void sendSMS(java.lang.String uin, java.lang.String message)
           
 void start()
          Starts the plugin.
 void startGUI()
          Starts the GUI of the plugin.
 void stateChanged(StateEvent event)
          Invoked when the object has changed.
 void stop()
          Stops the plugin.
 void stopGUI()
          Stops the GUI of the plugin.
 
Methods inherited from class org.xnap.plugin.AbstractPlugin
getInfo, setInfo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ICON_FILENAME

public static java.lang.String ICON_FILENAME

ICON_16

public static javax.swing.Icon ICON_16

BUDDY_FILE

public static final java.lang.String BUDDY_FILE
Constructor Detail

JOscarPlugin

public JOscarPlugin()
Method Detail

getInstance

public static JOscarPlugin getInstance()

getName

public java.lang.String getName()
Returns the name of the plugin.


start

public void start()
Starts the plugin.

Specified by:
start in interface Plugin

startGUI

public void startGUI()
Starts the GUI of the plugin.

Specified by:
startGUI in interface Plugin

stop

public void stop()
Stops the plugin. Disposes all singletons.

Specified by:
stop in interface Plugin

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

stateChanged

public void stateChanged(StateEvent event)
Description copied from interface: StateListener
Invoked when the object has changed. Usually if the object is represented on screen the gui needs to be updated.

Specified by:
stateChanged in interface StateListener

stopGUI

public void stopGUI()
Stops the GUI of the plugin.

Specified by:
stopGUI in interface Plugin

sendMessage

public void sendMessage(java.lang.String uin,
                        java.lang.String message)

sendSMS

public void sendSMS(java.lang.String uin,
                    java.lang.String message)

addBuddy

public JOscarPeer addBuddy(java.lang.String uin)
Creates a new JOscarPeer if it's not already in the buddies hashtable.


addBuddy

public JOscarPeer addBuddy(JOscarPeer buddy)
Creates a new JOscarPeer if it's not already in the buddies hashtable.


getLocalPeer

public JOscarPeer getLocalPeer()
Returns the local peer.


getConnection

public JOscarConnection getConnection()
Returns the oscar connection for listeners to subscribe to.


removeBuddy

public void removeBuddy(JOscarPeer buddy)
Removes a buddy.


addChannel

public void addChannel(JOscarChannel channel)

removeChannel

public void removeChannel(JOscarChannel channel)

onIncomingMessage

public void onIncomingMessage(JOscarLib.Integration.Event.IncomingMessageEvent event)
Implements the OscarListener interface.

Specified by:
onIncomingMessage in interface JOscarLib.Integration.Event.MessagingListener

onIncomingUrl

public void onIncomingUrl(JOscarLib.Integration.Event.IncomingUrlEvent e)
Implements the OscarListener interface.

Specified by:
onIncomingUrl in interface JOscarLib.Integration.Event.MessagingListener

onIncomingUser

public void onIncomingUser(JOscarLib.Integration.Event.IncomingUserEvent e)
Implements the OscarListener interface.

Specified by:
onIncomingUser in interface JOscarLib.Integration.Event.StatusListener

onOffgoingUser

public void onOffgoingUser(JOscarLib.Integration.Event.OffgoingUserEvent e)
Implements the OscarListener interface.

Specified by:
onOffgoingUser in interface JOscarLib.Integration.Event.StatusListener

onOfflineMessage

public void onOfflineMessage(JOscarLib.Integration.Event.OfflineMessageEvent e)
Implements the OscarListener interface.

Specified by:
onOfflineMessage in interface JOscarLib.Integration.Event.MessagingListener


Copyright © 2001-2005 XNap Team. All Rights Reserved.