@@ -13,11 +13,24 @@ import com.nis.domain.restful.IpRegion;
import com.nis.domain.restful.NumRegion ;
import com.nis.domain.restful.NumRegion ;
import com.nis.domain.restful.StrRegion ;
import com.nis.domain.restful.StrRegion ;
import com.nis.listener.SystemConfigListener ;
import com.nis.listener.SystemConfigListener ;
import com.nis.restful.CompileJudge Code ;
import com.nis.restful.RestBusiness Code ;
import com.nis.web.service.restful.ConfigSourcesService ;
import com.nis.web.service.restful.ConfigSourcesService ;
public class CompileVal {
public class CompileVal {
private static Integer businessCode = null ;
/**
* @param businessCode the businessCode to set
*/
public static void setBusinessCode ( Integer businessCode ) {
CompileVal . businessCode = businessCode ;
}
/**
* @return the businessCode
*/
public static Integer getBusinessCode ( ) {
return businessCode ;
}
/**
/**
* 判断当前编译配置中的groupNum属性值与配置分组groupList大小是否小于等于8且大于0
* 判断当前编译配置中的groupNum属性值与配置分组groupList大小是否小于等于8且大于0
*
*
@@ -37,76 +50,44 @@ public class CompileVal {
return valCompile ;
return valCompile ;
}
}
}
}
if ( null = = configCompile . getCompileId ( ) ) {
return " compileId字段不能为空 " ;
}
if ( null = = configCompile . getGroupNum ( ) ) {
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudgeCode . GroupNumIsNull . getErrorReason ( ) ;
}
if ( null ! = configCompile . getGroupNum ( ) & & configCompile . getGroupNum ( ) > 8 ) {
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudgeCode . GroupNumGtEight . getErrorReason ( ) ;
}
if ( null ! = configCompile . getGroupNum ( ) & & configCompile . getGroupNum ( ) < = 0 ) {
if ( null ! = configCompile . getGroupNum ( ) & & configCompile . getGroupNum ( ) < = 0 ) {
businessCode = RestBusinessCode . GroupNumIsZero . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudge Code. GroupNumEQ Zero . getErrorReason ( ) ;
+ RestBusiness Code. GroupNumIs Zero . getErrorReason ( ) ;
}
}
if ( null ! = configCompile . getGroupNum ( ) & & configCompile . getGroupNum ( ) > 8 ) {
businessCode = RestBusinessCode . GroupNumGtEight . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ RestBusinessCode . GroupNumGtEight . getErrorReason ( ) ;
}
if ( null = = configCompile . getGroupRelationList ( ) ) {
if ( null = = configCompile . getGroupRelationList ( ) | | configCompile . getGroupRelationList ( ) . size ( ) = = 0 ) {
businessCode = RestBusinessCode . CompileGroupIsNull . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudge Code. CompileGroupIsNull . getErrorReason ( ) ;
+ RestBusiness Code. CompileGroupIsNull . getErrorReason ( ) ;
}
if ( null ! = configCompile . getGroupRelationList ( ) & & configCompile . getGroupRelationList ( ) . size ( ) < = 0 ) {
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudgeCode . GroupListEQZero . getErrorReason ( ) ;
}
if ( null ! = configCompile . getGroupRelationList ( ) & & configCompile . getGroupRelationList ( ) . size ( ) > 8 ) {
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudgeCode . GroupListGtEight . getErrorReason ( ) ;
}
}
if ( configCompile . getGroupRelationList ( ) . size ( ) ! = configCompile . getGroupNum ( ) ) {
if ( configCompile . getGroupRelationList ( ) . size ( ) ! = configCompile . getGroupNum ( ) ) {
businessCode = RestBusinessCode . GroupNumNEQGroupList . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudge Code. GroupNumNEQGroupList . getErrorReason ( ) ;
+ RestBusiness Code. GroupNumNEQGroupList . getErrorReason ( ) ;
}
}
// int sizeCount = 0;
// if (configCompile.getIpRegionList() == null &&
// configCompile.getStrRegionList() == null
// && configCompile.getNumRegionList() == null) {
// return "编译配置id为" + configCompile.getCompileId() + "的配置中"
// + CompileJudgeCode.CompileNotNull.getErrorReason();
// } else {
// if (configCompile.getIpRegionList() != null) {
// sizeCount += configCompile.getIpRegionList().size();
// }
// if (configCompile.getStrRegionList() != null) {
// sizeCount += configCompile.getStrRegionList().size();
// }
// if (configCompile.getNumRegionList() != null) {
// sizeCount += configCompile.getNumRegionList().size();
// }
//
// if (sizeCount == 0) {
// return "编译配置id为" + configCompile.getCompileId() + "的配置中"
// + CompileJudgeCode.CompileNotNull.getErrorReason();
// }
// }
if ( ! isUpdate ) {
if ( ! isUpdate ) {
if ( configCompile . getIsValid ( ) ! = 1 ) {
if ( configCompile . getIsValid ( ) ! = 1 ) {
businessCode = RestBusinessCode . IsValidIsT . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置在添加时不能为无效 " ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置在添加时不能为无效 " ;
}
}
} else {
} else {
businessCode = RestBusinessCode . IsValidIsF . getValue ( ) ;
if ( configCompile . getIsValid ( ) ! = 0 ) {
if ( configCompile . getIsValid ( ) ! = 0 ) {
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置在修改时不能为有效 " ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置在修改时不能为有效 " ;
}
}
}
}
return CompileJudgeCode . GroupNumAndListLtEight . getErrorReason ( ) ;
return " ok " ;
} else {
} else {
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的 " + CompileJudge Code. CompileIsNull . getErrorReason ( ) ;
return RestBusiness Code. CompileIsNull . getErrorReason ( ) ;
}
}
}
}
@@ -134,10 +115,12 @@ public class CompileVal {
if ( groupRelationList . size ( ) > 0 ) {
if ( groupRelationList . size ( ) > 0 ) {
for ( ConfigGroupRelation configGroupRelation : groupRelationList ) {
for ( ConfigGroupRelation configGroupRelation : groupRelationList ) {
if ( ! isUpdate & & ( null = = configGroupRelation . getIsValid ( ) | | configGroupRelation . getIsValid ( ) ! = 1 ) ) {
if ( ! isUpdate & & ( null = = configGroupRelation . getIsValid ( ) | | configGroupRelation . getIsValid ( ) ! = 1 ) ) {
businessCode = RestBusinessCode . IsValidIsT . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置groupRelationList字段中的groupId为 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置groupRelationList字段中的groupId为 "
+ configGroupRelation . getGroupId ( ) + " 的配置在添加时不能为无效 " ;
+ configGroupRelation . getGroupId ( ) + " 的配置在添加时不能为无效 " ;
}
}
if ( isUpdate & & ( null = = configGroupRelation . getIsValid ( ) | | configGroupRelation . getIsValid ( ) ! = 0 ) ) {
if ( isUpdate & & ( null = = configGroupRelation . getIsValid ( ) | | configGroupRelation . getIsValid ( ) ! = 0 ) ) {
businessCode = RestBusinessCode . IsValidIsF . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置groupRelationList字段中的groupId为 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置groupRelationList字段中的groupId为 "
+ configGroupRelation . getGroupId ( ) + " 的配置在修改时不能为有效 " ;
+ configGroupRelation . getGroupId ( ) + " 的配置在修改时不能为有效 " ;
}
}
@@ -150,26 +133,30 @@ public class CompileVal {
}
}
if ( ! configGroupRelation . getCompileId ( ) . equals ( compileId ) ) {
if ( ! configGroupRelation . getCompileId ( ) . equals ( compileId ) ) {
businessCode = RestBusinessCode . CompileIdIsNeq . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中groupRelationList字段中的groupId为 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中groupRelationList字段中的groupId为 "
+ configGroupRelation . getGroupId ( ) + " 的配置分组与编译配置id不一致 " ;
+ configGroupRelation . getGroupId ( ) + " 的配置分组与编译配置id不一致 " ;
}
}
if ( ! groupList . contains ( configGroupRelation . getGroupId ( ) ) ) {
if ( ! groupList . contains ( configGroupRelation . getGroupId ( ) ) ) {
groupList . add ( configGroupRelation . getGroupId ( ) ) ;
groupList . add ( configGroupRelation . getGroupId ( ) ) ;
} else {
} else {
businessCode = RestBusinessCode . GroupIdIsRepeat . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中groupRelationList存在多个groupId为 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中groupRelationList存在多个groupId为 "
+ configGroupRelation . getGroupId ( ) + " 的配置分组 " ;
+ configGroupRelation . getGroupId ( ) + " 的配置分组 " ;
}
}
}
}
} else {
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudgeCode . GroupListEQZero . getErrorReason ( ) ;
}
}
// else {
// return "编译配置id为" + configCompile.getCompileId() + "的配置中"
// + CompileJudgeCode.GroupListEQZero.getErrorReason();
// }
List < Long > regionGroupIdList = new ArrayList < Long > ( ) ; // 所有域配置中groupId的集合,不重复
List < Long > regionGroupIdList = new ArrayList < Long > ( ) ; // 所有域配置中groupId的集合,不重复
List < NumRegion > numRegionList = configCompile . getNumRegionList ( ) ;
List < NumRegion > numRegionList = configCompile . getNumRegionList ( ) ;
if ( numRegionList = = null ) {
if ( numRegionList = = null ) {
businessCode = RestBusinessCode . NumRegionIsNull . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudge Code. NumRegionIsNull . getErrorReason ( ) ;
+ RestBusiness Code. NumRegionIsNull . getErrorReason ( ) ;
}
}
if ( numRegionList . size ( ) > 0 ) {
if ( numRegionList . size ( ) > 0 ) {
for ( NumRegion numRegion : numRegionList ) {
for ( NumRegion numRegion : numRegionList ) {
@@ -178,19 +165,23 @@ public class CompileVal {
if ( ! StringUtil . isEmpty ( numRegion . getTableName ( ) )
if ( ! StringUtil . isEmpty ( numRegion . getTableName ( ) )
& & ! type2TableNameIsOk ( configCompile . getService ( ) , numRegion . getTableName ( ) ) ) {
& & ! type2TableNameIsOk ( configCompile . getService ( ) , numRegion . getTableName ( ) ) ) {
businessCode = RestBusinessCode . TableNameUnmatchService . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
+ numRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
+ numRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
}
}
if ( ! isUpdate & & numRegion . getIsValid ( ) ! = 1 ) {
if ( ! isUpdate & & numRegion . getIsValid ( ) ! = 1 ) {
businessCode = RestBusinessCode . IsValidIsT . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
+ numRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
+ numRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
}
}
if ( isUpdate & & numRegion . getIsValid ( ) ! = 0 ) {
if ( isUpdate & & numRegion . getIsValid ( ) ! = 0 ) {
businessCode = RestBusinessCode . IsValidIsF . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
+ numRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
+ numRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
}
}
if ( groupList . size ( ) > 0 & & ! groupList . contains ( numRegion . getGroupId ( ) ) ) {
if ( groupList . size ( ) > 0 & & ! groupList . contains ( numRegion . getGroupId ( ) ) ) {
businessCode = RestBusinessCode . RegionsGroupIdIsNotFound . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中numRegionList中的regionid为 "
+ numRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
+ numRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
}
}
@@ -216,8 +207,9 @@ public class CompileVal {
List < StrRegion > strRegionList = configCompile . getStrRegionList ( ) ;
List < StrRegion > strRegionList = configCompile . getStrRegionList ( ) ;
if ( strRegionList = = null ) {
if ( strRegionList = = null ) {
businessCode = RestBusinessCode . StrRegionIsNull . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ CompileJudge Code. StrRegionIsNull . getErrorReason ( ) ;
+ RestBusiness Code. StrRegionIsNull . getErrorReason ( ) ;
}
}
if ( strRegionList ! = null & & strRegionList . size ( ) > 0 ) {
if ( strRegionList ! = null & & strRegionList . size ( ) > 0 ) {
for ( StrRegion strRegion : strRegionList ) {
for ( StrRegion strRegion : strRegionList ) {
@@ -225,19 +217,23 @@ public class CompileVal {
// !regionGroupIdList.contains(strRegion.getGroupId())) {
// !regionGroupIdList.contains(strRegion.getGroupId())) {
if ( ! StringUtil . isEmpty ( strRegion . getTableName ( ) )
if ( ! StringUtil . isEmpty ( strRegion . getTableName ( ) )
& & ! type2TableNameIsOk ( configCompile . getService ( ) , strRegion . getTableName ( ) ) ) {
& & ! type2TableNameIsOk ( configCompile . getService ( ) , strRegion . getTableName ( ) ) ) {
businessCode = RestBusinessCode . TableNameUnmatchService . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
+ strRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
+ strRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
}
}
if ( ! isUpdate & & strRegion . getIsValid ( ) ! = 1 ) {
if ( ! isUpdate & & strRegion . getIsValid ( ) ! = 1 ) {
businessCode = RestBusinessCode . IsValidIsT . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
+ strRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
+ strRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
}
}
if ( isUpdate & & strRegion . getIsValid ( ) ! = 0 ) {
if ( isUpdate & & strRegion . getIsValid ( ) ! = 0 ) {
businessCode = RestBusinessCode . IsValidIsF . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
+ strRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
+ strRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
}
}
if ( groupList . size ( ) > 0 & & ! groupList . contains ( strRegion . getGroupId ( ) ) ) {
if ( groupList . size ( ) > 0 & & ! groupList . contains ( strRegion . getGroupId ( ) ) ) {
businessCode = RestBusinessCode . RegionsGroupIdIsNotFound . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中strRegionList中的regionid为 "
+ strRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
+ strRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
}
}
@@ -266,7 +262,9 @@ public class CompileVal {
List < IpRegion > ipRegionList = configCompile . getIpRegionList ( ) ;
List < IpRegion > ipRegionList = configCompile . getIpRegionList ( ) ;
if ( ipRegionList = = null ) {
if ( ipRegionList = = null ) {
return CompileJudge Code. IpRegionIsNull . getErrorReason ( ) ;
businessCode = RestBusiness Code. IpRegionIsNull . getValue ( ) ;
return " 编译配置id为 " + configCompile . getCompileId ( ) + " 的配置中 "
+ RestBusinessCode . IpRegionIsNull . getErrorReason ( ) ;
}
}
if ( ipRegionList ! = null & & ipRegionList . size ( ) > 0 ) {
if ( ipRegionList ! = null & & ipRegionList . size ( ) > 0 ) {
for ( IpRegion ipRegion : ipRegionList ) {
for ( IpRegion ipRegion : ipRegionList ) {
@@ -274,20 +272,24 @@ public class CompileVal {
// !regionGroupIdList.contains(ipRegion.getGroupId())) {
// !regionGroupIdList.contains(ipRegion.getGroupId())) {
if ( ! StringUtil . isEmpty ( ipRegion . getTableName ( ) )
if ( ! StringUtil . isEmpty ( ipRegion . getTableName ( ) )
& & ! type2TableNameIsOk ( configCompile . getService ( ) , ipRegion . getTableName ( ) ) ) {
& & ! type2TableNameIsOk ( configCompile . getService ( ) , ipRegion . getTableName ( ) ) ) {
businessCode = RestBusinessCode . TableNameUnmatchService . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
+ ipRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
}
}
if ( ! isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 1 ) ) {
if ( ! isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 1 ) ) {
businessCode = RestBusinessCode . IsValidIsT . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
+ ipRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
}
}
if ( isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 0 ) ) {
if ( isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 0 ) ) {
businessCode = RestBusinessCode . IsValidIsF . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
+ ipRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
}
}
if ( groupList . size ( ) > 0 & & ! groupList . contains ( ipRegion . getGroupId ( ) ) ) {
if ( groupList . size ( ) > 0 & & ! groupList . contains ( ipRegion . getGroupId ( ) ) ) {
businessCode = RestBusinessCode . RegionsGroupIdIsNotFound . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipRegionList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
+ ipRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
}
}
@@ -321,15 +323,18 @@ public class CompileVal {
// 不验证表名和业务类型是否对应
// 不验证表名和业务类型是否对应
if ( ! isUpdate & & digestRegion . getIsValid ( ) ! = 1 ) {
if ( ! isUpdate & & digestRegion . getIsValid ( ) ! = 1 ) {
businessCode = RestBusinessCode . IsValidIsT . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中digestRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中digestRegionList中的regionid为 "
+ digestRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
+ digestRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
}
}
if ( isUpdate & & digestRegion . getIsValid ( ) ! = 0 ) {
if ( isUpdate & & digestRegion . getIsValid ( ) ! = 0 ) {
businessCode = RestBusinessCode . IsValidIsF . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中digestRegionList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中digestRegionList中的regionid为 "
+ digestRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
+ digestRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
}
}
if ( groupList . size ( ) > 0 & & ! groupList . contains ( digestRegion . getGroupId ( ) ) ) {
if ( groupList . size ( ) > 0 & & ! groupList . contains ( digestRegion . getGroupId ( ) ) ) {
businessCode = RestBusinessCode . RegionsGroupIdIsNotFound . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中digestRegion中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中digestRegion中的regionid为 "
+ digestRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
+ digestRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
}
}
@@ -361,20 +366,24 @@ public class CompileVal {
// !regionGroupIdList.contains(ipRegion.getGroupId())) {
// !regionGroupIdList.contains(ipRegion.getGroupId())) {
if ( ! StringUtil . isEmpty ( ipRegion . getTableName ( ) )
if ( ! StringUtil . isEmpty ( ipRegion . getTableName ( ) )
& & ! type2TableNameIsOk ( configCompile . getService ( ) , ipRegion . getTableName ( ) ) ) {
& & ! type2TableNameIsOk ( configCompile . getService ( ) , ipRegion . getTableName ( ) ) ) {
businessCode = RestBusinessCode . TableNameUnmatchService . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
+ ipRegion . getRegionId ( ) + " 的域配置tableName与编译配置业务类型不一致 " ;
}
}
if ( ! isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 1 ) ) {
if ( ! isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 1 ) ) {
businessCode = RestBusinessCode . IsValidIsT . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
+ ipRegion . getRegionId ( ) + " 的域配置在添加时不能为无效 " ;
}
}
if ( isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 0 ) ) {
if ( isUpdate & & ( null = = ipRegion . getIsValid ( ) | | ipRegion . getIsValid ( ) ! = 0 ) ) {
businessCode = RestBusinessCode . IsValidIsF . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
+ ipRegion . getRegionId ( ) + " 的域配置在修改时不能为有效 " ;
}
}
if ( groupList . size ( ) > 0 & & ! groupList . contains ( ipRegion . getGroupId ( ) ) ) {
if ( groupList . size ( ) > 0 & & ! groupList . contains ( ipRegion . getGroupId ( ) ) ) {
businessCode = RestBusinessCode . RegionsGroupIdIsNotFound . getValue ( ) ;
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
return " 配置id为 " + configCompile . getCompileId ( ) + " 的配置中ipClientRangeList中的regionid为 "
+ ipRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
+ ipRegion . getRegionId ( ) + " 的配置的groupid在配置分组关系中不存在 " ;
}
}
@@ -397,7 +406,7 @@ public class CompileVal {
}
}
}
}
}
}
return CompileJudgeCode . CompileGroupSizeGtZero . getErrorReason ( ) ;
return " ok " ;
}
}
/**
/**
@@ -449,12 +458,12 @@ public class CompileVal {
public static String compileIsOk ( ConfigCompile configCompile , boolean isUpdate , StringBuffer sb ) {
public static String compileIsOk ( ConfigCompile configCompile , boolean isUpdate , StringBuffer sb ) {
String msg1 = groupNumAndListIsOk ( configCompile , isUpdate ) ;
String msg1 = groupNumAndListIsOk ( configCompile , isUpdate ) ;
if ( msg1 ! = CompileJudgeCode . GroupNumAndListLtEight . getErrorReason ( ) ) {
if ( ! " ok " . equals ( msg1 ) ) {
return msg1 ;
return msg1 ;
}
}
String msg2 = compileGroupSizeIsGtZero ( configCompile , isUpdate , sb ) ;
String msg2 = compileGroupSizeIsGtZero ( configCompile , isUpdate , sb ) ;
if ( msg2 ! = CompileJudgeCode . CompileGroupSizeGtZero . getErrorReason ( ) ) {
if ( ! " ok " . equals ( msg2 ) ) {
return msg2 ;
return msg2 ;
}
}
String latentMsg = " ,数据中可能存在的问题: " ;
String latentMsg = " ,数据中可能存在的问题: " ;
@@ -463,7 +472,7 @@ public class CompileVal {
sb . setLength ( 0 ) ;
sb . setLength ( 0 ) ;
sb . append ( latentMsg ) ;
sb . append ( latentMsg ) ;
}
}
return CompileJudgeCode . CompileIsOk . getErrorReason ( ) ;
return " ok " ;
}
}
public static void setSbStr ( String str , StringBuffer sb ) {
public static void setSbStr ( String str , StringBuffer sb ) {
@@ -475,44 +484,56 @@ public class CompileVal {
public static String valCompile ( ConfigCompile configCompile ) {
public static String valCompile ( ConfigCompile configCompile ) {
Long compileId = configCompile . getCompileId ( ) ;
Long compileId = configCompile . getCompileId ( ) ;
if ( null = = compileId ) {
if ( null = = compileId ) {
return " compileId字段不能为空 " ;
businessCode = RestBusinessCode . CompileIdIsNull . getValue ( ) ;
return RestBusinessCode . CompileIdIsNull . getErrorReason ( ) ;
}
}
if ( null = = configCompile . getService ( ) ) {
if ( null = = configCompile . getService ( ) ) {
return " id为 " + compileId + " 的编译配置中service不能为空 " ;
businessCode = RestBusinessCode . ServiceIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中service不能为空 " ;
}
}
if ( null = = configCompile . getAction ( ) ) {
if ( null = = configCompile . getAction ( ) ) {
return " id为 " + compileId + " 的编译配置中action不能为空 " ;
businessCode = RestBusinessCode . ActionIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中action不能为空 " ;
}
}
if ( null = = configCompile . getDoBlacklist ( ) ) {
if ( null = = configCompile . getDoBlacklist ( ) ) {
return " id为 " + compileId + " 的编译配置中doBlacklist不能为空 " ;
businessCode = RestBusinessCode . DoBlacklistIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中doBlacklist不能为空 " ;
}
}
if ( null = = configCompile . getDoLog ( ) ) {
if ( null = = configCompile . getDoLog ( ) ) {
return " id为 " + compileId + " 的编译配置中doLog不能为空 " ;
businessCode = RestBusinessCode . DoLogIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中doLog不能为空 " ;
}
}
if ( null = = configCompile . getEffectiveRange ( ) | | configCompile . getEffectiveRange ( ) . equals ( " " ) ) {
if ( null = = configCompile . getEffectiveRange ( ) | | configCompile . getEffectiveRange ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中effectiveRange不能为空 " ;
businessCode = RestBusinessCode . EffectiveRangeIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中effectiveRange不能为空 " ;
}
}
if ( null = = configCompile . getStartTime ( ) ) {
if ( null = = configCompile . getStartTime ( ) ) {
return " id为 " + compileId + " 的编译配置中startTime不能为空 " ;
businessCode = RestBusinessCode . StartTimeIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中startTime不能为空 " ;
}
}
if ( null = = configCompile . getEndTime ( ) ) {
if ( null = = configCompile . getEndTime ( ) ) {
return " id为 " + compileId + " 的编译配置中endTime不能为空 " ;
businessCode = RestBusinessCode . EndTimeIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中endTime不能为空 " ;
}
}
// if (null == configCompile.getUserRegion() || configCompile.getUserRegion().equals("")) {
// if (null == configCompile.getUserRegion() || configCompile.getUserRegion().equals("")) {
// return "id为" + compileId + "的编译配置中userRegion不能为空";
// return "编译配置 id为" + compileId + "的编译配置中userRegion不能为空";
// }
// }
if ( null = = configCompile . getIsValid ( ) ) {
if ( null = = configCompile . getIsValid ( ) ) {
return " id为 " + compileId + " 的编译配置中isValid不能为空 " ;
businessCode = RestBusinessCode . IsValidIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中isValid不能为空 " ;
}
}
if ( null = = configCompile . getGroupNum ( ) ) {
if ( null = = configCompile . getGroupNum ( ) ) {
return " id为 " + compileId + " 的编译配置中groupNum不能为空 " ;
businessCode = RestBusinessCode . GroupNumIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中groupNum不能为空 " ;
}
}
if ( null = = configCompile . getFatherCfgId ( ) ) {
if ( null = = configCompile . getFatherCfgId ( ) ) {
return " id为 " + compileId + " 的编译配置中fatherCfgId不能为空 " ;
businessCode = RestBusinessCode . FatherCfgIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中fatherCfgId不能为空 " ;
}
}
if ( null = = configCompile . getOpTime ( ) ) {
if ( null = = configCompile . getOpTime ( ) ) {
return " id为 " + compileId + " 的编译配置中opTime不能为空 " ;
businessCode = RestBusinessCode . OpTimeIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中opTime不能为空 " ;
}
}
return " ok " ;
return " ok " ;
}
}
@@ -520,67 +541,84 @@ public class CompileVal {
public static String valCompileGroup ( ConfigGroupRelation configGroupRelation , Long compileId ) {
public static String valCompileGroup ( ConfigGroupRelation configGroupRelation , Long compileId ) {
Long groupId = configGroupRelation . getGroupId ( ) ;
Long groupId = configGroupRelation . getGroupId ( ) ;
if ( null = = groupId ) {
if ( null = = groupId ) {
return " id为 " + compileId + " 的编译配置中的配置分组的groupId不能为空 " ;
businessCode = RestBusinessCode . GroupIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的配置分组的groupId不能为空 " ;
}
}
if ( null = = configGroupRelation . getCompileId ( ) ) {
if ( null = = configGroupRelation . getCompileId ( ) ) {
return " id为 " + compileId + " 的编译配置中的配置分组id为 " + groupId + " 的配置compileId不能为空 " ;
businessCode = RestBusinessCode . GroupsCompileIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的配置分组id为 " + groupId + " 的配置compileId不能为空 " ;
}
}
if ( null = = configGroupRelation . getIsValid ( ) ) {
if ( null = = configGroupRelation . getIsValid ( ) ) {
return " id为 " + compileId + " 的编译配置中的配置分组id为 " + groupId + " 的配置isValid不能为空 " ;
businessCode = RestBusinessCode . GroupsIsValidIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的配置分组id为 " + groupId + " 的配置isValid不能为空 " ;
}
}
if ( null = = configGroupRelation . getOpTime ( ) ) {
if ( null = = configGroupRelation . getOpTime ( ) ) {
return " id为 " + compileId + " 的编译配置中的配置分组id为 " + groupId + " 的配置opTime不能为空 " ;
businessCode = RestBusinessCode . OpTimeIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的配置分组id为 " + groupId + " 的配置opTime不能为空 " ;
}
}
return " ok " ;
return " ok " ;
}
}
public static String valIpRegion ( IpRegion ipRegion , Long compileId ) {
public static String valIpRegion ( IpRegion ipRegion , Long compileId ) {
Long regionId = ipRegion . getRegionId ( ) ;
Long regionId = ipRegion . getRegionId ( ) ;
if ( null = = regionId ) {
if ( null = = regionId ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置的regionId不能为空 " ;
businessCode = RestBusinessCode . RegionIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置的regionId不能为空 " ;
}
}
if ( null = = ipRegion . getGroupId ( ) ) {
if ( null = = ipRegion . getGroupId ( ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
businessCode = RestBusinessCode . RegionsGroupIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
}
}
if ( null = = ipRegion . getAddrType ( ) ) {
if ( null = = ipRegion . getAddrType ( ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置addrType不能为空 " ;
businessCode = RestBusinessCode . AddrTypeIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置addrType不能为空 " ;
}
}
if ( null = = ipRegion . getSrcIp ( ) | | ipRegion . getSrcIp ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getSrcIp ( ) | | ipRegion . getSrcIp ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置srcIp不能为空 " ;
businessCode = RestBusinessCode . SrcIpIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置srcIp不能为空 " ;
}
}
if ( null = = ipRegion . getMaskSrcIp ( ) | | ipRegion . getMaskSrcIp ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getMaskSrcIp ( ) | | ipRegion . getMaskSrcIp ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskSrcIp不能为空 " ;
businessCode = RestBusinessCode . MaskSrcIpIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskSrcIp不能为空 " ;
}
}
if ( null = = ipRegion . getSrcPort ( ) | | ipRegion . getSrcPort ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getSrcPort ( ) | | ipRegion . getSrcPort ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置srcPort不能为空 " ;
businessCode = RestBusinessCode . SrcPortIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置srcPort不能为空 " ;
}
}
if ( null = = ipRegion . getMaskSrcPort ( ) | | ipRegion . getMaskSrcPort ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getMaskSrcPort ( ) | | ipRegion . getMaskSrcPort ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskSrcPort不能为空 " ;
businessCode = RestBusinessCode . MaskSrcPortIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskSrcPort不能为空 " ;
}
}
if ( null = = ipRegion . getDstIp ( ) | | ipRegion . getDstIp ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getDstIp ( ) | | ipRegion . getDstIp ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置dstIp不能为空 " ;
businessCode = RestBusinessCode . DstIpIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置dstIp不能为空 " ;
}
}
if ( null = = ipRegion . getMaskDstIp ( ) | | ipRegion . getMaskDstIp ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getMaskDstIp ( ) | | ipRegion . getMaskDstIp ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskDstIp不能为空 " ;
businessCode = RestBusinessCode . MaskDstIpIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskDstIp不能为空 " ;
}
}
if ( null = = ipRegion . getDstPort ( ) | | ipRegion . getDstPort ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getDstPort ( ) | | ipRegion . getDstPort ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置dstPort不能为空 " ;
businessCode = RestBusinessCode . DstPortIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置dstPort不能为空 " ;
}
}
if ( null = = ipRegion . getMaskDstPort ( ) | | ipRegion . getMaskDstPort ( ) . equals ( " " ) ) {
if ( null = = ipRegion . getMaskDstPort ( ) | | ipRegion . getMaskDstPort ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskDstPort不能为空 " ;
businessCode = RestBusinessCode . MaskDstPortIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置maskDstPort不能为空 " ;
}
}
if ( null = = ipRegion . getProtocol ( ) ) {
if ( null = = ipRegion . getProtocol ( ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置protocol不能为空 " ;
businessCode = RestBusinessCode . ProtocolIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置protocol不能为空 " ;
}
}
if ( null = = ipRegion . getDirection ( ) ) {
if ( null = = ipRegion . getDirection ( ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置direction不能为空 " ;
businessCode = RestBusinessCode . DirectionIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置direction不能为空 " ;
}
}
if ( null = = ipRegion . getIsValid ( ) ) {
if ( null = = ipRegion . getIsValid ( ) ) {
return " id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置isValid不能为空 " ;
businessCode = RestBusinessCode . IsValidIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的ip类域配置id为 " + regionId + " 的配置isValid不能为空 " ;
}
}
return " ok " ;
return " ok " ;
}
}
@@ -588,16 +626,20 @@ public class CompileVal {
public static String valNumRegion ( NumRegion numRegion , Long compileId ) {
public static String valNumRegion ( NumRegion numRegion , Long compileId ) {
Long regionId = numRegion . getRegionId ( ) ;
Long regionId = numRegion . getRegionId ( ) ;
if ( null = = regionId ) {
if ( null = = regionId ) {
return " id为 " + compileId + " 的编译配置中的数值类域配置的regionId不能为空 " ;
businessCode = RestBusinessCode . RegionIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的数值类域配置的regionId不能为空 " ;
}
}
if ( null = = numRegion . getGroupId ( ) ) {
if ( null = = numRegion . getGroupId ( ) ) {
return " id为 " + compileId + " 的编译配置中的数值类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
businessCode = RestBusinessCode . RegionsGroupIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的数值类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
}
}
if ( null = = numRegion . getLowBoundary ( ) ) {
if ( null = = numRegion . getLowBoundary ( ) ) {
return " id为 " + compileId + " 的编译配置中的数值类域配置id为 " + regionId + " 的配置lowBoundary不能为空 " ;
businessCode = RestBusinessCode . LowBoundaryIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的数值类域配置id为 " + regionId + " 的配置lowBoundary不能为空 " ;
}
}
if ( null = = numRegion . getUpBoundary ( ) ) {
if ( null = = numRegion . getUpBoundary ( ) ) {
return " id为 " + compileId + " 的编译配置中的数值类域配置id为 " + regionId + " 的配置upBoundary不能为空 " ;
businessCode = RestBusinessCode . UpBoundaryIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的数值类域配置id为 " + regionId + " 的配置upBoundary不能为空 " ;
}
}
return " ok " ;
return " ok " ;
}
}
@@ -605,28 +647,35 @@ public class CompileVal {
public static String valStrRegion ( StrRegion strRegion , Long compileId , boolean isDirtrict ) {
public static String valStrRegion ( StrRegion strRegion , Long compileId , boolean isDirtrict ) {
Long regionId = strRegion . getRegionId ( ) ;
Long regionId = strRegion . getRegionId ( ) ;
if ( null = = regionId ) {
if ( null = = regionId ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置的regionId不能为空 " ;
businessCode = RestBusinessCode . RegionIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置的regionId不能为空 " ;
}
}
if ( null = = strRegion . getGroupId ( ) ) {
if ( null = = strRegion . getGroupId ( ) ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
businessCode = RestBusinessCode . RegionsGroupIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
}
}
if ( isDirtrict & & ( null = = strRegion . getDistrict ( ) | | strRegion . getDistrict ( ) . equals ( " " ) ) ) {
if ( isDirtrict & & ( null = = strRegion . getDistrict ( ) | | strRegion . getDistrict ( ) . equals ( " " ) ) ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置district不能为空 " ;
businessCode = RestBusinessCode . DistrictIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置district不能为空 " ;
}
}
if ( null = = strRegion . getKeywords ( ) | | strRegion . getKeywords ( ) . equals ( " " ) ) {
if ( null = = strRegion . getKeywords ( ) | | strRegion . getKeywords ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置keywords不能为空 " ;
businessCode = RestBusinessCode . KeywordsIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置keywords不能为空 " ;
}
}
if ( null = = strRegion . getExprType ( ) ) {
if ( null = = strRegion . getExprType ( ) ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置exprType不能为空 " ;
businessCode = RestBusinessCode . ExprTypeIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置exprType不能为空 " ;
}
}
if ( null = = strRegion . getMatchMethod ( ) ) {
if ( null = = strRegion . getMatchMethod ( ) ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置matchMethod不能为空 " ;
businessCode = RestBusinessCode . MatchMethodIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置matchMethod不能为空 " ;
}
}
if ( null = = strRegion . getIsHexbin ( ) ) {
if ( null = = strRegion . getIsHexbin ( ) ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置isHexbin不能为空 " ;
businessCode = RestBusinessCode . MatchMethodIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置isHexbin不能为空 " ;
}
}
return " ok " ;
return " ok " ;
}
}
@@ -634,65 +683,80 @@ public class CompileVal {
public static String valDigestRegion ( DigestRegion digestRegion , Long compileId ) {
public static String valDigestRegion ( DigestRegion digestRegion , Long compileId ) {
Long regionId = digestRegion . getRegionId ( ) ;
Long regionId = digestRegion . getRegionId ( ) ;
if ( null = = regionId ) {
if ( null = = regionId ) {
return " id为 " + compileId + " 的编译配置中的摘要类域配置的regionId不能为空 " ;
businessCode = RestBusinessCode . RegionIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的摘要类域配置的regionId不能为空 " ;
}
}
if ( null = = digestRegion . getGroupId ( ) ) {
if ( null = = digestRegion . getGroupId ( ) ) {
return " id为 " + compileId + " 的编译配置中的摘要类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
businessCode = RestBusinessCode . RegionsGroupIdIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的摘要类域配置id为 " + regionId + " 的配置groupId不能为空 " ;
}
}
if ( null = = digestRegion . getRawLen ( ) ) {
if ( null = = digestRegion . getRawLen ( ) ) {
return " id为 " + compileId + " 的编译配置中的摘要类域配置id为 " + regionId + " 的配置rawLen不能为空 " ;
businessCode = RestBusinessCode . RawLenIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的摘要类域配置id为 " + regionId + " 的配置rawLen不能为空 " ;
}
}
if ( null = = digestRegion . getDigest ( ) | | digestRegion . getDigest ( ) . equals ( " " ) ) {
if ( null = = digestRegion . getDigest ( ) | | digestRegion . getDigest ( ) . equals ( " " ) ) {
return " id为 " + compileId + " 的编译配置中的摘要类域配置id为 " + regionId + " 的配置digest不能为空 " ;
businessCode = RestBusinessCode . DigestIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的摘要类域配置id为 " + regionId + " 的配置digest不能为空 " ;
}
}
if ( null = = digestRegion . getCfdsLevel ( ) ) {
if ( null = = digestRegion . getCfdsLevel ( ) ) {
return " id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置cfdsLevel不能为空 " ;
businessCode = RestBusinessCode . CfdsLevelIsNull . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的编译配置中的字符串类域配置id为 " + regionId + " 的配置cfdsLevel不能为空 " ;
}
}
return " ok " ;
return " ok " ;
}
}
public static String serviceIpClientRegionVal ( IpRegion ipRegion , Long compileId ) {
public static String serviceIpClientRegionVal ( IpRegion ipRegion , Long compileId ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置srcIp的格式不正确或与addrType不一致 " ;
+ " 的域配置srcIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskSrcIp的格式不正确或与addrType不一致 " ;
+ " 的域配置maskSrcIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置dstIp的格式不正确或与addrType不一致 " ;
+ " 的域配置dstIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskDstIp的格式不正确或与addrType不一致 " ;
+ " 的域配置maskDstIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getSrcPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getSrcPort ( ) ) ) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置srcPort的格式不正确 " ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置srcPort的格式不正确 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskSrcPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskSrcPort ( ) ) ) {
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskSrcPort())) {
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskSrcPort())) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskSrcPort的格式不正确 " ;
+ " 的域配置maskSrcPort的格式不正确 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getDstPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getDstPort ( ) ) ) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置dstPort的格式不正确 " ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置dstPort的格式不正确 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskDstPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskDstPort ( ) ) ) {
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskDstPort())) {
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskDstPort())) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskDstPort的格式不正确 " ;
+ " 的域配置maskDstPort的格式不正确 " ;
}
}
if ( ipRegion . getSrcIp ( ) . equals ( ipRegion . getDstIp ( ) ) ) {
if ( ipRegion . getSrcIp ( ) . equals ( ipRegion . getDstIp ( ) ) ) {
businessCode = RestBusinessCode . SrcIpEQDstIp . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置srcIp和dstIp不能相同 " ;
+ " 的域配置srcIp和dstIp不能相同 " ;
}
}
if ( ipRegion . getDirection ( ) ! = 1 & & ipRegion . getDirection ( ) ! = 0 ) {
if ( ipRegion . getDirection ( ) ! = 1 & & ipRegion . getDirection ( ) ! = 0 ) {
businessCode = RestBusinessCode . DirectionIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipClientRangeList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置direction的值不正确,只能是0或1 " ;
+ " 的域配置direction的值不正确,只能是0或1 " ;
}
}
@@ -717,46 +781,56 @@ public class CompileVal {
public static String serviceIpRegionVal ( IpRegion ipRegion , Long compileId ) {
public static String serviceIpRegionVal ( IpRegion ipRegion , Long compileId ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置srcIp的格式不正确或与addrType不一致 " ;
+ " 的域配置srcIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskSrcIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskSrcIp的格式不正确或与addrType不一致 " ;
+ " 的域配置maskSrcIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置dstIp的格式不正确或与addrType不一致 " ;
+ " 的域配置dstIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
if ( ! BasicProvingUtil . isIpOrIpMask ( ipRegion . getMaskDstIp ( ) , ipRegion . getAddrType ( ) ) ) {
businessCode = RestBusinessCode . IPUnMatchAddrType . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskDstIp的格式不正确或与addrType不一致 " ;
+ " 的域配置maskDstIp的格式不正确或与addrType不一致 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getSrcPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getSrcPort ( ) ) ) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置srcPort的格式不正确 " ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置srcPort的格式不正确 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskSrcPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskSrcPort ( ) ) ) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskSrcPort())) {
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskSrcPort())) {
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskSrcPort的格式不正确 " ;
+ " 的域配置maskSrcPort的格式不正确 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getDstPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getDstPort ( ) ) ) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置dstPort的格式不正确 " ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( ) + " 的域配置dstPort的格式不正确 " ;
}
}
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskDstPort ( ) ) ) {
if ( ! BasicProvingUtil . isPortOrPortMask ( ipRegion . getMaskDstPort ( ) ) ) {
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskDstPort())) {
// if (!BasicProvingUtil.isIntType(ipRegion.getMaskDstPort())) {
businessCode = RestBusinessCode . PortIsNotVal . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置maskDstPort的格式不正确 " ;
+ " 的域配置maskDstPort的格式不正确 " ;
}
}
if ( ipRegion . getSrcIp ( ) . equals ( ipRegion . getDstIp ( ) ) ) {
if ( ipRegion . getSrcIp ( ) . equals ( ipRegion . getDstIp ( ) ) ) {
businessCode = RestBusinessCode . SrcIpEQDstIp . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置srcIp和dstIp不能相同 " ;
+ " 的域配置srcIp和dstIp不能相同 " ;
}
}
if ( ipRegion . getDirection ( ) ! = 1 & & ipRegion . getDirection ( ) ! = 0 ) {
if ( ipRegion . getDirection ( ) ! = 1 & & ipRegion . getDirection ( ) ! = 0 ) {
businessCode = RestBusinessCode . DirectionIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中ipRegionList中regionId为 " + ipRegion . getRegionId ( )
+ " 的域配置direction的值不正确,只能是0或1 " ;
+ " 的域配置direction的值不正确,只能是0或1 " ;
}
}
@@ -784,14 +858,17 @@ public class CompileVal {
Long upBoundary = numRegion . getUpBoundary ( ) ;
Long upBoundary = numRegion . getUpBoundary ( ) ;
if ( lowBoundary < = upBoundary ) {
if ( lowBoundary < = upBoundary ) {
if ( lowBoundary > 4294967295l | | lowBoundary < 0l ) {
if ( lowBoundary > 4294967295l | | lowBoundary < 0l ) {
businessCode = RestBusinessCode . LowBoundaryIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中numRegionList中regionId为 " + numRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中numRegionList中regionId为 " + numRegion . getRegionId ( )
+ " 的域配置lowBoundary的值不能大于2的32次方减一(4294967295)或者小于0 " ;
+ " 的域配置lowBoundary的值不能大于2的32次方减一(4294967295)或者小于0 " ;
}
}
if ( upBoundary > 4294967295l | | upBoundary < 0l ) {
if ( upBoundary > 4294967295l | | upBoundary < 0l ) {
businessCode = RestBusinessCode . UpBoundaryIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中numRegionList中regionId为 " + numRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中numRegionList中regionId为 " + numRegion . getRegionId ( )
+ " 的域配置upBoundary的值不能大于2的32次方减一(4294967295)或者小于0 " ;
+ " 的域配置upBoundary的值不能大于2的32次方减一(4294967295)或者小于0 " ;
}
}
} else {
} else {
businessCode = RestBusinessCode . LowBoundaryGTUpBoundary . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中numRegionList中regionId为 " + numRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中numRegionList中regionId为 " + numRegion . getRegionId ( )
+ " 的域配置lowBoundary的值大于upBoundary,应该是小于或等于 " ;
+ " 的域配置lowBoundary的值大于upBoundary,应该是小于或等于 " ;
}
}
@@ -802,23 +879,26 @@ public class CompileVal {
public static String serviceConfigCompileVal ( ConfigCompile configCompile ) {
public static String serviceConfigCompileVal ( ConfigCompile configCompile ) {
Long compileId = configCompile . getCompileId ( ) ;
Long compileId = configCompile . getCompileId ( ) ;
Integer action = ServiceAndRDBIndexReal . getActionByService ( configCompile . getService ( ) ) ;
Integer action = ServiceAndRDBIndexReal . getActionByService ( configCompile . getService ( ) ) ;
if ( StringUtil . isEmpty ( action ) ) {
if ( action . compareTo ( configCompile . getAction ( ) ) ! = 0 ) {
return " 编译配置id为 " + compileId + " 的配置中service的值为 " + configCompile . getServic e ( ) + " 时action不存在 " ;
businessCode = RestBusinessCode . ServiceUnmatchAction . getValu e ( ) ;
} else if ( action . compareTo ( configCompile . getAction ( ) ) ! = 0 ) {
return " 编译配置id为 " + compileId + " 的配置中service的值为 " + configCompile . getService ( ) + " 时action只能为 " + action ;
return " 编译配置id为 " + compileId + " 的配置中service的值为 " + configCompile . getService ( ) + " 时action只能为 " + action ;
}
}
if ( configCompile . getDoBlacklist ( ) ! = 1 ) {
if ( configCompile . getDoBlacklist ( ) ! = 1 ) {
businessCode = RestBusinessCode . DoBlacklistIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中doBlacklist的值只能是1 " ;
return " 编译配置id为 " + compileId + " 的配置中doBlacklist的值只能是1 " ;
}
}
if ( configCompile . getDoLog ( ) ! = 0 & & configCompile . getDoLog ( ) ! = 1 & & configCompile . getDoLog ( ) ! = 2 ) {
if ( configCompile . getDoLog ( ) ! = 0 & & configCompile . getDoLog ( ) ! = 1 & & configCompile . getDoLog ( ) ! = 2 ) {
businessCode = RestBusinessCode . DoLogIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中doLog的值只能是0(不需要),1(需要),2(只记录结构化日志,不记录非结构化日志) " ;
return " 编译配置id为 " + compileId + " 的配置中doLog的值只能是0(不需要),1(需要),2(只记录结构化日志,不记录非结构化日志) " ;
}
}
if ( configCompile . getFatherCfgId ( ) ! = 0 ) {
if ( configCompile . getFatherCfgId ( ) ! = 0 ) {
businessCode = RestBusinessCode . FatherCfgIdIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中fatherCfgId的值只能是0 " ;
return " 编译配置id为 " + compileId + " 的配置中fatherCfgId的值只能是0 " ;
}
}
if ( configCompile . getStartTime ( ) . getTime ( ) > configCompile . getEndTime ( ) . getTime ( ) ) {
if ( configCompile . getStartTime ( ) . getTime ( ) > configCompile . getEndTime ( ) . getTime ( ) ) {
businessCode = RestBusinessCode . EndTimeGTStartTime . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中startTime不能比endTime晚 " ;
return " 编译配置id为 " + compileId + " 的配置中startTime不能比endTime晚 " ;
}
}
return " ok " ;
return " ok " ;
@@ -830,15 +910,18 @@ public class CompileVal {
Integer matchMethod = strRegion . getMatchMethod ( ) ;
Integer matchMethod = strRegion . getMatchMethod ( ) ;
Integer isHexbin = strRegion . getIsHexbin ( ) ;
Integer isHexbin = strRegion . getIsHexbin ( ) ;
if ( exprType ! = 0 & & exprType ! = 1 ) {
if ( exprType ! = 0 & & exprType ! = 1 ) {
businessCode = RestBusinessCode . ExprTypeIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中strRegionList中regionId为 " + strRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中strRegionList中regionId为 " + strRegion . getRegionId ( )
+ " 的域配置exprType的值只能是0(无表达式)或者1(与表达式) " ;
+ " 的域配置exprType的值只能是0(无表达式)或者1(与表达式) " ;
}
}
if ( matchMethod ! = 0 & & matchMethod ! = 1 & & matchMethod ! = 2 & & matchMethod ! = 3 ) {
if ( matchMethod ! = 0 & & matchMethod ! = 1 & & matchMethod ! = 2 & & matchMethod ! = 3 ) {
businessCode = RestBusinessCode . MatchMethodIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中strRegionList中regionId为 " + strRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中strRegionList中regionId为 " + strRegion . getRegionId ( )
+ " 的域配置matchMethod的值只能是0(子串匹配),1(右匹配),2(左匹配),3(完全匹配) " ;
+ " 的域配置matchMethod的值只能是0(子串匹配),1(右匹配),2(左匹配),3(完全匹配) " ;
}
}
if ( isHexbin ! = 0 & & isHexbin ! = 1 & & isHexbin ! = 2 ) {
if ( isHexbin ! = 0 & & isHexbin ! = 1 & & isHexbin ! = 2 ) {
businessCode = RestBusinessCode . IsHexbinIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中strRegionList中regionId为 " + strRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中strRegionList中regionId为 " + strRegion . getRegionId ( )
+ " 的域配置isHexbin的值只能是0(大小写不敏感, 且非HEX)或者1(HEX)或者2(大小写敏感, 且非HEX) " ;
+ " 的域配置isHexbin的值只能是0(大小写不敏感, 且非HEX)或者1(HEX)或者2(大小写敏感, 且非HEX) " ;
}
}
@@ -851,6 +934,7 @@ public class CompileVal {
Integer cfdsLevel = digestRegion . getCfdsLevel ( ) ;
Integer cfdsLevel = digestRegion . getCfdsLevel ( ) ;
if ( ! ( cfdsLevel > = 1 & & cfdsLevel < = 10 ) ) {
if ( ! ( cfdsLevel > = 1 & & cfdsLevel < = 10 ) ) {
businessCode = RestBusinessCode . CfdsLevelIsWrongRange . getValue ( ) ;
return " 编译配置id为 " + compileId + " 的配置中digestRegionList中regionId为 " + digestRegion . getRegionId ( )
return " 编译配置id为 " + compileId + " 的配置中digestRegionList中regionId为 " + digestRegion . getRegionId ( )
+ " 的域配置cfdsLevel的值只能是1到10 " ;
+ " 的域配置cfdsLevel的值只能是1到10 " ;
}
}