修正Ip Spoofing配置导入模板'direction'字段默认值批注;修改配置导入域名字段校验;修复配置导入属性验证发生异常后无提示信息问题(王鑫)

(cherry picked from commit 38f563ceee07bfdaa4d94cc5ca6f712edb894d40)
This commit is contained in:
zhangwenqing
2019-01-23 10:02:58 +00:00
committed by 王鑫
parent 1f4618ae7f
commit 498fee3727
11 changed files with 149 additions and 21 deletions

View File

@@ -496,7 +496,7 @@ public class ExportExcel {
commentStr=commentStr+""+msgProp.getProperty("required")+"\n";
index++;
}
if(("domain_name".equals(headerStr)) && (region.getFunctionId().equals(560))){
if("domain_name".equals(headerStr)){
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
index++;
//1、非空
@@ -1113,9 +1113,9 @@ public class ExportExcel {
commentStr="";
}
if(StringUtil.isEmpty(defaultValue)){
defaultValue="0";
defaultValue = region.getConfigDirection().split(",")[0];
}
defaultValue = region.getFunctionId().equals(301)?"1":defaultValue;
}
/*}*/
/*if(StringUtil.isEmpty(commentStr)){

View File

@@ -45,6 +45,7 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable<String
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==3) {
@@ -57,10 +58,15 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable<String
//msg=e.getMessage();
//msg.append(e.getMessage());
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<AppComplexFeatureCfg> checkAppComplexFeatureCfg(StringBuffer msg,

View File

@@ -45,6 +45,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==3) {
@@ -57,10 +58,15 @@ public class CheckComplexStringFormatThread implements Callable<String>{
//msg=e.getMessage();
//msg.append(e.getMessage());
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<ComplexkeywordCfg> checkComplexStringCfg(StringBuffer msg,

View File

@@ -42,6 +42,7 @@ public class CheckDnsResStrategyFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==6) {
@@ -53,10 +54,15 @@ public class CheckDnsResStrategyFormatThread implements Callable<String>{
// TODO: handle exception
//msg=e.getMessage();
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<DnsResStrategy> checkDnsResStrategyCfg(StringBuffer msg,List<?> list)

View File

@@ -51,6 +51,7 @@ public class CheckIpFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==1) {
@@ -63,10 +64,15 @@ public class CheckIpFormatThread implements Callable<String>{
// TODO: handle exception
//msg.append(e.getMessage());
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
public List<BaseIpCfg> checkIpCfg(StringBuffer msg,List<Map<Long,AsnGroupInfo>> asnNos, List<Object> list)

View File

@@ -44,6 +44,7 @@ public class CheckStringFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==2) {
@@ -55,10 +56,15 @@ public class CheckStringFormatThread implements Callable<String>{
// TODO: handle exception
//msg=e.getMessage();
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
@@ -84,7 +90,7 @@ public class CheckStringFormatThread implements Callable<String>{
}
StringBuffer errTip = new StringBuffer();
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
Pattern domainPattern = Pattern.compile(Constants.DOMAIN_REGEXP);
Pattern domainPattern = Pattern.compile("^[a-zA-Z0-9.-]*$");
for (int i = 0; i < list.size(); i++) {
StringBuffer errInfo = new StringBuffer();
BaseStringCfg baseStringCfg = new BaseStringCfg();

View File

@@ -47,6 +47,7 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
public String call() throws Exception {
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
StringBuffer msg=new StringBuffer();
boolean error = false;
while(!srcQueue.isEmpty()) {
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
if(regionDict.getRegionType().intValue()==2) {
@@ -58,10 +59,15 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
// TODO: handle exception
//msg=e.getMessage();
//break;
error = true;
}
}
dataList.clear();
}
if(error) {
msg.append("validate_error");
}
return msg.toString();
}
@@ -87,7 +93,7 @@ public class CheckTopicWebsiteFormatThread implements Callable<String>{
}
StringBuffer errTip = new StringBuffer();
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
Pattern domainPattern = Pattern.compile(Constants.DOMAIN_REGEXP);
Pattern domainPattern = Pattern.compile("^[a-zA-Z0-9.-]*$");
for (int i = 0; i < list.size(); i++) {
StringBuffer errInfo = new StringBuffer();
AppTopicDomainCfg baseStringCfg = new AppTopicDomainCfg();