Class LogWebSocket
java.lang.Object
org.openhab.core.io.websocket.log.LogWebSocket
- All Implemented Interfaces:
EventListener,org.eclipse.jetty.websocket.api.Callback,org.osgi.service.log.LogListener
@WebSocket
@NonNullByDefault
public class LogWebSocket
extends Object
implements org.osgi.service.log.LogListener, org.eclipse.jetty.websocket.api.Callback
The
LogWebSocket is the WebSocket implementation for logs.
This supports sending of history, and provides a method of managing message cadence.
When a client connects, it must send a filter request before the server will send any logs. This triggers the sending
of history.
Live logs are sent as individual messages if they are received with sufficient spacing. When logs come in very
quickly, they are clustered together and sent as an array after up to 100mS.- Author:
- Jan N. Klug - Initial contribution, Chris Jackson - Add history and improve performance using arrays
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.websocket.api.Callback
org.eclipse.jetty.websocket.api.Callback.Completable -
Field Summary
Fields inherited from interface org.eclipse.jetty.websocket.api.Callback
NOOP -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.websocket.api.Callback
asBiConsumer
-
Constructor Details
-
LogWebSocket
-
-
Method Details
-
onClose
-
onOpen
@OnWebSocketOpen public void onOpen(org.eclipse.jetty.websocket.api.Session session) -
onText
-
onError
@OnWebSocketError public void onError(@Nullable org.eclipse.jetty.websocket.api.Session session, @Nullable Throwable error) -
logged
public void logged(@NonNullByDefault({}) org.osgi.service.log.LogEntry logEntry) - Specified by:
loggedin interfaceorg.osgi.service.log.LogListener- Implementation note:
- Under no circumstances must this method result in something being logged, since that causes an "endless circle".
-
succeed
public void succeed()- Specified by:
succeedin interfaceorg.eclipse.jetty.websocket.api.Callback
-
fail
- Specified by:
failin interfaceorg.eclipse.jetty.websocket.api.Callback
-