parent
a40a7d7f7c
commit
a57f441a07
|
@ -32,6 +32,14 @@ import java.util.List;
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class HuaWeiAbilityImpl implements DisposeAbility {
|
public class HuaWeiAbilityImpl implements DisposeAbility {
|
||||||
|
/**
|
||||||
|
* The constant OBJECT_MAPPER.
|
||||||
|
*/
|
||||||
|
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||||
|
/**
|
||||||
|
* The Restful interface.
|
||||||
|
*/
|
||||||
|
private final HuaWeiInterface restfulInterface = new HuaWeiInterface();
|
||||||
/**
|
/**
|
||||||
* The Timer cnt.
|
* The Timer cnt.
|
||||||
*/
|
*/
|
||||||
|
@ -40,16 +48,6 @@ public class HuaWeiAbilityImpl implements DisposeAbility {
|
||||||
* The Device link status.
|
* The Device link status.
|
||||||
*/
|
*/
|
||||||
private boolean deviceLinkStatus = false;
|
private boolean deviceLinkStatus = false;
|
||||||
/**
|
|
||||||
* The Restful interface.
|
|
||||||
*/
|
|
||||||
private final HuaWeiInterface restfulInterface = new HuaWeiInterface();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The constant OBJECT_MAPPER.
|
|
||||||
*/
|
|
||||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Url root path.
|
* The Url root path.
|
||||||
*/
|
*/
|
||||||
|
@ -116,7 +114,7 @@ public class HuaWeiAbilityImpl implements DisposeAbility {
|
||||||
|
|
||||||
if (addr.isIPv4()) {
|
if (addr.isIPv4()) {
|
||||||
disposeObj = disposeObject + "/32";
|
disposeObj = disposeObject + "/32";
|
||||||
}else if(addr.isIPv6()) {
|
} else if (addr.isIPv6()) {
|
||||||
disposeObj = disposeObject + "/128";
|
disposeObj = disposeObject + "/128";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +145,8 @@ public class HuaWeiAbilityImpl implements DisposeAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resp != ErrorCode.ERR_OK) {
|
if (resp != ErrorCode.ERR_OK) {
|
||||||
log.error("----Error HuaWei start clean {} return error: {}, {}", disposeObject, resp.getCode(), resp.getMsg());
|
log.error("----Error HuaWei start clean {} return error: {}, {}", disposeObject, resp.getCode(),
|
||||||
|
resp.getMsg());
|
||||||
return new MulReturnType<>(ErrorCode.ERR_HUAWEI_ERROR, null);
|
return new MulReturnType<>(ErrorCode.ERR_HUAWEI_ERROR, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +183,7 @@ public class HuaWeiAbilityImpl implements DisposeAbility {
|
||||||
|
|
||||||
if (addr.isIPv4()) {
|
if (addr.isIPv4()) {
|
||||||
disposeObj = disposeObject + "-32";
|
disposeObj = disposeObject + "-32";
|
||||||
}else if(addr.isIPv6()) {
|
} else if (addr.isIPv6()) {
|
||||||
disposeObj = disposeObject + "-128";
|
disposeObj = disposeObject + "-128";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,8 +312,7 @@ public class HuaWeiAbilityImpl implements DisposeAbility {
|
||||||
if (response.getStatus() == HttpServletResponse.SC_OK) {
|
if (response.getStatus() == HttpServletResponse.SC_OK) {
|
||||||
deviceLinkStatus = true;
|
deviceLinkStatus = true;
|
||||||
}
|
}
|
||||||
} catch (
|
} catch (Exception ex) {
|
||||||
Exception ex) {
|
|
||||||
log.error(ex.getMessage());
|
log.error(ex.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,20 +24,20 @@ import java.util.Map;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RestfulInterface {
|
public class RestfulInterface {
|
||||||
/**
|
/**
|
||||||
* Instantiates a new Restful interface.
|
* The constant OBJECT_MAPPER.
|
||||||
*/
|
*/
|
||||||
private RestfulInterface () {
|
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||||
throw new AssertionError("Instantiating utility class.");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constant timeOutValue.
|
* The constant timeOutValue.
|
||||||
*/
|
*/
|
||||||
private static int timeOutValue = 1000;
|
private static int timeOutValue = 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The constant OBJECT_MAPPER.
|
* Instantiates a new Restful interface.
|
||||||
*/
|
*/
|
||||||
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
private RestfulInterface() {
|
||||||
|
throw new AssertionError("Instantiating utility class.");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Init env.
|
* Init env.
|
||||||
|
|
Loading…
Reference in New Issue