|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the callbacks necessary for the jYMSG API to communitcate with the client employing it. Most of these method will be called as a direct result of 'packets' arriving from the Yahoo server to the client. Note: this API provides an abstract layer of Yahoo's IM protocol - the methods here to do not necessarily map directly to specific 'packet' types.
Because of the baffling array of different types of data which can be
received, the API employs a basic event class, SessionEvent
for many events types, but specific subclasses when particular fields
need to be added. The fields which are 'active' (not null) for any
given event are listed, by way of their accessor methods.
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 |
errorMessageReceived(SessionErrorEvent ev)
A protocol level error occured. |
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. |
Method Detail |
public void fileTransferReceived(SessionFileTransferEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getLocation
- returns the URL of the file
getTimestamp
- returns when the file was sent
getMessage
- returns the accompanying message
ev
- The event objectpublic void connectionClosed(SessionEvent ev)
logout
on the session, as
confirmation that the session is now dead.
login
returns, when there
has been a problem logging in (for example, incorrect password).
ev
- The event objectpublic void listReceived(SessionEvent ev)
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!)
ev
- The event objectpublic void messageReceived(SessionEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getMessage
- returns the accompanying message (Utf8)
ev
- The event objectpublic void buzzReceived(SessionEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getMessage
- returns the accompanying message - 'BUZZ!' (Utf8)
ev
- The event objectpublic void offlineMessageReceived(SessionEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getMessage
- returns the accompanying message (Utf8)
getTimestamp
- returns when the file was sent
ev
- The event objectpublic void errorMessageReceived(SessionErrorEvent ev)
getMessage
- returns the accompanying message, or null (Utf8)
getService
- returns the packet service id, see
ServiceConstants
getCode
- returns a chat error code (purpose unknown) or -1;
ev
- The event objectpublic void inputExceptionThrown(SessionExceptionEvent ev)
getException
- returns the exception object
ev
- The event objectpublic void newMailReceived(SessionNewMailEvent ev)
getMail
- returns the number of unread mail
getFrom
- returns this mail's From field [*]
getMessage
- returns this mail's message text [*]
getSubject
- returns this mail's subject field [*]
getMail
is zero.
ev
- The event objectpublic void notifyReceived(SessionNotifyEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getMode
- returns whether this is an on or off notification
getService
- returns the type of notification (ie: TYPING, GAME)
ev
- The event objectpublic void contactRequestReceived(SessionEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id (them!)
getMessage
- returns the accompanying message
ev
- The event objectpublic void contactRejectionReceived(SessionEvent ev)
getFrom
- returns the sender's Yahoo id
getMessage
- returns the accompanying message
ev
- The event objectpublic void conferenceInviteReceived(SessionConferenceEvent ev)
Session
methods, acceptConferenceInvite
to accept or declineSessionInvite
to decline.
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getTopic
- returns the intive message (see message)
getMessage
- returns the intive message (see topic)
getRoom
- returns the conference name
getUsers
- returns the id's of users invited
ev
- The event objectpublic void conferenceInviteDeclinedReceived(SessionConferenceEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getRoom
- returns the conference name
ev
- The event objectpublic void conferenceLogonReceived(SessionConferenceEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getRoom
- returns the conference name
ev
- The event objectpublic void conferenceLogoffReceived(SessionConferenceEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getRoom
- returns the conference name
ev
- The event objectpublic void conferenceMessageReceived(SessionConferenceEvent ev)
getTo
- returns the target Yahoo id (us!)
getFrom
- returns the sender's Yahoo id
getMessage
- returns the message text (Utf8)
getRoom
- returns the conference name
ev
- The event objectpublic void friendsUpdateReceived(SessionFriendEvent ev)
getFriends
- returns an array of YahooUser
objects detailing the friend users who have changed.
ev
- The event objectpublic void friendAddedReceived(SessionFriendEvent ev)
getFriend
- returns the YahooUser
object
of the friend
getGroup
- returns the group they were added to
ev
- The event objectpublic void friendRemovedReceived(SessionFriendEvent ev)
getFriend
- returns the YahooUser
object
of the friend
getGroup
- returns the group they were removed from
ev
- The event objectpublic void chatLogonReceived(SessionChatEvent ev)
getChatuser/s
- the user (or list of users) who joined.
getLobby
- the chat lobby they joined.
ev
- The event objectpublic void chatLogoffReceived(SessionChatEvent ev)
getChatUser/s
- the user (or list of users) who joined.
getLobby
- the chat lobby they joined.
ev
- The event objectpublic void chatMessageReceived(SessionChatEvent ev)
chatLogoffReceived
above.
getChatuser(s)
- the user (or list of users) who joined.
getLobby
- the chat lobby they joined.
getMessage
- returns the accompanying message
ev
- The event objectpublic void chatUserUpdateReceived(SessionChatEvent ev)
getChatUser
- the updated user.
getLobby
- the chat lobby they're in.
ev
- The event objectpublic void chatConnectionClosed(SessionEvent ev)
getLobby
- the chat lobby just departed.
ev
- The event object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |