Browse Source

REPORT-89171 设计器新增不支持的数据库类型未受到限制

【问题原因】未考虑远程设计下,获取服务器的lic信息
【改动思路】增加rpc接口,获取服务器lic是否限制数据库类型
release/11.0
Leo.Qin 2 years ago
parent
commit
ec630185df
  1. 3
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  2. 13
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

3
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -22,7 +22,6 @@ import com.fr.file.ConnectionConfig;
import com.fr.file.ConnectionOperator;
import com.fr.general.NameObject;
import com.fr.log.FineLoggerFactory;
import com.fr.regist.FRCoreContext;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
@ -116,6 +115,8 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
/**
* 创建菜单项
* <p>
* 方法中获取limitDatabaseType使用了远程rpc调用可能会比较耗时
*
* @return 菜单项
*/

13
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java

@ -1,14 +1,16 @@
package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.design.gui.frpane.LoadingBasicPane;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.file.ConnectionConfig;
import com.fr.general.NameObject;
import com.fr.license.database.DatabaseTypeValidateUtil;
import com.fr.license.exception.DataBaseNotSupportedException;
import com.fr.stable.Nameable;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.database.DataBaseTypeOperator;
import javax.swing.JPanel;
import java.awt.BorderLayout;
@ -75,7 +77,14 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio
Nameable wrapper = selectedValue.wrapper;
try {
Connection connection = (Connection) ((NameObject) wrapper).getObject();
DatabaseTypeValidateUtil.validateDatabaseType(connection.getDriver(), connection.feature());
// 仅校验jdbc连接,其他插件数据连接不进行校验
if (connection instanceof JDBCDatabaseConnection) {
DataBaseNotSupportedException exception = WorkContext.getCurrent().get(DataBaseTypeOperator.class).validateDatabaseType(connection.getDriver(), connection.feature());
if (exception != null) {
throw exception;
}
}
} catch (DataBaseNotSupportedException e) {
// 仅抛出数据库类型不支持异常
throw e;

Loading…
Cancel
Save