diff --git a/src/main/java/com/dispose/ability/impl/HuaWeiAbilityImpl.java b/src/main/java/com/dispose/ability/impl/HuaWeiAbilityImpl.java index cd321169..9bdf9e58 100644 --- a/src/main/java/com/dispose/ability/impl/HuaWeiAbilityImpl.java +++ b/src/main/java/com/dispose/ability/impl/HuaWeiAbilityImpl.java @@ -32,6 +32,14 @@ import java.util.List; @Component @Slf4j 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. */ @@ -40,16 +48,6 @@ public class HuaWeiAbilityImpl implements DisposeAbility { * The Device link status. */ 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. */ @@ -116,7 +114,7 @@ public class HuaWeiAbilityImpl implements DisposeAbility { if (addr.isIPv4()) { disposeObj = disposeObject + "/32"; - }else if(addr.isIPv6()) { + } else if (addr.isIPv6()) { disposeObj = disposeObject + "/128"; } @@ -147,7 +145,8 @@ public class HuaWeiAbilityImpl implements DisposeAbility { } 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); } @@ -184,7 +183,7 @@ public class HuaWeiAbilityImpl implements DisposeAbility { if (addr.isIPv4()) { disposeObj = disposeObject + "-32"; - }else if(addr.isIPv6()) { + } else if (addr.isIPv6()) { disposeObj = disposeObject + "-128"; } @@ -254,18 +253,18 @@ public class HuaWeiAbilityImpl implements DisposeAbility { @Override public MulReturnType getAbilityDeviceFireware() { return new MulReturnType<>(ErrorCode.ERR_OK, - DeviceFirewareInfo.builder() - .vendor("HuaWei") - .model("Unknown") - .firmware("Unknown") - .os("Linux Server") - .kernel("Linux") - .arch("x86_64") - .version("Unknown") - .memory(-1) - .freeMemory(-1) - .cpuUsed(-1) - .build()); + DeviceFirewareInfo.builder() + .vendor("HuaWei") + .model("Unknown") + .firmware("Unknown") + .os("Linux Server") + .kernel("Linux") + .arch("x86_64") + .version("Unknown") + .memory(-1) + .freeMemory(-1) + .cpuUsed(-1) + .build()); } /** @@ -313,8 +312,7 @@ public class HuaWeiAbilityImpl implements DisposeAbility { if (response.getStatus() == HttpServletResponse.SC_OK) { deviceLinkStatus = true; } - } catch ( - Exception ex) { + } catch (Exception ex) { log.error(ex.getMessage()); } diff --git a/src/main/java/com/dispose/restful/RestfulInterface.java b/src/main/java/com/dispose/restful/RestfulInterface.java index 0c61dc6b..7804c713 100644 --- a/src/main/java/com/dispose/restful/RestfulInterface.java +++ b/src/main/java/com/dispose/restful/RestfulInterface.java @@ -24,20 +24,20 @@ import java.util.Map; @Slf4j public class RestfulInterface { /** - * Instantiates a new Restful interface. + * The constant OBJECT_MAPPER. */ - private RestfulInterface () { - throw new AssertionError("Instantiating utility class."); - } - + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); /** * The constant timeOutValue. */ 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. @@ -203,11 +203,11 @@ public class RestfulInterface { /** * huawei pro run protocol resp dto. * - * @param the type parameter - * @param url the url - * @param token the token - * @param obj the obj - * @param reqType the req type + * @param the type parameter + * @param url the url + * @param token the token + * @param obj the obj + * @param reqType the req type * @return the t */ public static HttpResponse huaWeiProRun(String url, String token, E obj, RequestMethod reqType) {