org.moock.unity.core
Interface RoomServices


public interface RoomServices

Interface for handling services associated with Rooms.

Author:
Derek Clayton
See Also:
Services

Field Summary
static int ALREADY_IN_ROOM
           
static int ATTR_FLAGS_NONE
           
static int ATTR_FLAGS_PERSISTENT
           
static int ATTR_FLAGS_SHARED
           
static int ATTR_FLAGS_SHARED_PERSISTENT
           
static int CLIENT_SHUTDOWN
           
static int ERROR
           
static int LOGIN_FAILED
           
static int LOGIN_REQUIRED
           
static int NOT_IN_ROOM
           
static int ROOM_FULL
           
static int SUCCESS
           
 
Method Summary
 void broadcastRoom(java.lang.String message)
          Broadcasts to all clients in the room.
 void broadcastRoomButClient(java.lang.String butClientID, java.lang.String message)
          Broadcasts to all clients in room except for Client client with id clientID.
 boolean containsClient(java.lang.String clientID)
          Returns true if the Client is in the room, false otherwise.
 java.util.HashMap getAllAttributes()
          Returns a HashMap containing all of the attributes.
 java.lang.Object getAttribute(java.lang.String name)
          Returns objects from the room's attributes.
 java.util.HashSet getClientList()
          Returns the ClientID's for all clients connected to the Room.
 java.util.HashSet getClientServicesList()
          Returns the ClientServices for all clients connected to the Room.
 long getCreationTime()
          Retrieves the time the Room was created.
 java.lang.String getFullyQualifiedRoomID()
          Returns the ID including the Namespace qualifier for the room.
 int getNumClients()
          Get the number of clients in the room.
 java.lang.String getRoomID()
          Returns the ID not including the Namespace qualifier for the room.
 java.lang.Object getRoomListener()
          Gets the Room Listener Object for the Room
 RoomProperties getRoomProperties()
          Returns the properties for the Room.
 java.util.HashMap getSharedAttributes()
          Returns a HashMap containing all of the attributes flagged as shared for the room.
 boolean isDying()
          Indicates if this room is in the process of being removed.
 void killRoom()
          Removes the Room from the server.
 void removeAttribute(java.lang.String name)
          Removes an object from the room's attributes.
 void setAttribute(java.lang.String name, java.lang.Object obj, int flags)
          Adds an object to the room's attributes.
 

Field Detail

SUCCESS

public static final int SUCCESS

LOGIN_REQUIRED

public static final int LOGIN_REQUIRED

LOGIN_FAILED

public static final int LOGIN_FAILED

ROOM_FULL

public static final int ROOM_FULL

ALREADY_IN_ROOM

public static final int ALREADY_IN_ROOM

NOT_IN_ROOM

public static final int NOT_IN_ROOM

CLIENT_SHUTDOWN

public static final int CLIENT_SHUTDOWN

ERROR

public static final int ERROR

ATTR_FLAGS_NONE

public static final int ATTR_FLAGS_NONE

ATTR_FLAGS_SHARED

public static final int ATTR_FLAGS_SHARED

ATTR_FLAGS_PERSISTENT

public static final int ATTR_FLAGS_PERSISTENT

ATTR_FLAGS_SHARED_PERSISTENT

public static final int ATTR_FLAGS_SHARED_PERSISTENT
Method Detail

containsClient

public boolean containsClient(java.lang.String clientID)
Returns true if the Client is in the room, false otherwise.

getNumClients

public int getNumClients()
Get the number of clients in the room.

getClientList

public java.util.HashSet getClientList()
Returns the ClientID's for all clients connected to the Room.

getClientServicesList

public java.util.HashSet getClientServicesList()
Returns the ClientServices for all clients connected to the Room.

broadcastRoom

public void broadcastRoom(java.lang.String message)
Broadcasts to all clients in the room.

broadcastRoomButClient

public void broadcastRoomButClient(java.lang.String butClientID,
                                   java.lang.String message)
Broadcasts to all clients in room except for Client client with id clientID.

getRoomID

public java.lang.String getRoomID()
Returns the ID not including the Namespace qualifier for the room.

getFullyQualifiedRoomID

public java.lang.String getFullyQualifiedRoomID()
Returns the ID including the Namespace qualifier for the room.

getCreationTime

public long getCreationTime()
Retrieves the time the Room was created.
Returns:
the difference, measured in milliseconds, between the time Unity started and midnight, January 1, 1970 UTC.

killRoom

public void killRoom()
Removes the Room from the server.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object obj,
                         int flags)
Adds an object to the room's attributes.
Parameters:
name - the name under which to store the object
obj - the object to store
flags - 0=none,1=shared,2=persistent,3=shared and persistent

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Returns objects from the room's attributes.
Parameters:
name - the name under which the desired object has been stored
Returns:
object stored under name

removeAttribute

public void removeAttribute(java.lang.String name)
Removes an object from the room's attributes.
Parameters:
name - the name of the object to remove

getAllAttributes

public java.util.HashMap getAllAttributes()
Returns a HashMap containing all of the attributes.

getSharedAttributes

public java.util.HashMap getSharedAttributes()
Returns a HashMap containing all of the attributes flagged as shared for the room.

getRoomProperties

public RoomProperties getRoomProperties()
Returns the properties for the Room.

getRoomListener

public java.lang.Object getRoomListener()
Gets the Room Listener Object for the Room

isDying

public boolean isDying()
Indicates if this room is in the process of being removed.
Returns:
true if the room is being removed, otherwise false