OCT
REM: 1. 增加了登录接口异常调试信息,定位出错设备 2. 增加了接口超时时间,由1秒改到3秒 3. 版本更新到 2.0.8.5
This commit is contained in:
parent
f7c74a6511
commit
eed53ba388
2
pom.xml
2
pom.xml
|
@ -17,7 +17,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>com.dispose</groupId>
|
<groupId>com.dispose</groupId>
|
||||||
<artifactId>dispose_platform</artifactId>
|
<artifactId>dispose_platform</artifactId>
|
||||||
<version>2.0.8.4</version>
|
<version>2.0.8.5</version>
|
||||||
<name>dispose_platform</name>
|
<name>dispose_platform</name>
|
||||||
<description>Dispose Platform</description>
|
<description>Dispose Platform</description>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
|
@ -170,12 +170,12 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
reqItems.add(PengXinStartTaskItem.builder()
|
reqItems.add(PengXinStartTaskItem.builder()
|
||||||
.type(getPengXinTaskType(capType))
|
.type(getPengXinTaskType(capType))
|
||||||
.disposeObject(disposeObject)
|
.disposeObject(disposeObject)
|
||||||
.objectType(getPengXinObjectType(objectType))
|
.objectType(getPengXinObjectType(objectType))
|
||||||
.disposeTime(duration)
|
.disposeTime(duration)
|
||||||
.taskReqId(String.valueOf(taskReqId++))
|
.taskReqId(String.valueOf(taskReqId++))
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
ProtocolRespDTO<PengXinStartTaskRsp> rspInfo = restfulInterface.startDisposeTask(url, token, reqItems);
|
ProtocolRespDTO<PengXinStartTaskRsp> rspInfo = restfulInterface.startDisposeTask(url, token, reqItems);
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
ProtocolRespDTO<PengXinStopTaskRsp> rspInfo = restfulInterface.stopDisposeTask(url, token,
|
ProtocolRespDTO<PengXinStopTaskRsp> rspInfo = restfulInterface.stopDisposeTask(url, token,
|
||||||
new String[]{taskId});
|
new String[]{taskId});
|
||||||
|
|
||||||
// 判断是否token过期
|
// 判断是否token过期
|
||||||
if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) {
|
if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) {
|
||||||
|
@ -283,18 +283,18 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
@Override
|
@Override
|
||||||
public MulReturnType<ErrorCode, DeviceFirewareInfo> getAbilityDeviceFireware() {
|
public MulReturnType<ErrorCode, DeviceFirewareInfo> getAbilityDeviceFireware() {
|
||||||
return new MulReturnType<>(ErrorCode.ERR_OK,
|
return new MulReturnType<>(ErrorCode.ERR_OK,
|
||||||
DeviceFirewareInfo.builder()
|
DeviceFirewareInfo.builder()
|
||||||
.vendor("PengXin")
|
.vendor("PengXin")
|
||||||
.model("Unknown")
|
.model("Unknown")
|
||||||
.firmware("Unknown")
|
.firmware("Unknown")
|
||||||
.os("Linux Server")
|
.os("Linux Server")
|
||||||
.kernel("Linux")
|
.kernel("Linux")
|
||||||
.arch("x86_64")
|
.arch("x86_64")
|
||||||
.version("Unknown")
|
.version("Unknown")
|
||||||
.memory(-1)
|
.memory(-1)
|
||||||
.freeMemory(-1)
|
.freeMemory(-1)
|
||||||
.cpuUsed(-1)
|
.cpuUsed(-1)
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -463,7 +463,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
String url = urlRootPath + "dispose_device/task/get";
|
String url = urlRootPath + "dispose_device/task/get";
|
||||||
|
|
||||||
ProtocolRespDTO<PengXinTaskStatusRsp> rspInfo = restfulInterface.getDeviceTaskStatus(url, token,
|
ProtocolRespDTO<PengXinTaskStatusRsp> rspInfo = restfulInterface.getDeviceTaskStatus(url, token,
|
||||||
new String[]{taskId});
|
new String[]{taskId});
|
||||||
|
|
||||||
// 判断是否token过期
|
// 判断是否token过期
|
||||||
if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) {
|
if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) {
|
||||||
|
@ -478,7 +478,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MulReturnType<>(ErrorCode.ERR_OK,
|
return new MulReturnType<>(ErrorCode.ERR_OK,
|
||||||
rspInfo.getMsgContent().getItems().get(0).getTaskStatus());
|
rspInfo.getMsgContent().getItems().get(0).getTaskStatus());
|
||||||
} else {
|
} else {
|
||||||
return new MulReturnType<>(ErrorCode.ERR_CALLDEVICE, -1L);
|
return new MulReturnType<>(ErrorCode.ERR_CALLDEVICE, -1L);
|
||||||
}
|
}
|
||||||
|
@ -491,14 +491,15 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
||||||
* Upgrade token.
|
* Upgrade token.
|
||||||
*/
|
*/
|
||||||
private void upgradeToken() {
|
private void upgradeToken() {
|
||||||
|
String url = urlRootPath + "dispose_device/auth/login";
|
||||||
try {
|
try {
|
||||||
String url = urlRootPath + "dispose_device/auth/login";
|
|
||||||
ProtocolRespDTO<PengXinLoginRsp> logInfo = restfulInterface.login(url, username, password);
|
ProtocolRespDTO<PengXinLoginRsp> logInfo = restfulInterface.login(url, username, password);
|
||||||
|
|
||||||
if (logInfo != null && logInfo.getMsgContent().getStatus() == ErrorCode.ERR_OK.getCode()) {
|
if (logInfo != null && logInfo.getMsgContent().getStatus() == ErrorCode.ERR_OK.getCode()) {
|
||||||
this.token = logInfo.getMsgContent().getToken();
|
this.token = logInfo.getMsgContent().getToken();
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ex) {
|
||||||
|
log.error("Exception: {}, {}", url, ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class RestfulInterface {
|
||||||
/**
|
/**
|
||||||
* The constant timeOutValue.
|
* The constant timeOutValue.
|
||||||
*/
|
*/
|
||||||
private static int timeOutValue = 1000;
|
private static int timeOutValue = 3000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new Restful interface.
|
* Instantiates a new Restful interface.
|
||||||
|
|
Loading…
Reference in New Issue