-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CB-3839. Added async error events messages for te
- Loading branch information
1 parent
9d99075
commit 7c1b4fc
Showing
5 changed files
with
68 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...r/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/events/EventHandlerLogSend.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* DBeaver - Universal Database Manager | ||
* Copyright (C) 2010-2023 DBeaver Corp | ||
* | ||
* All Rights Reserved. | ||
* | ||
* NOTICE: All information contained herein is, and remains | ||
* the property of DBeaver Corp and its suppliers, if any. | ||
* The intellectual and technical concepts contained | ||
* herein are proprietary to DBeaver Corp and its suppliers | ||
* and may be covered by U.S. and Foreign Patents, | ||
* patents in process, and are protected by trade secret or copyright law. | ||
* Dissemination of this information or reproduction of this material | ||
* is strictly forbidden unless prior written permission is obtained | ||
* from DBeaver Corp. | ||
*/ | ||
package io.cloudbeaver.server.events; | ||
|
||
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> { | ||
|
||
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 | ||
} | ||
} |