net.user1.union.core.event
Class RoomEvent

java.lang.Object
  extended by net.user1.union.core.event.BaseEvent
      extended by net.user1.union.core.event.RoomEvent
All Implemented Interfaces:
Event

public class RoomEvent
extends BaseEvent

RoomEvent is a simple data class used to pass information from a room to registered event-listeners when a room event occurs. The RoomEvent class also defines constants representing the available room events. To register for a room event, use the Room class's addEventListener() method.


Field Summary
static java.lang.String ADD_CLIENT
          Dispatched when a client has joined the room.
static java.lang.String ADD_OBSERVER
          Dispatched when a client observes the room.
static java.lang.String ATTRIBUTE_CHANGED
          Dispatched when a room attribute changes.
static java.lang.String ATTRIBUTE_REMOVED
          Dispatched when a room attribute is removed.
static java.lang.String INIT
          Dispatched when the underlying room has been initialized.
static java.lang.String JOIN_ROOM_REQUESTED
          Dispatched when a client requests to join a room.
static java.lang.String MODULE_MESSAGE
          Dispatched when a message has arrived for the modules attached to the room.
static java.lang.String NUM_CLIENTS_CHANGED
          Dispatched when the number of clients in the room changes.
static java.lang.String OBSERVE_ROOM_REQUESTED
          Dispatched when a client requests to observe room.
static java.lang.String REMOVE_CLIENT
          Dispatched when a client leaves the room.
static java.lang.String REMOVE_OBSERVER
          Dispatched when a client stops observing the room.
static java.lang.String ROOM_MESSAGE
          Dispatched when a client has sent a message to all other clients in the room.
static java.lang.String SHUTDOWN
          Dispatched when the room is shutdown.
 
Fields inherited from class net.user1.union.core.event.BaseEvent
m_eventProperties
 
Constructor Summary
RoomEvent(Room room, Client client, Message message)
          Constructor.
RoomEvent(Room room, Client client, Message message, Attribute attribute)
          Constructor.
RoomEvent(Room room, Client client, Message message, Attribute attribute, UPCMessage upcMessage)
           
 
Method Summary
 Attribute getAttribute()
          In ATTRIBUTE_CHANGED, and ATTRIBUTE_REMOVED events this returns the attribute involved in the event.
 Client getClient()
          In MODULE_MESSAGE, ADD_CLIENT, REMOVE_CLIENT, ADD_OBSERVER, and REMOVE_OBSERVER, ROOM_MESSAGE events this returns the client involved in the event.
 Message getMessage()
          In MODULE_MESSAGE event this returns the message involved in the event.
 Room getRoom()
          For all events this returns the room involved in the event.
 UPCMessage getUPCMessage()
          In ROOM_MESSAGE events this returns UPCMessage (u1) that initiated the event.
 
Methods inherited from class net.user1.union.core.event.BaseEvent
getProperty, isCanceled, preventDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INIT

public static final java.lang.String INIT
Dispatched when the underlying room has been initialized. Note: That modules will not have been initialized yet at this time.

See Also:
Constant Field Values

JOIN_ROOM_REQUESTED

public static final java.lang.String JOIN_ROOM_REQUESTED
Dispatched when a client requests to join a room. Invoking preventDefault() will prevent the client from joining the room.

See Also:
Constant Field Values

ADD_CLIENT

public static final java.lang.String ADD_CLIENT
Dispatched when a client has joined the room.

See Also:
Constant Field Values

REMOVE_CLIENT

public static final java.lang.String REMOVE_CLIENT
Dispatched when a client leaves the room.

See Also:
Constant Field Values

NUM_CLIENTS_CHANGED

public static final java.lang.String NUM_CLIENTS_CHANGED
Dispatched when the number of clients in the room changes.

See Also:
Constant Field Values

SHUTDOWN

public static final java.lang.String SHUTDOWN
Dispatched when the room is shutdown.

See Also:
Constant Field Values

ATTRIBUTE_CHANGED

public static final java.lang.String ATTRIBUTE_CHANGED
Dispatched when a room attribute changes.

See Also:
Constant Field Values

ATTRIBUTE_REMOVED

public static final java.lang.String ATTRIBUTE_REMOVED
Dispatched when a room attribute is removed.

See Also:
Constant Field Values

OBSERVE_ROOM_REQUESTED

public static final java.lang.String OBSERVE_ROOM_REQUESTED
Dispatched when a client requests to observe room. Invoking preventDefault() will prevent the client from observing the room.

See Also:
Constant Field Values

ADD_OBSERVER

public static final java.lang.String ADD_OBSERVER
Dispatched when a client observes the room.

See Also:
Constant Field Values

REMOVE_OBSERVER

public static final java.lang.String REMOVE_OBSERVER
Dispatched when a client stops observing the room.

See Also:
Constant Field Values

MODULE_MESSAGE

public static final java.lang.String MODULE_MESSAGE
Dispatched when a message has arrived for the modules attached to the room.

See Also:
Constant Field Values

ROOM_MESSAGE

public static final java.lang.String ROOM_MESSAGE
Dispatched when a client has sent a message to all other clients in the room.

See Also:
Constant Field Values
Constructor Detail

RoomEvent

public RoomEvent(Room room,
                 Client client,
                 Message message)
Constructor.


RoomEvent

public RoomEvent(Room room,
                 Client client,
                 Message message,
                 Attribute attribute)
Constructor.


RoomEvent

public RoomEvent(Room room,
                 Client client,
                 Message message,
                 Attribute attribute,
                 UPCMessage upcMessage)
Method Detail

getClient

public Client getClient()
In MODULE_MESSAGE, ADD_CLIENT, REMOVE_CLIENT, ADD_OBSERVER, and REMOVE_OBSERVER, ROOM_MESSAGE events this returns the client involved in the event. Otherwise this returns null.

Returns:
the client involved in the event

getRoom

public Room getRoom()
For all events this returns the room involved in the event. Otherwise this returns null.

Returns:
the room involved in the event

getMessage

public Message getMessage()
In MODULE_MESSAGE event this returns the message involved in the event.

Returns:
the message involved in the event

getAttribute

public Attribute getAttribute()
In ATTRIBUTE_CHANGED, and ATTRIBUTE_REMOVED events this returns the attribute involved in the event.

Returns:
the attribute involved in the event

getUPCMessage

public UPCMessage getUPCMessage()
In ROOM_MESSAGE events this returns UPCMessage (u1) that initiated the event.

Returns:
the UPCMessage involved in the event


Copyright USER1 Subsystems Corporation - Tue Jan 28 2014, 05:05 PM -0500