|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Server
The server is the container for all other objects in the server.
Method Summary | |
---|---|
java.lang.String |
changeAccountPassword(java.lang.String userID,
java.lang.String oldPassword,
java.lang.String newPassword)
Change the password for an account |
void |
clearAccountCache()
For efficiency Union uses a cache for recently used Accounts. |
boolean |
containsAccount(java.lang.String userID)
Returns true if the server has an account (logged in or not) for the userID. |
boolean |
containsClient(java.lang.String clientID)
Returns true if a client with the given ID exists on the server. |
boolean |
containsRoom(java.lang.String roomID)
Returns true if a room with the given ID exists on the server. |
java.lang.String |
createAccount(java.lang.String userID,
java.lang.String password)
Create an account on the server. |
Module |
createModule(ModuleDef moduleDef)
Creates the module based on the given ModuleDef. |
Room |
createRoom(RoomDef def)
Creates a room based on the given RoomDef. |
Account |
getAccount(java.lang.String userID)
Returns the account for the given userID. |
Client |
getClient(java.lang.String clientID)
Gets the client with the given ID. |
Client |
getClientByUserID(java.lang.String userID)
Gets the client with the given userID if the client is currently logged in. |
java.util.Set<Client> |
getClients()
Return a set of the clients currently on the server. |
Cluster |
getCluster()
Returns access to the Cluster API. |
Request |
getCurrentRequest()
Get the current request being processed. |
int |
getLifetimeNumClients()
Returns the total number of lifetime connections to the server. |
int |
getLifetimeNumRooms()
Returns the total number of lifetime rooms created on the server. |
Module |
getModule(java.lang.String moduleID)
Get the module with the given ID. |
int |
getNumClients()
Returns the total number of clients on the server. |
int |
getNumClientsTotal(java.lang.String qualifier)
Returns the total number of clients in the given qualifier. |
int |
getNumClientsUnique(java.lang.String qualifier)
Returns the total number of unique clients in the given qualifier. |
int |
getNumRooms()
Returns the total number of rooms on the server. |
Room |
getRoom(java.lang.String roomID)
Gets a room that is on the server. |
java.util.List<? extends Room> |
getRooms()
Get a list of all rooms on the server. |
java.util.List<? extends Room> |
getRooms(java.lang.String qualifier)
Get a list of rooms on the server that are in the given qualifier. |
Security |
getSecurity()
Returns access to the Security API. |
long |
getStartTime()
Returns the System time (System.currenTimeMillis()) the server was started. |
UPCProcessor |
getUPCMessageProcessor()
Returns access to the UPCMessageProcessor API. |
java.util.List<java.lang.String> |
getUsers()
Returns a list of userIDs for all accounts on the server. |
java.lang.String |
getVersion()
Returns the version of Union. |
boolean |
isAccountOnline(java.lang.String userID)
Returns true if the account given by the userID is currently logged in. |
boolean |
isShutdown()
Returns true if the server is shutdown. |
java.lang.String |
removeAccount(java.lang.String userID,
java.lang.String password)
Remove an account from the server. |
void |
sendMessage(Filter filter,
java.lang.String message,
java.lang.String... args)
This generates a u7 which is sent to all clients on the server. |
void |
sendMessage(java.lang.String message,
java.lang.String... args)
This generates a u7 which is sent to all clients on the server. |
void |
shutdownModule(java.lang.String moduleID)
Shuts down the module with the given ID. |
java.lang.String |
shutdownRoom(java.lang.String roomID,
java.lang.String password)
Shuts down the room and removes it from the Server. |
void |
shutdownServer()
Stops the server. |
Methods inherited from interface net.user1.union.core.attribute.AttributeHolder |
---|
getAttribute, getAttribute, getAttributes, getAttributes, getAttributesByScope, getAttributeValue, getAttributeValue, onChangeAttribute, onRemoveAttribute, removeAttribute, removeAttribute, setAttribute |
Methods inherited from interface net.user1.union.core.event.RemoteEventProducer |
---|
addRemoteEventListener, dispatchRemoteEvent, dispatchRemoteEvent, getRemoteEventClassMap, removeRemoteEventListener |
Methods inherited from interface net.user1.union.core.event.EventProducer |
---|
addEventListener, dispatchEvent, getEventClassMap, removeEventListener |
Method Detail |
---|
void sendMessage(java.lang.String message, java.lang.String... args)
message
- the name of the messageargs
- the args to be sent with the messagevoid sendMessage(Filter filter, java.lang.String message, java.lang.String... args)
filter
- the filter to be used to determine if the client should receive the messagemessage
- the name of the messageargs
- the args to be sent with the messageboolean isShutdown()
Room getRoom(java.lang.String roomID) throws RoomNotFoundException
roomID
- the roomID of the room to get
RoomNotFoundException
java.util.List<? extends Room> getRooms()
java.util.List<? extends Room> getRooms(java.lang.String qualifier)
qualifier
- the qualifier the rooms must have to be included in the set
Room createRoom(RoomDef def) throws RoomAlreadyExistsException, CreateRoomException
def
- the definition of the room
RoomAlreadyExistsException
CreateRoomException
java.lang.String shutdownRoom(java.lang.String roomID, java.lang.String password) throws RoomNotFoundException
roomID
- the room to shutdownpassword
- the password for the room (only used if the room requires a password)
RoomNotFoundException
boolean containsRoom(java.lang.String roomID)
boolean containsClient(java.lang.String clientID)
java.util.Set<Client> getClients()
Client getClient(java.lang.String clientID) throws ClientNotFoundException
clientID
- the ID of the client to get
ClientNotFoundException
Client getClientByUserID(java.lang.String userID) throws ClientNotFoundException
userID
- the uesrID of the client to get
ClientNotFoundException
Module createModule(ModuleDef moduleDef) throws ModuleAlreadyExistsException, CreateModuleException
moduleDef
- the ModuleDef to use when creating the module.
ModuleAlreadyExistsException
CreateModuleException
Module getModule(java.lang.String moduleID) throws ModuleNotFoundException
moduleID
- the ID of the module to get
ModuleNotFoundException
void shutdownModule(java.lang.String moduleID) throws ModuleNotFoundException
moduleID
- the ID of the module to be shutdown
ModuleNotFoundException
java.lang.String getVersion()
long getStartTime()
int getNumClients()
int getNumClientsTotal(java.lang.String qualifier)
qualifier
- the qualifier in which the count is done
int getNumClientsUnique(java.lang.String qualifier)
qualifier
- the qualifier in which the count is done
int getNumRooms()
int getLifetimeNumClients()
int getLifetimeNumRooms()
Request getCurrentRequest()
boolean containsAccount(java.lang.String userID)
userID
- the userID for the account
Account getAccount(java.lang.String userID) throws AccountNotFoundException
userID
- the userID for the account
AccountNotFoundException
boolean isAccountOnline(java.lang.String userID)
userID
-
java.lang.String createAccount(java.lang.String userID, java.lang.String password)
userID
- the userID for the accountpassword
- the password of the account
java.lang.String removeAccount(java.lang.String userID, java.lang.String password)
userID
- the userID of the accountpassword
- the password of the account
void clearAccountCache()
java.util.List<java.lang.String> getUsers()
java.lang.String changeAccountPassword(java.lang.String userID, java.lang.String oldPassword, java.lang.String newPassword)
userID
- the userID of the accountoldPassword
- the old password for the accountnewPassword
- the new password for the account
void shutdownServer()
Security getSecurity()
UPCProcessor getUPCMessageProcessor()
Cluster getCluster()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |