REM:
1. 解决checkstyle告警问题
2. 修改华为防火墙启动处置任务
This commit is contained in:
chenlinghy 2021-05-01 16:45:54 +08:00
parent 6fae83b295
commit 99ba09966e
3 changed files with 7 additions and 3 deletions

View File

@ -13,6 +13,7 @@ import com.dispose.pojo.po.MulReturnType;
import com.dispose.pojo.vo.DeviceFirewareInfo; import com.dispose.pojo.vo.DeviceFirewareInfo;
import com.dispose.security.arithmetic.CryptoHelper; import com.dispose.security.arithmetic.CryptoHelper;
import com.huaweifirewall.dispose.common.HuaWeiFireWallCreatePolicyReq; import com.huaweifirewall.dispose.common.HuaWeiFireWallCreatePolicyReq;
import com.huaweifirewall.dispose.common.SourceIp;
import com.huaweifirewall.dispose.protocol.HuaWeiFireWallInterface; import com.huaweifirewall.dispose.protocol.HuaWeiFireWallInterface;
import inet.ipaddr.IPAddress; import inet.ipaddr.IPAddress;
import inet.ipaddr.IPAddressString; import inet.ipaddr.IPAddressString;
@ -118,8 +119,11 @@ public class HuaWeiFireWallAbilityImpl implements DisposeAbility {
return new MulReturnType<>(ErrorCode.ERR_LOGOUT, ""); return new MulReturnType<>(ErrorCode.ERR_LOGOUT, "");
} }
SourceIp sourceIp = new SourceIp();
sourceIp.setAddressIpv4(disposeObj);
HuaWeiFireWallCreatePolicyReq policyReq = HuaWeiFireWallCreatePolicyReq.builder() HuaWeiFireWallCreatePolicyReq policyReq = HuaWeiFireWallCreatePolicyReq.builder()
.sourceIp(disposeObj).action(false).build(); .sourceIp(sourceIp).action(false).build();
try { try {
log.info("++++Begging HuaWei FireWall Start Cleanup Task: {}", disposeObject); log.info("++++Begging HuaWei FireWall Start Cleanup Task: {}", disposeObject);

View File

@ -118,7 +118,7 @@ public class HuaWeiFireWallInterface {
/** /**
* 将string类型的XML转换成对象 * 将string类型的XML转换成对象
*/ */
public static Object convertXmlStrToObject(Class clazz, String xmlStr) { public static <T> Object convertXmlStrToObject(Class<T> clazz, String xmlStr) {
Object xmlObject = null; Object xmlObject = null;
try { try {
JAXBContext context = JAXBContext.newInstance(clazz); JAXBContext context = JAXBContext.newInstance(clazz);

View File

@ -92,7 +92,7 @@ public class HttpBodyXmlTest {
/** /**
* 将string类型的XML转换成对象 * 将string类型的XML转换成对象
*/ */
public static Object convertXmlStrToObject(Class clazz, String xmlStr) { public static <T> Object convertXmlStrToObject(Class<T> clazz, String xmlStr) {
Object xmlObject = null; Object xmlObject = null;
try { try {
JAXBContext context = JAXBContext.newInstance(clazz); JAXBContext context = JAXBContext.newInstance(clazz);