ymsg.network.event
Class SessionEvent

Object
  extended byEventObject
      extended bySessionEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SessionChatEvent, SessionConferenceEvent, SessionErrorEvent, SessionExceptionEvent, SessionFileTransferEvent, SessionFriendEvent, SessionNewMailEvent, SessionNotifyEvent

public class SessionEvent
extends EventObject

Represents an incoming message type event. There are several fields of note here: firstly from which denotes who sent the message; secondly message which is the ASCII or UTF-8 of the message text; and finally timestamp which is used in some circumstances to date the message or set an expiry date.

  getTo getFrom getMessage getTimestamp
contactRejectionReceived y y y n
contactRequestReceived y y y y
messageReceived y y y n
buzzReceived y y y n
offlineMessageReceived y y y y
listReceived/i> n n n n
logoffReceived n n n n

Since:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class EventObject
source
 
Constructor Summary
SessionEvent(Object o)
          Create a new instance.
SessionEvent(Object o, String t, String f)
          Create a new instance.
SessionEvent(Object o, String t, String f, String m)
          Create a new instance.
SessionEvent(Object o, String t, String f, String m, String dt)
          Create a new instance.
 
Method Summary
 String getFrom()
          Returns the from field, the Yahoo user who sent this message (this may be their actual id, or one of their identities).
 String getMessage()
          Returns the message field, the ASCII or UTF-8 text of the message itself.
 long getStatus()
          Returns the status as presented in the Yahoo packet header.
 Date getTimestamp()
          Returns the timestamp field, which is used by some message types, for example off-line messages.
 String getTo()
          Returns the to field, which should (if the message is legit) contain the client's Yahoo id or one of their identities.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class EventObject
getSource
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SessionEvent

public SessionEvent(Object o)
Create a new instance. API users should not call this directly. The API itself will create its own events.

Parameters:
o - source of event (Session)
Since:
1.0

SessionEvent

public SessionEvent(Object o,
                    String t,
                    String f)
Create a new instance. API users should not call this directly. The API itself will create its own events.

Parameters:
o - source of event (Session)
t - to (Yahoo id)
f - from (Yahoo id)
Since:
1.0

SessionEvent

public SessionEvent(Object o,
                    String t,
                    String f,
                    String m)
Create a new instance. API users should not call this directly. The API itself will create its own events.

Parameters:
o - source of event (Session)
t - to (Yahoo id)
f - from (Yahoo id)
m - message (ASCII or UTF-8)
Since:
1.0

SessionEvent

public SessionEvent(Object o,
                    String t,
                    String f,
                    String m,
                    String dt)
Create a new instance. API users should not call this directly. The API itself will create its own events.

Parameters:
o - source of event (Session)
t - to (Yahoo id)
f - from (Yahoo id)
m - message (ASCII or UTF-8)
dt - timestamp (Unix, seconds)
Since:
1.0
Method Detail

getTo

public String getTo()
Returns the to field, which should (if the message is legit) contain the client's Yahoo id or one of their identities.

Returns:
Yahoo id
Since:
1.0

getFrom

public String getFrom()
Returns the from field, the Yahoo user who sent this message (this may be their actual id, or one of their identities).

Returns:
Yahoo id
Since:
1.0

getMessage

public String getMessage()
Returns the message field, the ASCII or UTF-8 text of the message itself.

Returns:
message text
Since:
1.0

getTimestamp

public Date getTimestamp()
Returns the timestamp field, which is used by some message types, for example off-line messages. (If unused, it will be null).

Returns:
date as Date object
Since:
1.0

getStatus

public long getStatus()
Returns the status as presented in the Yahoo packet header. Most event types don't require this to be inspected, and indeed currently the jYMSG API only bothers to set this on a handful of events.

Returns:
status, see StatusConstants interface
Since:
1.0

toString

public String toString()
Returns a string representation of this object.

Returns:
object as a string
Since:
1.0