public interface WebSocketTokenClient extends WebSocketClient
| Modifier and Type | Method and Description |
|---|---|
void |
addTokenClientListener(WebSocketClientTokenListener aTokenListener)
Add the token client listener which are interested in receiving only
token based data.
|
void |
broadcastText(String aText)
Broadcast the text to all the connected clients to jWebSocket server
|
void |
disconnect()
Disconnect from the jWebSocket server
|
void |
getConnections()
Send the token to get the number of connected clients
|
String |
getUsername() |
boolean |
isAuthenticated()
Checks if for this client a user already is authenticated.
|
void |
login(String aUsername,
String aPassword)
Login the client based on given username and password to the jWebSocket
server
|
void |
logout()
Logout the user
|
void |
ping(boolean aEcho)
Ping the jWebSocket server
|
void |
removeTokenClientListener(WebSocketClientTokenListener aTokenListener)
Remove the token client listener
|
void |
sendText(String aTargetId,
String aText)
Send the text data
|
addListener, addSubProtocol, close, getListeners, getNegotiatedEncoding, getNegotiatedSubProtocol, getStatus, isConnected, notifyClosed, notifyOpened, notifyPacket, notifyReconnecting, open, removeListener, send, send, send, setVersionString getUsername()
void login(String aUsername, String aPassword) throws WebSocketException
username - the user namepassword - the password stringWebSocketException - if there's any exception while loginvoid logout()
throws WebSocketException
WebSocketException - if exception while logging outboolean isAuthenticated()
void broadcastText(String aText) throws WebSocketException
text - the text value to broadcastWebSocketException - if exception while broadcastingvoid ping(boolean aEcho)
throws WebSocketException
echo - flag to enable/disable echoWebSocketException - if exception while doing a pingvoid sendText(String aTargetId, String aText) throws WebSocketException
target - the targetmessage - the actual message to sendWebSocketException - if exception while sending textvoid disconnect()
throws WebSocketException
WebSocketException - if error while disconnectingvoid getConnections()
throws WebSocketException
WebSocketExceptionvoid addTokenClientListener(WebSocketClientTokenListener aTokenListener)
tokenListener - the token listener objectvoid removeTokenClientListener(WebSocketClientTokenListener aTokenListener)
tokenListener - the token client listenerCopyright © 2013. All Rights Reserved.