You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.6 KiB
40 lines
1.6 KiB
package com.fr.plugin.db.procedure.stableKey; |
|
|
|
import com.fr.decision.webservice.bean.datasource.ConnectionInfoBean; |
|
import com.fr.decision.webservice.v10.datasource.connection.ConnectionService; |
|
import com.fr.decision.webservice.v10.user.UserService; |
|
import com.fr.log.FineLoggerFactory; |
|
import com.fr.stable.StringUtils; |
|
|
|
import java.util.List; |
|
|
|
public class ConnectActionImpl implements ConnectAction{ |
|
@Override |
|
public String get(String in) { |
|
FineLoggerFactory.getLogger().info("远程获取连接:"+in); |
|
String result = ""; |
|
String adminUserId = ""; |
|
try { |
|
List<String> adminUserIds = UserService.getInstance().getAdminUserIdList(); |
|
adminUserId = adminUserIds.get(0); |
|
FineLoggerFactory.getLogger().info("远程获取连接超管id:"+adminUserId); |
|
ConnectionInfoBean[] infoBeans = ConnectionService.getInstance().getConnections(adminUserId); |
|
FineLoggerFactory.getLogger().info("infoBeans:"+infoBeans.length); |
|
|
|
for(ConnectionInfoBean bean:infoBeans){ |
|
result+=(bean.getConnectionName()+","); |
|
FineLoggerFactory.getLogger().info("连接名字:"+bean.getConnectionName()); |
|
} |
|
|
|
if(StringUtils.isNotBlank(result)){ |
|
result = result.substring(0,result.length()-1); |
|
} |
|
FineLoggerFactory.getLogger().info("远程获取连接结果为:"+result); |
|
} catch (Exception e) { |
|
e.printStackTrace(); |
|
FineLoggerFactory.getLogger().info("获取连接失败"); |
|
} |
|
|
|
return result; |
|
} |
|
}
|
|
|