1、IP类域配置的addrType的取值验证;
2、分组复用添加、删除域配置测试并修改bug
This commit is contained in:
@@ -766,7 +766,12 @@ public class CompileVal {
|
||||
}
|
||||
|
||||
public static void serviceIpRegionVal(IpRegion ipRegion, Long compileId, String listName) throws Exception {
|
||||
|
||||
int addrType = ipRegion.getAddrType().intValue();
|
||||
if (!(addrType == 4|| addrType == 6 || addrType == 46|| addrType == 64 || addrType ==10)) {
|
||||
throw new RestServiceException("编译配置id为" + compileId + "的配置中" + listName + "中regionId为" + ipRegion.getRegionId()
|
||||
+ "的域配置addrType的值只能为4(IPV4)、6(IPV6)、46(4OVER6隧道)、64(6OVER4隧道)、10(全部)",
|
||||
RestBusinessCode.AddrTypeIsWrongRange.getValue());
|
||||
}
|
||||
validateIpAndMask(ipRegion, compileId, listName);
|
||||
|
||||
if (!BasicProvingUtil.isPortOrPortMask(ipRegion.getSrcPort())) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class GroupReuseVal {
|
||||
List<NumRegion> numRegionList = groupReuse.getNumRegionList();
|
||||
for (NumRegion numRegion : numRegionList) {
|
||||
if (!StringUtil.isEmpty(numRegion.getTableName())
|
||||
&& groupReuseRegionMap.get("numRegion").contains(numRegion.getTableName())) {
|
||||
&& !groupReuseRegionMap.get("numRegion").contains(numRegion.getTableName())) {
|
||||
throw new RestServiceException("numRegionList中的regionId为"
|
||||
+ numRegion.getRegionId()
|
||||
+ "的域配置tableName不是分组复用的域表",
|
||||
@@ -64,7 +64,7 @@ public class GroupReuseVal {
|
||||
// {
|
||||
|
||||
if (!StringUtil.isEmpty(strRegion.getTableName())
|
||||
&& groupReuseRegionMap.get("strRegion").contains(strRegion.getTableName())) {
|
||||
&& !groupReuseRegionMap.get("strRegion").contains(strRegion.getTableName())) {
|
||||
throw new RestServiceException("strRegionList中的regionId为"
|
||||
+ strRegion.getRegionId()
|
||||
+ "的域配置tableName不是分组复用的域表",
|
||||
@@ -99,7 +99,7 @@ public class GroupReuseVal {
|
||||
// !regionGroupIdList.contains(ipRegion.getGroupId())) {
|
||||
|
||||
if (!StringUtil.isEmpty(ipRegion.getTableName())
|
||||
&& groupReuseRegionMap.get("ipRegion").contains(ipRegion.getTableName())) {
|
||||
&& !groupReuseRegionMap.get("ipRegion").contains(ipRegion.getTableName())) {
|
||||
throw new RestServiceException("ipRegionList中的regionId为"
|
||||
+ ipRegion.getRegionId()
|
||||
+ "的域配置tableName不是分组复用的域表",
|
||||
@@ -355,6 +355,13 @@ public class GroupReuseVal {
|
||||
|
||||
public static void serviceIpRegionVal(IpRegion ipRegion) throws Exception {
|
||||
|
||||
int addrType = ipRegion.getAddrType().intValue();
|
||||
if (!(addrType == 4|| addrType == 6 || addrType == 46|| addrType == 64 || addrType ==10)) {
|
||||
throw new RestServiceException("ipRegionList中regionId为" + ipRegion.getRegionId()
|
||||
+ "的域配置addrType的值只能为4(IPV4)、6(IPV6)、46(4OVER6隧道)、64(6OVER4隧道)、10(全部)",
|
||||
RestBusinessCode.AddrTypeIsWrongRange.getValue());
|
||||
}
|
||||
|
||||
validateIpAndMask(ipRegion);
|
||||
|
||||
if (!BasicProvingUtil.isPortOrPortMask(ipRegion.getSrcPort())) {
|
||||
|
||||
@@ -412,8 +412,10 @@ public class ServiceAndRDBIndexReal {
|
||||
Iterator mapIterator = map.keySet().iterator();
|
||||
while (mapIterator.hasNext()) {
|
||||
String regionName = mapIterator.next().toString();
|
||||
if (StringUtil.isEmpty(groupReuseRegionMap.containsKey(regionName))) {
|
||||
groupReuseRegionMap.put(regionName, map.get(regionName));
|
||||
if (!groupReuseRegionMap.containsKey(regionName)) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.addAll(map.get(regionName));
|
||||
groupReuseRegionMap.put(regionName, list);
|
||||
}else{
|
||||
groupReuseRegionMap.get(regionName).addAll(map.get(regionName));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user