public interface Server extends AttributeHolder, RemoteEventProducer
Modifier and Type | Method and Description |
---|---|
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.
|
getAttribute, getAttribute, getAttributes, getAttributes, getAttributesByScope, getAttributeValue, getAttributeValue, onChangeAttribute, onRemoveAttribute, removeAttribute, removeAttribute, setAttribute
addRemoteEventListener, dispatchRemoteEvent, dispatchRemoteEvent, getRemoteEventClassMap, removeRemoteEventListener
addEventListener, dispatchEvent, getEventClassMap, removeEventListener
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 getRoomNotFoundException
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 setRoom createRoom(RoomDef def) throws RoomAlreadyExistsException, CreateRoomException
def
- the definition of the roomRoomAlreadyExistsException
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 getClientNotFoundException
Client getClientByUserID(java.lang.String userID) throws ClientNotFoundException
userID
- the uesrID of the client to getClientNotFoundException
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 getModuleNotFoundException
void shutdownModule(java.lang.String moduleID) throws ModuleNotFoundException
moduleID
- the ID of the module to be shutdownModuleNotFoundException
java.lang.String getVersion()
long getStartTime()
int getNumClients()
int getNumClientsTotal(java.lang.String qualifier)
qualifier
- the qualifier in which the count is doneint getNumClientsUnique(java.lang.String qualifier)
qualifier
- the qualifier in which the count is doneint getNumRooms()
int getLifetimeNumClients()
int getLifetimeNumRooms()
Request getCurrentRequest()
boolean containsAccount(java.lang.String userID)
userID
- the userID for the accountAccount getAccount(java.lang.String userID) throws AccountNotFoundException
userID
- the userID for the accountAccountNotFoundException
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 accountjava.lang.String removeAccount(java.lang.String userID, java.lang.String password)
userID
- the userID of the accountpassword
- the password of the accountvoid 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 accountvoid shutdownServer()
Security getSecurity()
UPCProcessor getUPCMessageProcessor()
Cluster getCluster()