parent
f3f9ea13ca
commit
64a3e43245
|
@ -239,17 +239,14 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
/**
|
||||
* Gets traction strategy format.
|
||||
*
|
||||
* @param disposeObject the dispose object
|
||||
* @param ipSegment the dispose object
|
||||
* @return the traction strategy format
|
||||
*/
|
||||
private String getTractionStrategyFormat(String disposeObject) {
|
||||
// 根据 - / 字符进行分割字符串
|
||||
String[] ret = disposeObject.replaceAll("/", "-").split("-");
|
||||
|
||||
if(ret.length == 0) {
|
||||
return disposeObject;
|
||||
private String getIpSegmentFormat(String ipSegment) {
|
||||
if (!ipSegment.contains("/") && !ipSegment.contains("-")) {
|
||||
return ipSegment + "-" + ipSegment;
|
||||
} else {
|
||||
return ret[0] + "-" + ret[0];
|
||||
return ipSegment;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -279,7 +276,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
// 创建旁路手动牵引策略
|
||||
ret = getCleanTypePort().addBypassManualTractionStrategyForUMC(tractionName,
|
||||
objName,
|
||||
getTractionStrategyFormat(disposeObject));
|
||||
getIpSegmentFormat(disposeObject));
|
||||
if (ret.getResultRetVal() == 0) {
|
||||
log.debug("----Finish Create Traction Strategy {} Succeed", tractionName);
|
||||
return ErrorCode.ERR_OK;
|
||||
|
@ -466,9 +463,9 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
// 将业务Ip根据IP地址类型进行拆分
|
||||
for (String k : StringUtils.deleteWhitespace(v.getServiceIp()).split(DisposeConfigValue.SPLIT_CHAR)) {
|
||||
if (!k.contains(":")) {
|
||||
ipV4.add(ipV4Idx++ + "_" + k);
|
||||
ipV4.add(ipV4Idx++ + "_" + getIpSegmentFormat(k));
|
||||
} else {
|
||||
ipV6.add(ipV6Idx++ + "_" + k);
|
||||
ipV6.add(ipV6Idx++ + "_" + getIpSegmentFormat(k));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue