wtanaka.praya.msn
Class MsnClient

java.lang.Object
  |
  +--wtanaka.praya.Protocol
        |
        +--wtanaka.praya.msn.MsnClient
All Implemented Interfaces:
MsnConstants, java.io.Serializable

public class MsnClient
extends Protocol
implements MsnConstants

MSN Messenger Client Library using crunchybear.com.

Return to Sourceforge or the Praya Homepage

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

Inner Class Summary
private  class MsnClient.MainListener
          MainConnectionListener
 
Field Summary
static int CONF_ID
           
static int CONF_ITEM_COUNT
           
static int CONF_PASSWD
           
static int CONF_REALNAME
           
static int CONF_STATUS
           
private  ConfigItem[] m_configItems
           
private  boolean m_firstConnect
           
private  boolean m_isConnected
           
private  MainConnection m_mainConnection
           
private  java.util.Hashtable m_sessions
          Set of SessionConnection (map of SessionConnection to itself)
static int SO_TIMEOUT
           
static java.lang.String[] statusList
          List of visible strings, in any order, corresponding to the status configuration pulldown menu.
 
Fields inherited from class wtanaka.praya.Protocol
descriptionListeners, iAmGarbage, m_buddyList, m_configPanel, m_currentDescription, m_messageListeners, recipientListeners
 
Fields inherited from interface wtanaka.praya.msn.MsnConstants
ALLOW_LIST, AWY, BLOCK_LIST, BRB, BSY, FLN, FORWARD_LIST, HDN, IDL, LUN, NLN, PHN, REVERSE_LIST
 
Constructor Summary
MsnClient()
          Constructor
 
Method Summary
(package private)  java.lang.String byteArrayToString(byte[] array)
           
 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 getPassword()
           
static java.lang.String getProtocolDescription()
          Used to describe the class of this protocol, before any instances have been created.
 java.lang.String getUsername()
           
 boolean isConnected()
          Returns if the protocol is connected right now.
 void sendMessage(java.lang.String username, java.lang.Object message)
          Sends a message to the given username
 void setRealName(java.lang.String realname)
           
 void setStatus(Status status)
          Sets the status.
 void setUsername(java.lang.String username)
           
 
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

SO_TIMEOUT

public static final int SO_TIMEOUT

CONF_ID

public static final int CONF_ID

CONF_PASSWD

public static final int CONF_PASSWD

CONF_STATUS

public static final int CONF_STATUS

CONF_REALNAME

public static final int CONF_REALNAME

CONF_ITEM_COUNT

public static final int CONF_ITEM_COUNT

m_configItems

private ConfigItem[] m_configItems

m_firstConnect

private boolean m_firstConnect

m_isConnected

private boolean m_isConnected

m_mainConnection

private MainConnection m_mainConnection

m_sessions

private java.util.Hashtable m_sessions
Set of SessionConnection (map of SessionConnection to itself)

statusList

public static final java.lang.String[] statusList
List of visible strings, in any order, corresponding to the status configuration pulldown menu.
Constructor Detail

MsnClient

public MsnClient()
Constructor
Method Detail

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.

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.

getDefaultRecipient

public Recipient getDefaultRecipient()
Overrides:
getDefaultRecipient in class Protocol

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)
               throws java.io.IOException
Sets the status.
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

byteArrayToString

java.lang.String byteArrayToString(byte[] array)

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.

consoleCommands

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

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String username)

setRealName

public void setRealName(java.lang.String realname)

getPassword

public java.lang.String getPassword()

sendMessage

public void sendMessage(java.lang.String username,
                        java.lang.Object message)
                 throws NotSentException
Sends a message to the given username