org.moock.unity.core
Interface NamespaceServices


public interface NamespaceServices

Interface for handling services associated with a Namespace.

Author:
Derek Clayton
See Also:
Services

Method Summary
 boolean addObserver(java.lang.String clientID)
          Adds the client specified by clientID as an observer to the room.
 void broadcastNamespace(java.lang.String message, boolean recurse)
          Broadcasts the message to all clients in Rooms within the Namespace.
 void broadcastNamespaceButClient(java.lang.String butClientID, java.lang.String message, boolean recurse)
          Broadcasts the message to all clients in Rooms within the Namespace except for the client ID specified by butClientID.
 boolean containsRoom(java.lang.String roomID)
          Returns true if the Namespace contains Room roomID.
 java.util.HashSet getClientList(boolean recurse)
          Returns a HashSet of all Clients by ID in the Namespace.
 java.lang.String getFullName()
          Returns the fully qualified name of the Namespace.
 java.util.HashSet getNamespaceList(boolean recurse)
          Returns a HashSet of all immediate child Namespaces of the Namespace.
 int getNumClients(boolean recurse)
          Returns the number of Clients in the Namespace.
 int getNumRooms(boolean recurse)
          Returns the number of Rooms in the Namespace.
 java.util.HashSet getRoomList(boolean recurse)
          Returns a HashSet of all Rooms by ID in the Namespace.
 void killRooms(boolean recurse)
          Kills all the rooms in the Namespace.
 boolean removeObserver(java.lang.String clientID)
          Removes the client specified by clientID as an observer from the room.
 

Method Detail

broadcastNamespace

public void broadcastNamespace(java.lang.String message,
                               boolean recurse)
Broadcasts the message to all clients in Rooms within the Namespace. Clients in multiple Rooms within this Namespace will receive one message only.
Parameters:
message - the message to broadcast
recurse - true to broadcast to any sub-namespaces, false otherwise

broadcastNamespaceButClient

public void broadcastNamespaceButClient(java.lang.String butClientID,
                                        java.lang.String message,
                                        boolean recurse)
Broadcasts the message to all clients in Rooms within the Namespace except for the client ID specified by butClientID. Clients in multiple Rooms within this Namespace will receive one message only.
Parameters:
butClientID - the client ID of the client to be omitted from the broadcast
message - the message to broadcast
recurse - true to broadcast to any sub-namespaces, false otherwise

getClientList

public java.util.HashSet getClientList(boolean recurse)
Returns a HashSet of all Clients by ID in the Namespace. ID's will be unique even if Clients are in multiple Rooms.

getNumRooms

public int getNumRooms(boolean recurse)
Returns the number of Rooms in the Namespace.

getNumClients

public int getNumClients(boolean recurse)
Returns the number of Clients in the Namespace.

getNamespaceList

public java.util.HashSet getNamespaceList(boolean recurse)
Returns a HashSet of all immediate child Namespaces of the Namespace.
Parameters:
recurse - true if recurse to all child Namespaces

getRoomList

public java.util.HashSet getRoomList(boolean recurse)
Returns a HashSet of all Rooms by ID in the Namespace.
Parameters:
recurse - true if recurse to all child Namespaces

containsRoom

public boolean containsRoom(java.lang.String roomID)
Returns true if the Namespace contains Room roomID.

getFullName

public java.lang.String getFullName()
Returns the fully qualified name of the Namespace.

addObserver

public boolean addObserver(java.lang.String clientID)
Adds the client specified by clientID as an observer to the room.
Returns:
true if added, false if already observing

removeObserver

public boolean removeObserver(java.lang.String clientID)
Removes the client specified by clientID as an observer from the room.
Returns:
true if removed, false if not observing

killRooms

public void killRooms(boolean recurse)
Kills all the rooms in the Namespace.
Parameters:
recurse - true to broadcast to any sub-namespaces, false otherwise