From e63d239c88aee423b914d58183b18861ce4baac1 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Mon, 21 Oct 2024 10:10:56 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-137543=20=E3=80=90fr-fbp=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E3=80=90=E6=95=B0=E6=8D=AE=E6=BA=90=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=20=E9=87=8D=E5=91=BD=E5=90=8D=E5=88=A4=E6=96=AD=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../connect/LocalConnectionSource.java | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java index 4b91320829..8dc3e2f2d2 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java @@ -1,7 +1,10 @@ package com.fr.design.data.datapane.connect; import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; +import com.fanruan.datasource.driver.bean.DriverLoaderBean; import com.fr.data.driver.DriverClassNotFoundException; +import com.fr.data.driver.DriverLoader; +import com.fr.data.driver.config.DriverLoaderConfig; import com.fr.data.impl.Connection; import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean; import com.fr.decision.webservice.exception.general.DriverNotFoundException; @@ -9,13 +12,15 @@ import com.fr.decision.webservice.v10.datasource.connection.processor.impl.Conne import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper; import com.fr.design.i18n.Toolkit; import com.fr.log.FineLoggerFactory; -import com.fr.security.encryption.transmission.TransmissionEncryptionManager; import com.fr.workspace.engine.exception.DriverUnExistException; import com.fr.workspace.server.repository.connection.BaseConnectionSource; + import java.sql.SQLException; import java.util.ArrayList; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 本地Connection资源操作 @@ -98,6 +103,26 @@ public class LocalConnectionSource extends BaseConnectionSource { } + + @Override + public Map getDriverLoaders() throws Exception { + return DriverLoaderConfig.getInstance().getDriverLoaders().entrySet().stream() + .collect(Collectors.toMap(Map.Entry::getKey, entry -> convertDriverLoader(entry.getValue()), (a, b) -> a, LinkedHashMap::new)); + } + + private DriverLoaderBean convertDriverLoader(DriverLoader driverLoader) { + if (driverLoader == null) { + return null; + } + DriverLoaderBean driverLoaderBean = new DriverLoaderBean(); + driverLoaderBean.setName(driverLoader.getName()); + driverLoaderBean.setDriverClass(driverLoader.getDriverClass()); + driverLoaderBean.setDriverList(driverLoader.getDriverList()); + driverLoaderBean.setDriverJarFiles(driverLoader.getDriverJarFiles()); + driverLoaderBean.setLoadingStrategy(driverLoader.getLoadingStrategy()); + return driverLoaderBean; + } + @Override public boolean lock(String str) { // 本地默认锁定成功,让其执行后续动作