|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object EventObject SessionEvent SessionNotifyEvent
Represents an incoming notify message event. There are two noteworthy
notifications: the first (and by far the most common) is TYPING
events, which are received when a remote user is in the process of sending
a message to our client. The second is GAME
events. (The
current jYMSG API doesn't support games.)
There are two ways of determining the type of notification. The first is
to study the type
field and compare it to the
String
values in StatusConstants
:
NOTIFY_TYPING
and NOTIFY_GAME
. The second is to
call either of the boolean methods, isTyping
or
isGame
.
The mode determines whether the notification is on or off. 0 meaning off and 1 meaning on. Yahoo will send 'on' packets when a an 'action' starts, and 'off' when it finishs (in the case of typing, 'off' will be sent if there is a suitable pause in typing or the message is actually transmitted. When typing restarts, 'on' will be sent).
For packets of a game type, the game
field will contain
the name of the game.
Note: Yahoo sends the game name encoded as a regular text message,
and jYMSG API uses the message
field to store it.
getGame
is actually just actually another name for
getMessage
.
  | getTo | getFrom | getMessage | getType | getMode |
notifyReceived | y | y | y | y | y |
Field Summary |
Fields inherited from class EventObject |
source |
Constructor Summary | |
SessionNotifyEvent(Object o,
String t,
String f,
String m,
String ty,
String md)
Create a new instance. |
Method Summary | |
String |
getGame()
Returns the game name if this is a game notification, otherwise null . |
int |
getMode()
Returns the notification mode. |
String |
getType()
Returns the notification type, TYPING, GAME, etc. |
boolean |
isGame()
Returns true if notification is game type. |
boolean |
isTyping()
Returns true if notification is typing type. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class SessionEvent |
getFrom, getMessage, getStatus, getTimestamp, getTo |
Methods inherited from class EventObject |
getSource |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SessionNotifyEvent(Object o, String t, String f, String m, String ty, String md)
o
- source of event (Session
)t
- to (Yahoo id)f
- from (Yahoo id)m
- message (ASCII or UTF-8)ty
- type (TYPING/GAME)md
- mode (0 or 1)Method Detail |
public int getMode()
public String getType()
StatusConstants
.
isTyping()
,
isGame()
public String getGame()
null
. (Actually a wrapper for getMessage
.)
public boolean isTyping()
getType()
public boolean isGame()
getType()
public String toString()
toString
in class SessionEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |