parent
4038c75cb5
commit
e7f557862f
|
@ -455,6 +455,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
return ErrorCode.ERR_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sync dp tech device info.
|
||||
*/
|
||||
|
@ -501,6 +502,36 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
|
||||
// 防护对象存在
|
||||
if (dpBypassManager.getProtectObject().containsKey(protectName)) {
|
||||
//进一步判断关联模板是都正确,防护IP段是否发生变化
|
||||
protectionObjExist(entry, protectName, template, ipV4, ipV6, ipSegment);
|
||||
} else {
|
||||
err = createProtectObject(protectName,
|
||||
ipSegment.get(entry.getKey()),
|
||||
IpAddrType.IPV4.equals(entry.getKey()) ? 0 : 1,
|
||||
template);
|
||||
if (err == ErrorCode.ERR_OK) {
|
||||
log.debug("Add Protection Object {} Succeed", protectName);
|
||||
} else {
|
||||
log.error("!!!!Add Protection Object {} Error: {}", protectName, err.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// UMC 同步到处置平台
|
||||
umcSynDisPlatform();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 防护对象存在的情况
|
||||
*/
|
||||
private void protectionObjExist(Map.Entry<IpAddrType, String> entry, String protectName, String template,
|
||||
List<String> ipV4, List<String> ipV6, HashMap<IpAddrType, String> ipSegment) {
|
||||
|
||||
ErrorCode err;
|
||||
|
||||
// 防护对象存在
|
||||
DpProtectObject dp = dpBypassManager.getProtectObject().get(protectName);
|
||||
|
||||
// 判断关联模板是否正确
|
||||
|
@ -549,6 +580,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// 更新防护对象
|
||||
if (upgradeIpSegment) {
|
||||
err = upgradeProtectObject(protectName,
|
||||
|
@ -561,20 +593,13 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
log.error("!!!!upgrade Protection Object {} Error: {}", protectName, err.getMsg());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
err = createProtectObject(protectName,
|
||||
ipSegment.get(entry.getKey()),
|
||||
IpAddrType.IPV4.equals(entry.getKey()) ? 0 : 1,
|
||||
template);
|
||||
if (err == ErrorCode.ERR_OK) {
|
||||
log.debug("Add Protection Object {} Succeed", protectName);
|
||||
} else {
|
||||
log.error("!!!!Add Protection Object {} Error: {}", protectName, err.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* UMC 同步到处置平台
|
||||
*/
|
||||
private void umcSynDisPlatform() {
|
||||
// UMC 同步到处置平台
|
||||
ArrayList<String> protectNames = new ArrayList<>();
|
||||
|
||||
|
@ -594,9 +619,9 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
log.error("!!!!Remove Protect Object Error: {}", protectName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets protect object name.
|
||||
|
|
Loading…
Reference in New Issue