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-23, BSD License, Johannes Finckh
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringclientAddress()StringclientName()voidclose()Closes the WebSocket connection.voiderror(Exception ex)Sends 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, isNotConnected
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.basex.server.ClientInfo
clientName
-
-
-
-
Method Detail
-
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
public void onWebSocketError(Throwable cause)
- Specified by:
onWebSocketErrorin interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener- Overrides:
onWebSocketErrorin classorg.eclipse.jetty.websocket.api.WebSocketAdapter
-
onWebSocketClose
public void onWebSocketClose(int status, String message)- Specified by:
onWebSocketClosein interfaceorg.eclipse.jetty.websocket.api.WebSocketConnectionListener- Overrides:
onWebSocketClosein classorg.eclipse.jetty.websocket.api.WebSocketAdapter
-
onWebSocketText
public void onWebSocketText(String message)
- 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
public String clientAddress()
- Specified by:
clientAddressin interfaceClientInfo
-
clientName
public String clientName()
- Specified by:
clientNamein interfaceClientInfo
-
close
public void close()
Closes the WebSocket connection.
-
error
public void error(Exception ex)
Sends an error to the client.- Parameters:
ex- exception
-
-