Skip to content

Commit

Permalink
CB-3839. Refactor after review
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisSinelnikov committed Sep 20, 2023
1 parent d9167df commit 0f2ed5b
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@

import io.cloudbeaver.model.WebServerMessage;
import io.cloudbeaver.model.session.BaseWebSession;
import io.cloudbeaver.server.CBPlatform;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.websocket.WSEventHandler;
import org.jkiss.dbeaver.model.websocket.event.WSErrorEvent;

import java.util.Collection;

public class EventHandlerLogSend extends WSDefaultEventHandler<WSErrorEvent> {
public class WSEventLogSendHandler extends WSDefaultEventHandler<WSErrorEvent> {

protected void updateSessionData(@NotNull BaseWebSession activeUserSession, @NotNull WSErrorEvent event) {
activeUserSession.addSessionMessage(new WebServerMessage(WebServerMessage.MessageType.ERROR, event.getErrorMessage()));
}

protected boolean isAcceptableInSession(@NotNull BaseWebSession activeUserSession, @NotNull WSErrorEvent event) {
return WSWebUtils.isSessionIdEquals(activeUserSession, event.getSessionId()); // skip events from current session
return WSWebUtils.isSessionIdEquals(activeUserSession, event.getSessionId());
}
}

0 comments on commit 0f2ed5b

Please sign in to comment.