Package org.basex.http.ws
Class WebSocket
java.lang.Object
org.eclipse.jetty.websocket.api.WebSocketAdapter
org.basex.http.ws.WebSocket
- All Implemented Interfaces:
ClientInfo,org.eclipse.jetty.websocket.api.WebSocketConnectionListener,org.eclipse.jetty.websocket.api.WebSocketListener
public final class WebSocket
extends org.eclipse.jetty.websocket.api.WebSocketAdapter
implements ClientInfo
This class defines an abstract WebSocket. It inherits the Jetty WebSocket adapter.
- Author:
- BaseX Team 2005-21, BSD License, Johannes Finckh
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the WebSocket connection.voidSends an error to the client.voidonWebSocketBinary(byte[] payload, int offset, int len) voidonWebSocketClose(int status, String message) voidonWebSocketConnect(org.eclipse.jetty.websocket.api.Session sess) voidonWebSocketError(Throwable cause) voidonWebSocketText(String message) Methods inherited from class org.eclipse.jetty.websocket.api.WebSocketAdapter
getRemote, getSession, isConnected, isNotConnectedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.basex.server.ClientInfo
clientName
-
Field Details
-
atts
WebSocket attributes. -
context
Database context. -
path
Path. -
id
Client WebSocket id. -
session
public javax.servlet.http.HttpSession sessionHTTP Session.
-
-
Method Details
-
onWebSocketConnect
public void onWebSocketConnect(org.eclipse.jetty.websocket.api.Session sess) - Specified by:
onWebSocketConnectin interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener- Overrides:
onWebSocketConnectin classorg.eclipse.jetty.websocket.api.WebSocketAdapter
-
onWebSocketError
- Specified by:
onWebSocketErrorin interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener- Overrides:
onWebSocketErrorin classorg.eclipse.jetty.websocket.api.WebSocketAdapter
-
onWebSocketClose
- Specified by:
onWebSocketClosein interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener- Overrides:
onWebSocketClosein classorg.eclipse.jetty.websocket.api.WebSocketAdapter
-
onWebSocketText
- Specified by:
onWebSocketTextin interfaceorg.eclipse.jetty.websocket.api.WebSocketListener- Overrides:
onWebSocketTextin classorg.eclipse.jetty.websocket.api.WebSocketAdapter
-
onWebSocketBinary
public void onWebSocketBinary(byte[] payload, int offset, int len) - Specified by:
onWebSocketBinaryin interfaceorg.eclipse.jetty.websocket.api.WebSocketListener- Overrides:
onWebSocketBinaryin classorg.eclipse.jetty.websocket.api.WebSocketAdapter
-
clientAddress
- Specified by:
clientAddressin interfaceClientInfo
-
clientName
- Specified by:
clientNamein interfaceClientInfo
-
close
public void close()Closes the WebSocket connection. -
error
Sends an error to the client.- Parameters:
ex- exception
-