Browse Source

改一下提交方式,抽出来公共的部分

feature/x
obo 1 year ago
parent
commit
7fd6b4cf1e
  1. 14
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

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

@ -53,6 +53,8 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import static com.fr.base.ConnectionLogHelper.logDesignerConnectionOperateMessage;
/**
* Connection List Pane.
*/
@ -354,22 +356,20 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
return Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
removedConnNames.forEach(n -> {
MetricRegistry.getMetric().submit(OperateMessage.build("Dec-Data_Connection", "Dec-Data_Connection_Design",
n, OperateConstants.DELETE, InterProviderFactory.getProvider().getLocText("Dec-Designer_User"), null, null));
ConnectionConfig.getInstance().removeConnection(n);
});
removedConnNames.forEach(n -> ConnectionConfig.getInstance().removeConnection(n));
logDesignerConnectionOperateMessage(removedConnNames, OperateConstants.DELETE);
int innerRemaining = remaining;
List<String> addConnNames = new ArrayList<>();
for (ConnectionBean cb : addedOrUpdatedConnections) {
if (innerRemaining > 0) {
MetricRegistry.getMetric().submit(OperateMessage.build("Dec-Data_Connection", "Dec-Data_Connection_Design",
cb.getName(), OperateConstants.ADD, InterProviderFactory.getProvider().getLocText("Dec-Designer_User"), null, null));
ConnectionConfig.getInstance().addConnectionWithoutCheck(cb.getName(), cb.getConnection());
innerRemaining--;
addConnNames.add(cb.getName());
} else {
break;
}
}
logDesignerConnectionOperateMessage(addConnNames, OperateConstants.ADD);
}
});
} catch (Exception e) {

Loading…
Cancel
Save