public interface Client extends AttributeHolder, EventProducer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_CONNECTIONTYPE |
static java.lang.String |
ATTR_CONNECTTIME |
static java.lang.String |
ATTR_GATEWAYID |
static java.lang.String |
ATTR_GATEWAYTYPE |
static java.lang.String |
ATTR_IP |
static java.lang.String |
ATTR_LASTACTIVE |
static java.lang.String |
ATTR_ROLES |
static java.lang.String |
ATTR_TYPE |
static java.lang.String |
ATTR_UPC_VERSION |
static java.lang.String |
ATTR_UPDATE_LEVEL |
static java.lang.String |
ATTR_USERAGENT |
Modifier and Type | Method and Description |
---|---|
Account |
getAccount()
Get the Account for the client.
|
java.lang.String |
getAddress()
Returns the address (determined by the Connection type) for this client.
|
java.lang.String |
getClientID()
Get the ID for the client.
|
long |
getConnectToServerTime()
Deprecated.
use getAttribute
|
long |
getLastHeartbeatActive()
Returns the System time (System.timeCurrentMillis()) the client was last active (i.e.
|
java.util.Set<java.lang.String> |
getRoomList()
Returns the room ID's of Rooms the Client is in.
|
java.lang.Integer |
getUpdateLevels(java.lang.String roomID)
Return the update levels for set for the given roomID.
|
java.lang.String |
getUserID()
This is a convenience method for retrieving the userID of the client without having
to do null check on the client.
|
boolean |
isAdmin()
Returns true if the client is an administrator.
|
boolean |
isLoggedIn()
Returns true if the client has logged in.
|
boolean |
isShutdown()
Returns true if shutdown has been called on the client.
|
java.lang.String |
joinRoom(java.lang.String roomID,
java.lang.String password)
Attempts to have client join a room.
|
java.lang.String |
leaveRoom(java.lang.String roomID)
Removes the client from a room.
|
java.lang.String |
login(java.lang.String userID,
java.lang.String password)
Login the client to the server.
|
java.lang.String |
logoff(java.lang.String password)
Logoff the client from the server.
|
java.lang.String |
observeRoom(java.lang.String roomID,
java.lang.String password)
Attempts to have the client observe a room.
|
void |
sendMessage(java.lang.String message,
java.lang.String... args)
This generates a u7 which is sent to the client.
|
void |
setUpdateLevels(java.lang.String roomID,
int levels)
Sets the update levels for the room.
|
void |
shutdown()
Removes the client from the server after sending any messages currently queued to be sent.
|
void |
shutdown(boolean sendRemainingMessages)
Removes the client from the server.
|
java.lang.String |
stopObservingRoom(java.lang.String roomID)
Stop observing a room.
|
getAttribute, getAttribute, getAttributes, getAttributes, getAttributesByScope, getAttributeValue, getAttributeValue, onChangeAttribute, onRemoveAttribute, removeAttribute, removeAttribute, setAttribute
addEventListener, dispatchEvent, getEventClassMap, removeEventListener
static final java.lang.String ATTR_CONNECTTIME
static final java.lang.String ATTR_GATEWAYID
static final java.lang.String ATTR_GATEWAYTYPE
static final java.lang.String ATTR_CONNECTIONTYPE
static final java.lang.String ATTR_TYPE
static final java.lang.String ATTR_USERAGENT
static final java.lang.String ATTR_UPC_VERSION
static final java.lang.String ATTR_IP
static final java.lang.String ATTR_LASTACTIVE
static final java.lang.String ATTR_UPDATE_LEVEL
static final java.lang.String ATTR_ROLES
java.lang.String joinRoom(java.lang.String roomID, java.lang.String password) throws RoomNotFoundException
roomID
- - the id of the room to joinpassword
- - the password for the room (only used if the room requires a password)RoomNotFoundException
java.lang.String leaveRoom(java.lang.String roomID) throws RoomNotFoundException
roomID
- - the id of the room to leaveRoomNotFoundException
java.lang.String observeRoom(java.lang.String roomID, java.lang.String password) throws RoomNotFoundException
roomID
- - the roomID to observepassword
- - the password for the room (only used if the room requires a password)RoomNotFoundException
java.lang.String stopObservingRoom(java.lang.String roomID) throws RoomNotFoundException
roomID
- - the roomID to stop observingRoomNotFoundException
void sendMessage(java.lang.String message, java.lang.String... args)
message
- - the name of the messageargs
- - the args to be sent with the messagejava.lang.String getClientID()
java.lang.String getUserID()
Account getAccount()
void shutdown()
void shutdown(boolean sendRemainingMessages)
sendRemainingMessages
- - if true no new messages will be allowed but any messages currently queued will be sent. If false, the client
will shutdown immediately and any messages not yet sent will be lost.java.util.Set<java.lang.String> getRoomList()
java.lang.String getAddress()
java.lang.String login(java.lang.String userID, java.lang.String password)
userID
- the userID of the clientpassword
- the password of the clientjava.lang.String logoff(java.lang.String password)
password
- the password of the clientboolean isLoggedIn()
boolean isAdmin()
long getLastHeartbeatActive()
long getConnectToServerTime()
void setUpdateLevels(java.lang.String roomID, int levels)
roomID
- the room the levels are set forlevels
- the levels to setUpdateLevel
java.lang.Integer getUpdateLevels(java.lang.String roomID)
roomID
- the room we want the update levels forboolean isShutdown()