Browse Source

Pull request #15123: REPORT-137543 【fr-fbp冒烟】【数据源】设计器数据连接 重命名判断异常

Merge in DESIGN/design from ~DESTINY.LIN/design:fbp/release to fbp/release

* commit '7701e1a73def72ed6d48d9a7384317e8da8580ce':
  REPORT-137543 【fr-fbp冒烟】【数据源】设计器数据连接 重命名判断异常
fbp/release
Destiny.Lin-林锦龙 1 month ago
parent
commit
05c4d0a980
  1. 27
      designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java

27
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<String, DriverLoaderBean> 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) {
// 本地默认锁定成功,让其执行后续动作

Loading…
Cancel
Save