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