From 20c56c79ba72a2442af6e6f3c2faef87c4fc1a27 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Tue, 19 Jan 2021 09:44:58 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E4=BF=AE=E6=AD=A3=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E9=98=B2=E6=8A=A4=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ability/impl/DpTechBypassAbilityImpl.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java index a7081cf2..9fcd638b 100644 --- a/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/DpTechBypassAbilityImpl.java @@ -55,7 +55,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { /** * The Obj prefix. */ - private final String OBJ_PREFIX = "CMHI"; + private final String objectPrefix = "CMHI"; /** * The All cleanup devices. */ @@ -526,7 +526,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { // UMC 同步到处置平台 dpBypassManager.getProtectObject().values().forEach(v -> { String serviceId = v.getProtectName() - .replace(OBJ_PREFIX + "_", "") + .replace(objectPrefix + "_", "") .replace("_" + IpAddrType.IPV4.getDescription(), "") .replace("_" + IpAddrType.IPV6.getDescription(), ""); @@ -551,9 +551,9 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { */ private String getProtectObjectName(String serviceId, IpAddrType ipAddrType) { if (IpAddrType.IPV4.equals(ipAddrType) || IpAddrType.IPV6.equals(ipAddrType)) { - return OBJ_PREFIX + "_" + serviceId + "_" + ipAddrType.getDescription(); + return objectPrefix + "_" + serviceId + "_" + ipAddrType.getDescription(); } else { - return OBJ_PREFIX + "_" + serviceId; + return objectPrefix + "_" + serviceId; } } @@ -565,7 +565,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { * @return the traction strategy name */ private String getTractionStrategyName(String objName, String disposeIp) { - return OBJ_PREFIX + "_" + disposeIp + "_" + objName; + return objectPrefix + "_" + disposeIp + "_" + objName; } /** @@ -595,7 +595,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { ret.getBypassManualTractionStrategyForService().forEach(k -> { String policyName = k.getPolicyName().getValue(); // 非法名称的旁路牵引策略 - if (!policyName.startsWith(OBJ_PREFIX)) { + if (!policyName.startsWith(objectPrefix)) { NtcRequestResultInfo rsp = getCleanTypePort().delBypassManualTractionStrategyForUMC(policyName); @@ -656,7 +656,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { String objName = k.getProtectionTargetName().getValue(); // 只处理CMHI相关对象和模板 - if (objName.startsWith(OBJ_PREFIX)) { + if (objName.startsWith(objectPrefix)) { DpProtectionStrategyInfo obj; // 缓存中不存在改关联关系 @@ -729,7 +729,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { ret.getProtectionObjectDataForService().forEach(k -> { String objName = k.getProtectionName().getValue(); // 删除非法的防护对象 - if (!objName.startsWith(OBJ_PREFIX)) { + if (!objName.startsWith(objectPrefix)) { log.error("!!!!Found Unexpect Protection Object [{}, {}], Deleted it.", objName, k.getIpSegment().getValue()); @@ -991,7 +991,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl { for (String v : k.getIpSegment().values()) { if (Helper.ipInRange(v, ipAddr)) { // 将查找到的防护对象添加到缓存中 - disposeObjectCache.put(k.getProtectName(), k.getProtectName()); + disposeObjectCache.put(ipAddr, k.getProtectName()); return true; } }