parent
3d4e23b5a1
commit
189f9f97af
|
@ -9,6 +9,8 @@ import com.dispose.pojo.vo.DeviceFirewareInfo;
|
|||
import com.haohan.dispose.common.HaoHanStartCleanResp;
|
||||
import com.haohan.dispose.common.HaoHanStopCleanResp;
|
||||
import com.haohan.dispose.protocol.RestfulInterface;
|
||||
import inet.ipaddr.IPAddress;
|
||||
import inet.ipaddr.IPAddressString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -71,7 +73,7 @@ public class HaoHanAbilityImpl implements DisposeAbility {
|
|||
}
|
||||
|
||||
HaoHanStartCleanResp resp = restfulInterface.startClean(this.urlRootPath, ip, Math.max(duration.intValue(), 0),
|
||||
DISPOSE_PLATFORM_NAME);
|
||||
DISPOSE_PLATFORM_NAME);
|
||||
|
||||
if (resp == null) {
|
||||
log.error("----Error Haohan start clean {} server return error", ip);
|
||||
|
@ -109,7 +111,7 @@ public class HaoHanAbilityImpl implements DisposeAbility {
|
|||
}
|
||||
|
||||
HaoHanStopCleanResp resp = restfulInterface.stopClean(this.urlRootPath, taskId.intValue(),
|
||||
DISPOSE_PLATFORM_NAME);
|
||||
DISPOSE_PLATFORM_NAME);
|
||||
|
||||
if (resp == null) {
|
||||
log.error("----Error Haohan stop task{} server return error", taskId);
|
||||
|
@ -139,18 +141,18 @@ public class HaoHanAbilityImpl implements DisposeAbility {
|
|||
@Override
|
||||
public MulReturnType<ErrorCode, DeviceFirewareInfo> getAbilityDeviceFireware() {
|
||||
return new MulReturnType<>(ErrorCode.ERR_OK,
|
||||
DeviceFirewareInfo.builder()
|
||||
.vendor("HaoHan")
|
||||
.model("Unknown")
|
||||
.firmware("Unknown")
|
||||
.os("Linux Server")
|
||||
.kernel("Linux")
|
||||
.arch("x86_64")
|
||||
.version("Unknown")
|
||||
.memory(-1)
|
||||
.freeMemory(-1)
|
||||
.cpuUsed(-1)
|
||||
.build());
|
||||
DeviceFirewareInfo.builder()
|
||||
.vendor("HaoHan")
|
||||
.model("Unknown")
|
||||
.firmware("Unknown")
|
||||
.os("Linux Server")
|
||||
.kernel("Linux")
|
||||
.arch("x86_64")
|
||||
.version("Unknown")
|
||||
.memory(-1)
|
||||
.freeMemory(-1)
|
||||
.cpuUsed(-1)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -179,6 +181,7 @@ public class HaoHanAbilityImpl implements DisposeAbility {
|
|||
*/
|
||||
@Override
|
||||
public boolean isCarryProtectIp(String ipAddr) {
|
||||
return true;
|
||||
IPAddress addr = new IPAddressString(ipAddr).getAddress();
|
||||
return addr.isIPv4();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue