org.webbitserver.handler.logging.LoggingWebSocketConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webbit Show documentation
Show all versions of webbit Show documentation
A Java event based WebSocket and HTTP server
package org.webbitserver.handler.logging;
import org.webbitserver.WebSocketConnection;
import org.webbitserver.wrapper.WebSocketConnectionWrapper;
class LoggingWebSocketConnection extends WebSocketConnectionWrapper {
private final LogSink logSink;
LoggingWebSocketConnection(LogSink logSink, WebSocketConnection connection) {
super(connection);
this.logSink = logSink;
}
@Override
public WebSocketConnectionWrapper send(String message) {
logSink.webSocketOutboundData(this, message);
return super.send(message);
}
@Override
public WebSocketConnectionWrapper send(byte[] message) {
logSink.webSocketOutboundData(this, message);
return super.send(message);
}
@Override
public WebSocketConnectionWrapper ping(String message) {
logSink.webSocketOutboundPing(this, message);
return super.ping(message);
}
}