Package org.openhab.core.io.websocket
Interface WebSocketAdapter
- All Known Implementing Classes:
EventWebSocketAdapter
,LogWebSocketAdapter
@NonNullByDefault
public interface WebSocketAdapter
The
WebSocketAdapter
can be implemented to register an adapter for a websocket connection.
It will be accessible on the path /ws/ADAPTER_ID of your server.
Security is handled by the CommonWebSocketServlet
.- Author:
- Miguel Álvarez Díez - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptioncreateWebSocket
(org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest servletUpgradeRequest, org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse servletUpgradeResponse) Creates a websocket instance.getId()
The adapter id.
-
Method Details
-
getId
String getId()The adapter id. In combination with the base pathCommonWebSocketServlet.SERVLET_PATH
defines the adapter path.- Returns:
- the adapter id.
-
createWebSocket
Object createWebSocket(org.eclipse.jetty.websocket.servlet.ServletUpgradeRequest servletUpgradeRequest, org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse servletUpgradeResponse) Creates a websocket instance. It should use theorg.eclipse.jetty.websocket.api.annotations
or implementWebSocketListener
.- Returns:
- a websocket instance.
-