ymsg.network.event
Class SessionAdapter

Object
  extended bySessionAdapter
All Implemented Interfaces:
SessionListener
Direct Known Subclasses:
SwingModelFactory

public abstract class SessionAdapter
extends Object
implements SessionListener

Default implementation of the SessionListener.

Since:
1.0

Constructor Summary
SessionAdapter()
           
 
Method Summary
 void buzzReceived(SessionEvent ev)
          Someone has sent us a buzz message.
 void chatConnectionClosed(SessionEvent ev)
          The connection to a chat lobby has been lost.
 void chatLogoffReceived(SessionChatEvent ev)
          Someone has left the chatroom lobby we are currently connected to.
 void chatLogonReceived(SessionChatEvent ev)
          Someone has joined the chatroom lobby we are currently connected to.
 void chatMessageReceived(SessionChatEvent ev)
          Someone has sent a message to the chatroom lobby we are currently connected to.
 void chatUserUpdateReceived(SessionChatEvent ev)
          An update to a chat user's details has been received.
 void conferenceInviteDeclinedReceived(SessionConferenceEvent ev)
          Someone has declined an invite to join our conference.
 void conferenceInviteReceived(SessionConferenceEvent ev)
          Someone is inviting us to join a conference.
 void conferenceLogoffReceived(SessionConferenceEvent ev)
          Someone is leaving a conference we are part of.
 void conferenceLogonReceived(SessionConferenceEvent ev)
          Someone has joined a conference we are part of.
 void conferenceMessageReceived(SessionConferenceEvent ev)
          Someone has sent round a message to the conference members.
 void connectionClosed(SessionEvent ev)
          Yahoo connection broken.
 void contactRejectionReceived(SessionEvent ev)
          Someone has rejected our attempts to add them to our friends list.
 void contactRequestReceived(SessionEvent ev)
          Someone wants to add us to their friends list.
 void errorPacketReceived(SessionErrorEvent ev)
           
 void fileTransferReceived(SessionFileTransferEvent ev)
          This will be called when the API becomes aware that someone is attempting to send us a file.
 void friendAddedReceived(SessionFriendEvent ev)
          Successfully added a friend.
 void friendRemovedReceived(SessionFriendEvent ev)
          Successfully removed a friend.
 void friendsUpdateReceived(SessionFriendEvent ev)
          Friend's details have been updated.
 void inputExceptionThrown(SessionExceptionEvent ev)
          An internal API exception occured on the input thread.
 void listReceived(SessionEvent ev)
          The complete groups/friends list update has been received.
 void messageReceived(SessionEvent ev)
          Someone has sent us an instant messenger (personal) message.
 void newMailReceived(SessionNewMailEvent ev)
          Yahoo tells us we have unread Yahoo mail.
 void notifyReceived(SessionNotifyEvent ev)
          Yahoo server wants to notify us of something.
 void offlineMessageReceived(SessionEvent ev)
          Yahoo tells us about a message sent while we were away.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface SessionListener
errorMessageReceived
 

Constructor Detail

SessionAdapter

public SessionAdapter()
Method Detail

fileTransferReceived

public void fileTransferReceived(SessionFileTransferEvent ev)
Description copied from interface: SessionListener
This will be called when the API becomes aware that someone is attempting to send us a file.

Specified by:
fileTransferReceived in interface SessionListener
Parameters:
ev - The event object

connectionClosed

public void connectionClosed(SessionEvent ev)
Description copied from interface: SessionListener
Yahoo connection broken. This method can be called in four circumstances:
  1. At some point after we call logout on the session, as confirmation that the session is now dead.
  2. At some point before or after login returns, when there has been a problem logging in (for example, incorrect password).
  3. When network problems mean the connection to Yahoo servers is lost.
  4. When Yahoo wishes to throw us off of the system for any reason (for example another client attempts to log in with the same Yahoo id - the original client is terminated.)

Specified by:
connectionClosed in interface SessionListener
Parameters:
ev - The event object

listReceived

public void listReceived(SessionEvent ev)
Description copied from interface: SessionListener
The complete groups/friends list update has been received. This typically is generated sometime after refreshFriends has been called on the Session object. Note: the list is also received as part of the login process, but this API supresses that event if it occures before login has finished (which it always does!)

Specified by:
listReceived in interface SessionListener
Parameters:
ev - The event object

messageReceived

public void messageReceived(SessionEvent ev)
Description copied from interface: SessionListener
Someone has sent us an instant messenger (personal) message.

Specified by:
messageReceived in interface SessionListener
Parameters:
ev - The event object

buzzReceived

public void buzzReceived(SessionEvent ev)
Description copied from interface: SessionListener
Someone has sent us a buzz message. The official Yahoo client prints a 'buzz' type message and jiggles the client IM window for a short time to simulate vibrations. You, however, may choose to handle such messages differently.

Specified by:
buzzReceived in interface SessionListener
Parameters:
ev - The event object

offlineMessageReceived

public void offlineMessageReceived(SessionEvent ev)
Description copied from interface: SessionListener
Yahoo tells us about a message sent while we were away.

Specified by:
offlineMessageReceived in interface SessionListener
Parameters:
ev - The event object

errorPacketReceived

public void errorPacketReceived(SessionErrorEvent ev)

inputExceptionThrown

public void inputExceptionThrown(SessionExceptionEvent ev)
Description copied from interface: SessionListener
An internal API exception occured on the input thread. The input thread runs in parallel with the main application. If it throws an exception there is no direct way to report this to the application layer - this event provides a mechanism for reporting such exceptions. (Under normal circumstances the input thread should never throw exceptions, but just in case...)

Specified by:
inputExceptionThrown in interface SessionListener
Parameters:
ev - The event object

newMailReceived

public void newMailReceived(SessionNewMailEvent ev)
Description copied from interface: SessionListener
Yahoo tells us we have unread Yahoo mail. Note: this informs us of the number of unread e-mails, but documentation suggests that it may alternatively contain the details of an e-mail itself. [*] = These fields are set only if the count, getMail is zero.

Specified by:
newMailReceived in interface SessionListener
Parameters:
ev - The event object

notifyReceived

public void notifyReceived(SessionNotifyEvent ev)
Description copied from interface: SessionListener
Yahoo server wants to notify us of something.

Specified by:
notifyReceived in interface SessionListener
Parameters:
ev - The event object

contactRequestReceived

public void contactRequestReceived(SessionEvent ev)
Description copied from interface: SessionListener
Someone wants to add us to their friends list.

Specified by:
contactRequestReceived in interface SessionListener
Parameters:
ev - The event object

contactRejectionReceived

public void contactRejectionReceived(SessionEvent ev)
Description copied from interface: SessionListener
Someone has rejected our attempts to add them to our friends list.

Specified by:
contactRejectionReceived in interface SessionListener
Parameters:
ev - The event object

conferenceInviteReceived

public void conferenceInviteReceived(SessionConferenceEvent ev)
Description copied from interface: SessionListener
Someone is inviting us to join a conference. Use the Session methods, acceptConferenceInvite to accept or declineSessionInvite to decline.

Specified by:
conferenceInviteReceived in interface SessionListener
Parameters:
ev - The event object

conferenceInviteDeclinedReceived

public void conferenceInviteDeclinedReceived(SessionConferenceEvent ev)
Description copied from interface: SessionListener
Someone has declined an invite to join our conference.

Specified by:
conferenceInviteDeclinedReceived in interface SessionListener
Parameters:
ev - The event object

conferenceLogonReceived

public void conferenceLogonReceived(SessionConferenceEvent ev)
Description copied from interface: SessionListener
Someone has joined a conference we are part of.

Specified by:
conferenceLogonReceived in interface SessionListener
Parameters:
ev - The event object

conferenceLogoffReceived

public void conferenceLogoffReceived(SessionConferenceEvent ev)
Description copied from interface: SessionListener
Someone is leaving a conference we are part of.

Specified by:
conferenceLogoffReceived in interface SessionListener
Parameters:
ev - The event object

conferenceMessageReceived

public void conferenceMessageReceived(SessionConferenceEvent ev)
Description copied from interface: SessionListener
Someone has sent round a message to the conference members.

Specified by:
conferenceMessageReceived in interface SessionListener
Parameters:
ev - The event object

friendsUpdateReceived

public void friendsUpdateReceived(SessionFriendEvent ev)
Description copied from interface: SessionListener
Friend's details have been updated.

Specified by:
friendsUpdateReceived in interface SessionListener
Parameters:
ev - The event object

friendAddedReceived

public void friendAddedReceived(SessionFriendEvent ev)
Description copied from interface: SessionListener
Successfully added a friend.

Specified by:
friendAddedReceived in interface SessionListener
Parameters:
ev - The event object

friendRemovedReceived

public void friendRemovedReceived(SessionFriendEvent ev)
Description copied from interface: SessionListener
Successfully removed a friend.

Specified by:
friendRemovedReceived in interface SessionListener
Parameters:
ev - The event object

chatLogonReceived

public void chatLogonReceived(SessionChatEvent ev)
Description copied from interface: SessionListener
Someone has joined the chatroom lobby we are currently connected to. Note: the protocol supports more than one user listed in a single chat packet (and therefore a single event) - but this facility appears not to be used.

Specified by:
chatLogonReceived in interface SessionListener
Parameters:
ev - The event object

chatLogoffReceived

public void chatLogoffReceived(SessionChatEvent ev)
Description copied from interface: SessionListener
Someone has left the chatroom lobby we are currently connected to. Note: the protocol supports more than one user listed in a single chat packet (and therefore a single event) - but this facility appears not to be used. Also: beware - it appears possible to very occassionally receive logoff packets for users we were never told about in the first place! Perhaps they joined simultaneously with us, and were never included in the initial list of users, or subsequent updates? (Or maybe Yahoo's chat server is buggy!?!!)

Specified by:
chatLogoffReceived in interface SessionListener
Parameters:
ev - The event object

chatMessageReceived

public void chatMessageReceived(SessionChatEvent ev)
Description copied from interface: SessionListener
Someone has sent a message to the chatroom lobby we are currently connected to. Note: the protocol supports more than one user listed in a single chat packet (and therefore a single event) - but this facility appears not to be used. Also: it may be possible to receive messages from users we were never told about - see chatLogoffReceived above. Note: this method will also be called if a packet of code 0x20 is received (an old-style YCHT personal message packet?).

Specified by:
chatMessageReceived in interface SessionListener
Parameters:
ev - The event object

chatUserUpdateReceived

public void chatUserUpdateReceived(SessionChatEvent ev)
Description copied from interface: SessionListener
An update to a chat user's details has been received.

Specified by:
chatUserUpdateReceived in interface SessionListener
Parameters:
ev - The event object

chatConnectionClosed

public void chatConnectionClosed(SessionEvent ev)
Description copied from interface: SessionListener
The connection to a chat lobby has been lost. For example, if the chat system timed us out after a period of inactivity.

Specified by:
chatConnectionClosed in interface SessionListener
Parameters:
ev - The event object