net.user1.union.core.event
Class ServerEvent

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

public class ServerEvent
extends BaseEvent

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


Field Summary
static java.lang.String ACCOUNT_CREATE_REQUESTED
          Dispatched when there is a request to create an account.
static java.lang.String ACCOUNT_CREATED
          Dispatched when a persistent client account has been created on the server.
static java.lang.String ACCOUNT_REMOVED
          Dispatched when a persistent client account has been removed.
static java.lang.String CLIENT_ADDED
          Dispatched when a client has been added to the server.
static java.lang.String CLIENT_LOGIN
          Dispatched when a client logs in to the server.
static java.lang.String CLIENT_LOGOFF
          Dispatched when a client logs off from the server.
static java.lang.String CLIENT_READY
          Dispatched when a Reactor client has joined the server and is now ready to send and receive messages.
static java.lang.String CLIENT_REMOVED
          Dispatched when a client leaves the server.
static java.lang.String PROP_PASSWORD
          This property contains the String password when ROOM_CREATE_REQUESTED and ACCOUNT_CREATE_REQUESTED are dispatched.
static java.lang.String PROP_ROOMDEF
          This property contains the RoomDef when ROOM_CREATE_REQUESTED is dispatched.
static java.lang.String PROP_USERID
          This property contains the String userID when account related events are dispatched.
static java.lang.String ROOM_CREATE_REQUESTED
          Dispatched when there is a request to create a room.
static java.lang.String ROOM_CREATED
          Dispatched when a room has been created on the server.
static java.lang.String ROOM_REMOVED
          Dispatched when a room has been removed from the server.
 
Fields inherited from class net.user1.union.core.event.BaseEvent
m_eventProperties
 
Constructor Summary
ServerEvent(Room room, Client client)
          Constructor.
ServerEvent(Room room, Client client, java.util.Map<java.lang.String,java.lang.Object> props)
          Constructor.
 
Method Summary
 Client getClient()
          In CLIENT_ADDED, CLIENT_READY, and CLIENT_REMOVED events this returns the client involved in the event.
 Room getRoom()
          In ROOM_CREATED events this returns the room involved in 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

ACCOUNT_CREATE_REQUESTED

public static final java.lang.String ACCOUNT_CREATE_REQUESTED
Dispatched when there is a request to create an account. Invoking preventDefault() will prevent the account from being created.

See Also:
Constant Field Values

ACCOUNT_CREATED

public static final java.lang.String ACCOUNT_CREATED
Dispatched when a persistent client account has been created on the server.

See Also:
Constant Field Values

ACCOUNT_REMOVED

public static final java.lang.String ACCOUNT_REMOVED
Dispatched when a persistent client account has been removed.

See Also:
Constant Field Values

ROOM_CREATE_REQUESTED

public static final java.lang.String ROOM_CREATE_REQUESTED
Dispatched when there is a request to create a room. Also see PROP_ROOMDEF. Invoking preventDefault() will prevent the room from being created.

See Also:
Constant Field Values

ROOM_CREATED

public static final java.lang.String ROOM_CREATED
Dispatched when a room has been created on the server.

See Also:
Constant Field Values

ROOM_REMOVED

public static final java.lang.String ROOM_REMOVED
Dispatched when a room has been removed from the server.

See Also:
Constant Field Values

CLIENT_ADDED

public static final java.lang.String CLIENT_ADDED
Dispatched when a client has been added to the server.

See Also:
Constant Field Values

CLIENT_READY

public static final java.lang.String CLIENT_READY
Dispatched when a Reactor client has joined the server and is now ready to send and receive messages.

See Also:
Constant Field Values

CLIENT_REMOVED

public static final java.lang.String CLIENT_REMOVED
Dispatched when a client leaves the server.

See Also:
Constant Field Values

CLIENT_LOGIN

public static final java.lang.String CLIENT_LOGIN
Dispatched when a client logs in to the server.

See Also:
Constant Field Values

CLIENT_LOGOFF

public static final java.lang.String CLIENT_LOGOFF
Dispatched when a client logs off from the server.

See Also:
Constant Field Values

PROP_PASSWORD

public static final java.lang.String PROP_PASSWORD
This property contains the String password when ROOM_CREATE_REQUESTED and ACCOUNT_CREATE_REQUESTED are dispatched.

See Also:
Constant Field Values

PROP_ROOMDEF

public static final java.lang.String PROP_ROOMDEF
This property contains the RoomDef when ROOM_CREATE_REQUESTED is dispatched.

See Also:
Constant Field Values

PROP_USERID

public static final java.lang.String PROP_USERID
This property contains the String userID when account related events are dispatched.

See Also:
Constant Field Values
Constructor Detail

ServerEvent

public ServerEvent(Room room,
                   Client client)
Constructor.


ServerEvent

public ServerEvent(Room room,
                   Client client,
                   java.util.Map<java.lang.String,java.lang.Object> props)
Constructor.

Method Detail

getRoom

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

Returns:
the room involved in the event

getClient

public Client getClient()
In CLIENT_ADDED, CLIENT_READY, and CLIENT_REMOVED events this returns the client involved in the event. Otherwise this returns null.

Returns:
the client involved in the event


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