From 0f2ed5bd58261a52942c59ec00ee93506db45a06 Mon Sep 17 00:00:00 2001 From: Denis Sinelnikov Date: Wed, 20 Sep 2023 11:45:20 +0400 Subject: [PATCH] CB-3839. Refactor after review --- ...ventHandlerLogSend.java => WSEventLogSendHandler.java} | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) rename server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/{EventHandlerLogSend.java => WSEventLogSendHandler.java} (83%) diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/EventHandlerLogSend.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/WSEventLogSendHandler.java similarity index 83% rename from server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/EventHandlerLogSend.java rename to server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/WSEventLogSendHandler.java index b4a65626b1..0b90a32548 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/EventHandlerLogSend.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/WSEventLogSendHandler.java @@ -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 { +public class WSEventLogSendHandler extends WSDefaultEventHandler { 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()); } }