commLibs
Class YahooLib

java.lang.Object
  |
  +--ymsg.network.event.SessionAdapter
        |
        +--commLibs.YahooLib
All Implemented Interfaces:
CommLib, ymsg.network.event.SessionListener

public class YahooLib
extends ymsg.network.event.SessionAdapter
implements CommLib

yahooLib implements the Yahoo Messanger protocal within the specification of the CommLib interface. This class relies on the jYMSG library found on Sourceforge ( http://sourceforge.net/projects/jymsg9/).

Author:
Ryan Michela

Constructor Summary
YahooLib()
           
 
Method Summary
 void bindCallback(CommLibCallback callback)
          Binds the communication library to a callback object.
 void buzzReceived(ymsg.network.event.SessionEvent msg)
           
 boolean connect(String loggin, String password)
          Establishes a connection to the IM server.
 void disconnect()
          Terminates connection to the IM server.
 void doPing()
          Force the CommLib to ping its connection.
 void errorPacketReceived(ymsg.network.event.SessionErrorEvent e)
           
 String getWarningLevel()
          Gets the current warning level of this account.
 String identifyProtocal()
          Returns a string identifying the protocal this library implements.
 void inputExceptionThrown(ymsg.network.event.SessionExceptionEvent e)
           
 void messageReceived(ymsg.network.event.SessionEvent msg)
           
 void sendMessage(IM message)
          Sends an instant message over the network.
 void sendWarning(String screenName, boolean anonymous)
          Attempts to warn an individual.
 
Methods inherited from class ymsg.network.event.SessionAdapter
chatConnectionClosed, chatLogoffReceived, chatLogonReceived, chatMessageReceived, chatUserUpdateReceived, conferenceInviteReceived, conferenceLogoffReceived, conferenceLogonReceived, conferenceMessageReceived, connectionClosed, contactRejectionReceived, contactRequestReceived, fileTransferReceived, friendAddedReceived, friendRemovedReceived, friendsUpdateReceived, listReceived, newMailReceived, notifyReceived, offlineMessageReceived
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YahooLib

public YahooLib()
Method Detail

bindCallback

public void bindCallback(CommLibCallback callback)
Description copied from interface: CommLib
Binds the communication library to a callback object.

Specified by:
bindCallback in interface CommLib
Parameters:
callback -

connect

public boolean connect(String loggin,
                       String password)
Description copied from interface: CommLib
Establishes a connection to the IM server.

Specified by:
connect in interface CommLib
Parameters:
loggin -
password -
Returns:
TRUE if successfull. FALSE if not.

disconnect

public void disconnect()
Description copied from interface: CommLib
Terminates connection to the IM server.

Specified by:
disconnect in interface CommLib

sendMessage

public void sendMessage(IM message)
Description copied from interface: CommLib
Sends an instant message over the network.

Specified by:
sendMessage in interface CommLib
Parameters:
message -

sendWarning

public void sendWarning(String screenName,
                        boolean anonymous)
Description copied from interface: CommLib
Attempts to warn an individual. May not have an effect on all networks.

Specified by:
sendWarning in interface CommLib
Parameters:
screenName - The target.
anonymous - If true, attempt to warn anonymously.

getWarningLevel

public String getWarningLevel()
Description copied from interface: CommLib
Gets the current warning level of this account.

Specified by:
getWarningLevel in interface CommLib
Returns:
"###" if warning level supported, "N/A" if not.

identifyProtocal

public String identifyProtocal()
Description copied from interface: CommLib
Returns a string identifying the protocal this library implements.

Specified by:
identifyProtocal in interface CommLib
Returns:
The protocal string.

doPing

public void doPing()
Description copied from interface: CommLib

Force the CommLib to ping its connection.

This will always be called from the connection maintnance thread, thus, the doPing implementation must block until the action is complete. The spirit of this method is to attempt to send a self addressed message, and reconnect to the network if the message fails to come through.

Specified by:
doPing in interface CommLib

buzzReceived

public void buzzReceived(ymsg.network.event.SessionEvent msg)
Specified by:
buzzReceived in interface ymsg.network.event.SessionListener
Overrides:
buzzReceived in class ymsg.network.event.SessionAdapter

messageReceived

public void messageReceived(ymsg.network.event.SessionEvent msg)
Specified by:
messageReceived in interface ymsg.network.event.SessionListener
Overrides:
messageReceived in class ymsg.network.event.SessionAdapter

errorPacketReceived

public void errorPacketReceived(ymsg.network.event.SessionErrorEvent e)
Specified by:
errorPacketReceived in interface ymsg.network.event.SessionListener
Overrides:
errorPacketReceived in class ymsg.network.event.SessionAdapter

inputExceptionThrown

public void inputExceptionThrown(ymsg.network.event.SessionExceptionEvent e)
Specified by:
inputExceptionThrown in interface ymsg.network.event.SessionListener
Overrides:
inputExceptionThrown in class ymsg.network.event.SessionAdapter