public class UndertowWebSocketConnection extends DestroyableBase implements WebSocketConnection
Destroyable.Util
logger
Constructor and Description |
---|
UndertowWebSocketConnection(io.undertow.websockets.core.WebSocketChannel channel,
org.osgl.http.H.Session session) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection.
|
boolean |
closed()
Check if the connection has been closed
|
protected void |
releaseResources() |
void |
send(java.lang.String message)
Send a text message through websocket
|
java.lang.String |
sessionId()
Session ID of this connection
|
java.lang.String |
username()
Returns the username which is gained when connection is setup by calling
H.KV.get(String) with AppConfig.sessionKeyUsername() |
addSubResource, destroy, isDestroyed, reload, scope
debug, debug, error, error, fatal, fatal, info, info, isDebugEnabled, isTraceEnabled, trace, trace, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
destroy, isDestroyed, scope
public UndertowWebSocketConnection(io.undertow.websockets.core.WebSocketChannel channel, org.osgl.http.H.Session session)
public java.lang.String sessionId()
WebSocketConnection
Session ID of this connection
sessionId
in interface WebSocketConnection
public java.lang.String username()
WebSocketConnection
Returns the username which is gained when connection is setup by calling H.KV.get(String)
with AppConfig.sessionKeyUsername()
username
in interface WebSocketConnection
null
if there is no logged in user when connection is setuppublic void send(java.lang.String message)
WebSocketConnection
Send a text message through websocket
send
in interface WebSocketConnection
message
- the text messageprotected void releaseResources()
releaseResources
in class DestroyableBase
public void close()
WebSocketConnection
Close the connection. Note if there are any IOException
raised by the underline network layer, it will be ignored
close
in interface WebSocketConnection
public boolean closed()
WebSocketConnection
Check if the connection has been closed
closed
in interface WebSocketConnection
true
if connection is closedCopyright © 2014–2017 ActFramework. All rights reserved.