From aa1471becb5da2be6aa5c8f3337954bbf58ee3cb Mon Sep 17 00:00:00 2001 From: ShadelessFox Date: Mon, 14 Oct 2024 18:50:41 +0200 Subject: [PATCH] dbeaver/pro#3393 Add "UDBT" feature --- .../io/cloudbeaver/model/app/BaseWebAppConfiguration.java | 4 ++++ .../src/io/cloudbeaver/model/app/WebAppConfiguration.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java index ab30ce377d..4c3a1714e1 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/BaseWebAppConfiguration.java @@ -84,14 +84,18 @@ public boolean isResourceManagerEnabled() { return resourceManagerEnabled; } + @Override public boolean isFeatureEnabled(String id) { return ArrayUtils.contains(getEnabledFeatures(), id); } + @Override public boolean isFeaturesEnabled(String[] features) { return ArrayUtils.containsAll(getEnabledFeatures(), features); } + @NotNull + @Override public String[] getEnabledFeatures() { if (enabledFeatures == null) { // No config - enable all features (+backward compatibility) diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/WebAppConfiguration.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/WebAppConfiguration.java index ca09529a49..c377b924b9 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/WebAppConfiguration.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/app/WebAppConfiguration.java @@ -44,6 +44,11 @@ public interface WebAppConfiguration { boolean isFeatureEnabled(String id); + @NotNull + default String[] getEnabledFeatures() { + return new String[0]; + } + default boolean isSupportsCustomConnections() { return true; }