parent
6fae83b295
commit
99ba09966e
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue