REM:
1. 迪普浩瀚设备处置接口调用前,检查设备是否支持改处置能力
This commit is contained in:
HuangXin 2020-09-24 18:23:10 +08:00
parent 8e6fab6d5f
commit 74b8508e83
2 changed files with 34 additions and 14 deletions

View File

@ -114,6 +114,11 @@ public class DpTechAbilityImpl implements DisposeAbility {
try { try {
log.debug("++++Begging DPTech Start Cleanup Task: {}, {}, {} ", ip, attackType, nfDirection); log.debug("++++Begging DPTech Start Cleanup Task: {}, {}, {} ", ip, attackType, nfDirection);
if (capType != DisposeCapacityType.CLEANUP) {
log.error("----Error DPTech don't support dispose capacity type: {}", capType);
return new MulReturnType<>(ErrorCode.ERR_UNSUPPORT, null);
}
NtcRequestResultInfo ret = cleanTypePort.startAbnormalTaskForUMC(ip, attackType, NtcRequestResultInfo ret = cleanTypePort.startAbnormalTaskForUMC(ip, attackType,
nfDirection.getValue()); nfDirection.getValue());
@ -157,6 +162,11 @@ public class DpTechAbilityImpl implements DisposeAbility {
try { try {
log.info("++++Begging DPTech Stop Cleanup Task: {}, {}, {} ", ip, attackType, nfDirection); log.info("++++Begging DPTech Stop Cleanup Task: {}, {}, {} ", ip, attackType, nfDirection);
if (capType != DisposeCapacityType.CLEANUP) {
log.error("----Error DPTech don't support dispose capacity type: {}", capType);
return new MulReturnType<>(ErrorCode.ERR_UNSUPPORT, null);
}
NtcRequestResultInfo ret = cleanTypePort.stopAbnormalTaskForUMC(ip, attackType, NtcRequestResultInfo ret = cleanTypePort.stopAbnormalTaskForUMC(ip, attackType,
nfDirection.getValue()); nfDirection.getValue());

View File

@ -67,6 +67,11 @@ public class HaoHanAbilityImpl implements DisposeAbility {
@Nullable Long duration) { @Nullable Long duration) {
log.info("++++Begging Haohan Start Cleanup Task: {}", ip); log.info("++++Begging Haohan Start Cleanup Task: {}", ip);
if (capType != DisposeCapacityType.CLEANUP) {
log.error("----Error Haohan don't support dispose capacity type: {}", capType);
return new MulReturnType<>(ErrorCode.ERR_UNSUPPORT, null);
}
// 适配处置时间参数 -1为不限制处置时间 // 适配处置时间参数 -1为不限制处置时间
if (duration == null || duration < 0) { if (duration == null || duration < 0) {
duration = -1L; duration = -1L;
@ -106,6 +111,11 @@ public class HaoHanAbilityImpl implements DisposeAbility {
@Nullable Long taskId) { @Nullable Long taskId) {
log.debug("++++Begging Haohan Stop Cleanup Task: {}", taskId); log.debug("++++Begging Haohan Stop Cleanup Task: {}", taskId);
if (capType != DisposeCapacityType.CLEANUP) {
log.error("----Error Haohan don't support dispose capacity type: {}", capType);
return new MulReturnType<>(ErrorCode.ERR_UNSUPPORT, null);
}
if (taskId == null) { if (taskId == null) {
return new MulReturnType<>(ErrorCode.ERR_PARAMS, null); return new MulReturnType<>(ErrorCode.ERR_PARAMS, null);
} }