app Http、app DNS、app ssl增加导入功能
This commit is contained in:
@@ -1231,12 +1231,14 @@ public class BaseController {
|
||||
BlockingQueue<DnsResStrategy> dnsResStrategies=null;
|
||||
List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
||||
List<AppPolicyCfg> appPolicyCfgs = new ArrayList<AppPolicyCfg>();
|
||||
List<AppFeatureIndex> appFeatureIndexs= new ArrayList<AppFeatureIndex>();
|
||||
List<Map<Long,Integer>> asnNoMaps=Lists.newArrayList();
|
||||
Map<Long,Integer> newAsnNoMap=Maps.newConcurrentMap();
|
||||
Map<Long,Integer> OldAsnNoMap=Maps.newConcurrentMap();
|
||||
asnNoMaps.add(newAsnNoMap);
|
||||
asnNoMaps.add(OldAsnNoMap);
|
||||
FunctionRegionDict appRegion = null;
|
||||
FunctionRegionDict appFeatureRegion = null;
|
||||
if(serviceDict!=null) {
|
||||
String regionCode = serviceDict.getRegionCode();
|
||||
for (String code : regionCode.split(",")) {
|
||||
@@ -1248,6 +1250,12 @@ public class BaseController {
|
||||
appRegion = d;
|
||||
break;
|
||||
}
|
||||
|
||||
if (d != null && d.getFunctionId() != null
|
||||
&& (d.getFunctionId().intValue()==565 || d.getFunctionId().intValue()==564 || d.getFunctionId().intValue()==566 || d.getFunctionId().intValue()==563)) {
|
||||
appFeatureRegion = d;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1375,6 +1383,7 @@ public class BaseController {
|
||||
String specServiceId = request.getParameter("appId");
|
||||
String behaviorId = request.getParameter("behaviorId");
|
||||
String asnIpGroup = request.getParameter("asnGroupId");
|
||||
|
||||
String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
SpecificServiceCfg specificServiceCfg = null;
|
||||
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33 || serviceDict.getServiceId().intValue() == 145
|
||||
@@ -1385,6 +1394,9 @@ public class BaseController {
|
||||
|| serviceDict.getServiceId().intValue() == 1028// app ip
|
||||
|| serviceDict.getServiceId().intValue() == 1024//app http
|
||||
|| serviceDict.getServiceId().intValue() == 1026//app domain
|
||||
|| serviceDict.getServiceId().intValue() == 1027//app dns
|
||||
|| serviceDict.getServiceId().intValue() == 1029//app ssl
|
||||
|| serviceDict.getServiceId().intValue() == 1025//app PAYLOAD
|
||||
)) {
|
||||
if (StringUtils.isNotBlank(specServiceId)) {
|
||||
specificServiceCfg = specificServiceCfgService
|
||||
@@ -1530,7 +1542,7 @@ public class BaseController {
|
||||
asnIpCfgs.add(_cfg);
|
||||
ind++;
|
||||
}
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, asnIpCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, asnIpCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||
cfgIndexInfos.clear();
|
||||
appPolicyCfgs.clear();
|
||||
_ipPortCfgs.clear();
|
||||
@@ -1651,15 +1663,29 @@ public class BaseController {
|
||||
if(regionDict.getFunctionId().intValue()!=600
|
||||
&®ionDict.getFunctionId().intValue()!=301
|
||||
&®ionDict.getFunctionId().intValue()!=401
|
||||
&®ionDict.getFunctionId().intValue()!=405) {
|
||||
&®ionDict.getFunctionId().intValue()!=405
|
||||
&®ionDict.getFunctionId().intValue()!=565
|
||||
&®ionDict.getFunctionId().intValue()!=566
|
||||
&®ionDict.getFunctionId().intValue()!=563) {
|
||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"});
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
}
|
||||
if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 || regionDict.getFunctionId().intValue()==563){
|
||||
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||
if(appFeatureRegion!=null){
|
||||
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
||||
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
||||
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
||||
}
|
||||
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
||||
appFeatureIndexs.add(appfeature);
|
||||
}
|
||||
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||
cfgIndexInfos.clear();
|
||||
appPolicyCfgs.clear();
|
||||
_ipPortCfgs.clear();
|
||||
@@ -1784,7 +1810,7 @@ public class BaseController {
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _stringCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||
cfgIndexInfos.clear();
|
||||
appPolicyCfgs.clear();
|
||||
_stringCfgs.clear();
|
||||
@@ -1874,16 +1900,27 @@ public class BaseController {
|
||||
appPolicyCfgs.add(appPolicyCfg);
|
||||
}
|
||||
} else {
|
||||
if(!regionDict.getFunctionId().equals(402)) {
|
||||
if(!regionDict.getFunctionId().equals(402) && !regionDict.getFunctionId().equals(565)
|
||||
&& !regionDict.getFunctionId().equals(566) && !regionDict.getFunctionId().equals(564)) {
|
||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"});
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
}
|
||||
|
||||
if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566
|
||||
|| regionDict.getFunctionId().intValue()==564){
|
||||
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
||||
if(appFeatureRegion!=null){
|
||||
appfeature.setCfgRegionCode1(String.valueOf(appFeatureRegion.getConfigRegionCode()));
|
||||
appfeature.setCfgRegionValue(appFeatureRegion.getConfigRegionValue());
|
||||
appfeature.setCfgRegionType(String.valueOf(appFeatureRegion.getRegionType()));
|
||||
}
|
||||
appFeatureIndexs.add(appfeature);
|
||||
}
|
||||
}
|
||||
ind++;
|
||||
}
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||
cfgIndexInfos.clear();
|
||||
appPolicyCfgs.clear();
|
||||
_complexkeywordCfgs.clear();
|
||||
@@ -1923,7 +1960,7 @@ public class BaseController {
|
||||
cfg.setCompileId(compileIds.get(ind));
|
||||
ind++;
|
||||
}
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _dnsResStrategies, cfgIndexInfos, appPolicyCfgs,isSend.equals("1"));
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _dnsResStrategies, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||
_dnsResStrategies.clear();
|
||||
cfgIndexInfos.clear();
|
||||
appPolicyCfgs.clear();
|
||||
|
||||
Reference in New Issue
Block a user