Skip to content

Commit 092ee9e

Browse files
committed
Merge remote-tracking branch 'origin/devel' into 7157-external-browser-auth-model
# Conflicts: # server/bundles/io.cloudbeaver.server/schema/service.events.graphqls
2 parents 3bb03f2 + 78daa21 commit 092ee9e

File tree

129 files changed

+3090
-2403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+3090
-2403
lines changed

server/bundles/io.cloudbeaver.model.cli/META-INF/MANIFEST.MF

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
33
Bundle-Vendor: DBeaver Corp
44
Bundle-Name: Cloudbeaver Web Model
55
Bundle-SymbolicName: io.cloudbeaver.model.cli;singleton:=true
6-
Bundle-Version: 1.0.0.qualifier
7-
Bundle-Release-Date: 20251222
6+
Bundle-Version: 1.0.1.qualifier
7+
Bundle-Release-Date: 20260105
88
Bundle-RequiredExecutionEnvironment: JavaSE-21
99
Bundle-ActivationPolicy: lazy
1010
Require-Bundle: org.jkiss.dbeaver.model.cli;visibility:=reexport

server/bundles/io.cloudbeaver.model.cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<relativePath>../</relativePath>
1111
</parent>
1212
<artifactId>io.cloudbeaver.model.cli</artifactId>
13-
<version>1.0.0-SNAPSHOT</version>
13+
<version>1.0.1-SNAPSHOT</version>
1414
<packaging>eclipse-plugin</packaging>
1515

1616
</project>

server/bundles/io.cloudbeaver.model/META-INF/MANIFEST.MF

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
33
Bundle-Vendor: DBeaver Corp
44
Bundle-Name: Cloudbeaver Web Model
55
Bundle-SymbolicName: io.cloudbeaver.model;singleton:=true
6-
Bundle-Version: 1.0.91.qualifier
7-
Bundle-Release-Date: 20251222
6+
Bundle-Version: 1.0.92.qualifier
7+
Bundle-Release-Date: 20260105
88
Bundle-RequiredExecutionEnvironment: JavaSE-21
99
Bundle-ActivationPolicy: lazy
1010
Require-Bundle: org.jkiss.dbeaver.data.gis;visibility:=reexport,
@@ -25,6 +25,8 @@ Export-Package: io.cloudbeaver,
2525
io.cloudbeaver.auth.provider.local,
2626
io.cloudbeaver.auth.provisioning,
2727
io.cloudbeaver.websocket,
28+
io.cloudbeaver.websocket.event.client,
29+
io.cloudbeaver.websocket.event.task,
2830
io.cloudbeaver.model,
2931
io.cloudbeaver.model.app,
3032
io.cloudbeaver.model.config,

server/bundles/io.cloudbeaver.model/plugin.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,27 @@
2525
label="Default secret controller" description="Default void secret controller"/>
2626
</extension>
2727

28+
<extension point="org.jkiss.dbeaver.ws.event">
29+
<event topicId="cb_session_task" id="cb_session_task_info_updated"
30+
class="io.cloudbeaver.websocket.event.task.WSSessionTaskInfoEvent"/>
31+
32+
<event topicId="cb_session_task" id="cb_session_task_confirmation_request"
33+
class="io.cloudbeaver.websocket.event.task.WSSessionTaskConfirmationRequestEvent"/>
34+
<event topicId="cb_session_task" id="cb_session_task_query_confirmation_request"
35+
class="io.cloudbeaver.websocket.event.task.WSSessionTaskQueryConfirmationRequestEvent"/>
36+
<event topicId="cb_session_task" id="cb_session_task_query_params_confirmation_request"
37+
class="io.cloudbeaver.websocket.event.task.WSSessionTaskQueryParamsConfirmationEvent"/>
38+
39+
<clientEvent id="cb_client_session_ping" class="io.cloudbeaver.websocket.event.client.WSSessionPingClientEvent"/>
40+
<clientEvent id="cb_client_topic_subscribe" class="io.cloudbeaver.websocket.event.client.WSSubscribeOnTopicClientEvent"/>
41+
<clientEvent id="cb_client_topic_unsubscribe"
42+
class="io.cloudbeaver.websocket.event.client.WSUnsubscribeFromTopicClientEvent"/>
43+
<clientEvent id="cb_client_projects_active"
44+
class="io.cloudbeaver.websocket.event.client.WSUpdateActiveProjectsClientEvent"/>
45+
<clientEvent id="cb_client_session_task_confirmation"
46+
class="io.cloudbeaver.websocket.event.client.WSSessionTaskConfirmationEvent"/>
47+
<clientEvent id="cb_client_session_task_with_parameters_confirmation"
48+
class="io.cloudbeaver.websocket.event.client.WSSessionTaskWithParametersConfirmationEvent"/>
49+
</extension>
50+
2851
</plugin>

server/bundles/io.cloudbeaver.model/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<relativePath>../</relativePath>
1111
</parent>
1212
<artifactId>io.cloudbeaver.model</artifactId>
13-
<version>1.0.91-SNAPSHOT</version>
13+
<version>1.0.92-SNAPSHOT</version>
1414
<packaging>eclipse-plugin</packaging>
1515

1616
</project>

server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/session/WebSession.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,10 @@ public boolean asyncTaskCancel(String taskId) throws DBWebException {
570570
if (job instanceof CustomCancelableJob cancelableJob) {
571571
cancelableJob.cancelJob(this, taskInfo);
572572
}
573+
CompletableFuture<?> future = getAttribute(getTaskConfirmationAttributeName(taskId));
574+
if (future != null) {
575+
future.cancel(false);
576+
}
573577
if (job != null) {
574578
job.cancel();
575579
}
@@ -1027,7 +1031,7 @@ public void handleTaskConfirmation(
10271031
boolean confirmed,
10281032
boolean skipConfirmations
10291033
) {
1030-
String attributeName = WebSQLConstants.TASK_CONFIRMATION_ATTR_PREFIX + taskId;
1034+
String attributeName = getTaskConfirmationAttributeName(taskId);
10311035
if (confirmed && skipConfirmations) {
10321036
setAttribute(WebSQLConstants.SKIP_TASK_CONFIRMATIONS_ATTR, Boolean.TRUE);
10331037
}
@@ -1041,6 +1045,23 @@ public void handleTaskConfirmation(
10411045
}
10421046
}
10431047

1048+
1049+
public void handleTaskConfirmationWithParameters(@NotNull String taskId, @NotNull Map<String, Object> parameters) {
1050+
String attributeName = getTaskConfirmationAttributeName(taskId);
1051+
CompletableFuture<Map<String, Object>> confirmationFuture = getAttribute(attributeName);
1052+
if (confirmationFuture != null) {
1053+
confirmationFuture.complete(parameters);
1054+
removeAttribute(attributeName);
1055+
} else {
1056+
log.error("Received unexpected confirmation event for taskId: " + taskId);
1057+
}
1058+
}
1059+
1060+
@NotNull
1061+
private String getTaskConfirmationAttributeName(@NotNull String taskId) {
1062+
return WebSQLConstants.TASK_CONFIRMATION_ATTR_PREFIX + taskId;
1063+
}
1064+
10441065
private class SessionProgressMonitor extends BaseProgressMonitor {
10451066
@Override
10461067
public void beginTask(@NotNull String name, int totalWork) {

server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebEventUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import io.cloudbeaver.model.WebAsyncTaskInfo;
2020
import io.cloudbeaver.model.session.WebSession;
21+
import io.cloudbeaver.websocket.event.task.WSSessionTaskInfoEvent;
2122
import org.jkiss.code.NotNull;
2223
import org.jkiss.code.Nullable;
2324
import org.jkiss.dbeaver.model.app.DBPProject;
@@ -30,7 +31,6 @@
3031
import org.jkiss.dbeaver.model.websocket.event.permissions.WSSubjectPermissionEvent;
3132
import org.jkiss.dbeaver.model.websocket.event.resource.WSResourceProperty;
3233
import org.jkiss.dbeaver.model.websocket.event.resource.WSResourceUpdatedEvent;
33-
import org.jkiss.dbeaver.model.websocket.event.session.WSSessionTaskInfoEvent;
3434

3535
import java.util.List;
3636

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2024 DBeaver Corp and others
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.cloudbeaver.websocket.event.client;
18+
19+
import org.jkiss.code.Nullable;
20+
import org.jkiss.dbeaver.model.websocket.event.WSClientEvent;
21+
22+
public class WSSessionPingClientEvent extends WSClientEvent {
23+
public static final String ID = "cb_client_session_ping";
24+
25+
public WSSessionPingClientEvent(@Nullable String topicId) {
26+
super(ID, topicId);
27+
}
28+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2025 DBeaver Corp and others
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.cloudbeaver.websocket.event.client;
18+
19+
import org.jkiss.code.NotNull;
20+
import org.jkiss.dbeaver.model.websocket.WSConstants;
21+
import org.jkiss.dbeaver.model.websocket.event.WSClientEvent;
22+
23+
public class WSSessionTaskConfirmationEvent extends WSClientEvent {
24+
public static final String ID = "cb_client_session_task_confirmation";
25+
26+
private final String taskId;
27+
private final boolean confirmed;
28+
private final boolean skipConfirmations;
29+
30+
public WSSessionTaskConfirmationEvent(
31+
@NotNull String taskId,
32+
boolean confirmed,
33+
boolean skipConfirmations
34+
) {
35+
super(ID, WSConstants.TOPIC_SESSION_TASK);
36+
this.taskId = taskId;
37+
this.confirmed = confirmed;
38+
this.skipConfirmations = skipConfirmations;
39+
}
40+
41+
public String getTaskId() {
42+
return taskId;
43+
}
44+
45+
public boolean isConfirmed() {
46+
return confirmed;
47+
}
48+
49+
public boolean isSkipConfirmations() {
50+
return skipConfirmations;
51+
}
52+
}
53+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* DBeaver - Universal Database Manager
3+
* Copyright (C) 2010-2025 DBeaver Corp and others
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
package io.cloudbeaver.websocket.event.client;
18+
19+
import org.jkiss.code.NotNull;
20+
import org.jkiss.dbeaver.model.websocket.WSConstants;
21+
import org.jkiss.dbeaver.model.websocket.event.WSClientEvent;
22+
23+
import java.util.Map;
24+
25+
public class WSSessionTaskWithParametersConfirmationEvent extends WSClientEvent {
26+
public static final String ID = "cb_client_session_task_with_parameters_confirmation";
27+
@NotNull
28+
private final String taskId;
29+
@NotNull
30+
private final Map<String, Object> parameters;
31+
32+
protected WSSessionTaskWithParametersConfirmationEvent(@NotNull String taskId, @NotNull Map<String, Object> parameters) {
33+
super(ID, WSConstants.TOPIC_SESSION_TASK);
34+
this.taskId = taskId;
35+
this.parameters = parameters;
36+
}
37+
38+
@NotNull
39+
public String getTaskId() {
40+
return taskId;
41+
}
42+
43+
@NotNull
44+
public Map<String, Object> getParameters() {
45+
return parameters;
46+
}
47+
}

0 commit comments

Comments
 (0)