parent
495a73c005
commit
73ff082065
|
@ -61,7 +61,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
/**
|
/**
|
||||||
* The Object prefix.
|
* The Object prefix.
|
||||||
*/
|
*/
|
||||||
private final String objectPrefix = "C";
|
private final String objectPrefix = "H";
|
||||||
/**
|
/**
|
||||||
* The Dp bypass manager.
|
* The Dp bypass manager.
|
||||||
*/
|
*/
|
||||||
|
@ -270,12 +270,12 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
* @return the ip segment format
|
* @return the ip segment format
|
||||||
*/
|
*/
|
||||||
private String getIpV6SegmentFormat(String ipSegment) {
|
private String getIpV6SegmentFormat(String ipSegment) {
|
||||||
if(ipSegment.contains(ConstValue.IPV6_SEGMENT_SPILT)){
|
if (ipSegment.contains(ConstValue.IPV6_SEGMENT_SPILT)) {
|
||||||
return ipSegment;
|
return ipSegment;
|
||||||
}
|
}
|
||||||
|
|
||||||
//如果输入格式为IP-IP,则返回值为null
|
//如果输入格式为IP-IP,则返回值为null
|
||||||
if(ipSegment.contains(ConstValue.IPV6_ERR_SEGMENT_SPILT)){
|
if (ipSegment.contains(ConstValue.IPV6_ERR_SEGMENT_SPILT)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -501,10 +501,10 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
if (!k.contains(":")) {
|
if (!k.contains(":")) {
|
||||||
ipV4.add(ipV4Idx++ + "_" + getIpSegmentFormat(k));
|
ipV4.add(ipV4Idx++ + "_" + getIpSegmentFormat(k));
|
||||||
} else {
|
} else {
|
||||||
if(getIpV6SegmentFormat(k) == null){
|
if (getIpV6SegmentFormat(k) == null) {
|
||||||
log.error("!!!!ipV6:{} format error", k);
|
log.error("!!!!ipV6:{} format error", k);
|
||||||
return;
|
return;
|
||||||
}else{
|
} else {
|
||||||
ipV6.add(ipV6Idx++ + "_" + getIpV6SegmentFormat(k));
|
ipV6.add(ipV6Idx++ + "_" + getIpV6SegmentFormat(k));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -524,6 +524,8 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
for (Map.Entry<IpAddrType, String> entry : ipSegment.entrySet()) {
|
for (Map.Entry<IpAddrType, String> entry : ipSegment.entrySet()) {
|
||||||
String protectName = getProtectObjectName(v.getServiceId(), entry.getKey());
|
String protectName = getProtectObjectName(v.getServiceId(), entry.getKey());
|
||||||
|
|
||||||
|
//只处理CMHY前缀的防护对象
|
||||||
|
if (protectName.startsWith(objectPrefix)) {
|
||||||
// 防护对象存在
|
// 防护对象存在
|
||||||
if (dpBypassManager.getProtectObject().containsKey(protectName)) {
|
if (dpBypassManager.getProtectObject().containsKey(protectName)) {
|
||||||
//进一步判断关联模板是都正确,防护IP段是否发生变化
|
//进一步判断关联模板是都正确,防护IP段是否发生变化
|
||||||
|
@ -540,6 +542,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// UMC 同步到处置平台
|
// UMC 同步到处置平台
|
||||||
|
@ -604,7 +607,6 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 更新防护对象
|
// 更新防护对象
|
||||||
if (upgradeIpSegment) {
|
if (upgradeIpSegment) {
|
||||||
err = upgradeProtectObject(protectName,
|
err = upgradeProtectObject(protectName,
|
||||||
|
@ -734,18 +736,8 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
if (ret != null && ret.getBypassManualTractionStrategyForService().size() > 0) {
|
if (ret != null && ret.getBypassManualTractionStrategyForService().size() > 0) {
|
||||||
ret.getBypassManualTractionStrategyForService().forEach(k -> {
|
ret.getBypassManualTractionStrategyForService().forEach(k -> {
|
||||||
String policyName = k.getPolicyName().getValue();
|
String policyName = k.getPolicyName().getValue();
|
||||||
// 非法名称的旁路牵引策略
|
// 非法名称的旁路牵引策略-因UMC平台共享,不能删除第三方的方璐手动牵引策略
|
||||||
if (!policyName.startsWith(objectPrefix)) {
|
if (policyName.startsWith(objectPrefix)) {
|
||||||
NtcRequestResultInfo rsp =
|
|
||||||
getCleanTypePort().delBypassManualTractionStrategyForUMC(policyName);
|
|
||||||
|
|
||||||
if (rsp.getResultRetVal() == 0) {
|
|
||||||
log.debug("Remove Traction Strategy {} Succeed", policyName);
|
|
||||||
} else {
|
|
||||||
log.error("!!!!Remove Traction Strategy {} Error: {}", policyName, rsp.getResultInfo()
|
|
||||||
.getValue());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DpTractionStrategy obj;
|
DpTractionStrategy obj;
|
||||||
|
|
||||||
if (dpBypassManager.getTractionStrategyName().containsKey(policyName)) {
|
if (dpBypassManager.getTractionStrategyName().containsKey(policyName)) {
|
||||||
|
@ -863,20 +855,9 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
|
|
||||||
ret.getProtectionObjectDataForService().forEach(k -> {
|
ret.getProtectionObjectDataForService().forEach(k -> {
|
||||||
String objName = k.getProtectionName().getValue();
|
String objName = k.getProtectionName().getValue();
|
||||||
// 删除非法的防护对象
|
|
||||||
if (!objName.startsWith(objectPrefix)) {
|
|
||||||
log.error("!!!!Found Unexpect Protection Object [{}, {}], Deleted it.",
|
|
||||||
objName,
|
|
||||||
k.getIpSegment().getValue());
|
|
||||||
|
|
||||||
NtcRequestResultInfo rsp = getCleanTypePort().deleteProtectionObjectForUMC(objName);
|
// 只处理CMHY相关对象,不可对UMC上的非杭研防护对象进行删除
|
||||||
|
if (objName.startsWith(objectPrefix)) {
|
||||||
if (rsp.getResultRetVal() == 0) {
|
|
||||||
log.warn("!!!!Remove Protection Object {} Succeed", objName);
|
|
||||||
} else {
|
|
||||||
log.error("!!!!Remove Protection Object {} Error: {}", objName, rsp.getResultInfo().getValue());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DpProtectObject obj;
|
DpProtectObject obj;
|
||||||
|
|
||||||
if (dpBypassManager.getProtectObject().containsKey(objName)) {
|
if (dpBypassManager.getProtectObject().containsKey(objName)) {
|
||||||
|
@ -918,7 +899,6 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
||||||
rsp.getResultInfo().getValue());
|
rsp.getResultInfo().getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// 判断是否需要更新IP段信息
|
// 判断是否需要更新IP段信息
|
||||||
|
|
Loading…
Reference in New Issue