REM:
1. 迪普设备兼容第三方联动与旁路手动牵引两种清洗模式
This commit is contained in:
HuangXin 2021-01-19 10:20:05 +08:00
parent 20c56c79ba
commit 0e91b3a064
3 changed files with 77 additions and 63 deletions

View File

@ -275,7 +275,7 @@ public class DpTechAbilityImpl implements DisposeAbility {
*/ */
@Override @Override
public Long toDeviceAttackType(Long ddosAttackTypeMask) { public Long toDeviceAttackType(Long ddosAttackTypeMask) {
return DpTechAttackType.formDdosAttackTypeMaks(ddosAttackTypeMask); return DpTechAttackType.getTypeMaskFromAttackType(new DpTechAttackType[] {DpTechAttackType.UDP_FLOOD});
} }
/** /**

View File

@ -53,7 +53,7 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
private final Hashtable<String, ServiceInfo> disposeServiceGroup = new Hashtable<>(); private final Hashtable<String, ServiceInfo> disposeServiceGroup = new Hashtable<>();
/** /**
* The Obj prefix. * The Object prefix.
*/ */
private final String objectPrefix = "CMHI"; private final String objectPrefix = "CMHI";
/** /**
@ -1026,4 +1026,15 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
return super.deviceReady(); return super.deviceReady();
} }
/**
* To device attack type long.
*
* @param ddosAttackTypeMask the ddos attack type mask
* @return the long
*/
@Override
public Long toDeviceAttackType(Long ddosAttackTypeMask) {
return DpTechAttackType.getTypeMaskFromAttackType(new DpTechAttackType[] {DpTechAttackType.AUTO_ATTACK_TYPE});
}
} }

View File

@ -150,7 +150,8 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
deviceTaskManager.attackTypeStatusSetBit(deviceTask.getId(), NetflowDirection.DIRECTION_OUT, deviceTaskManager.attackTypeStatusSetBit(deviceTask.getId(), NetflowDirection.DIRECTION_OUT,
attackType.getValue()); attackType.getValue());
log.info("DPTECH_UMC setup task {}, {} succeed: {}", attackType, NetflowDirection.DIRECTION_OUT, deviceTask); log.info("DPTECH_UMC setup task {}, {} succeed: {}", attackType, NetflowDirection.DIRECTION_OUT,
deviceTask);
deviceTaskManager.setTaskErrRetryTimes(deviceTask.getId(), 0); deviceTaskManager.setTaskErrRetryTimes(deviceTask.getId(), 0);
} else if (deviceTask.getErrRetry() < DisposeConfigValue.CALL_ERROR_RETRY_TIMES * 10) { } else if (deviceTask.getErrRetry() < DisposeConfigValue.CALL_ERROR_RETRY_TIMES * 10) {
@ -184,7 +185,8 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
deviceTaskManager.attackTypeStatusSetBit(deviceTask.getId(), NetflowDirection.DIRECTION_IN, deviceTaskManager.attackTypeStatusSetBit(deviceTask.getId(), NetflowDirection.DIRECTION_IN,
attackType.getValue()); attackType.getValue());
log.info("DPTECH_UMC setup task {}, {} succeed: {}", attackType, NetflowDirection.DIRECTION_IN, deviceTask); log.info("DPTECH_UMC setup task {}, {} succeed: {}", attackType, NetflowDirection.DIRECTION_IN,
deviceTask);
deviceTaskManager.setTaskErrRetryTimes(deviceTask.getId(), 0); deviceTaskManager.setTaskErrRetryTimes(deviceTask.getId(), 0);
} else if (deviceTask.getErrRetry() < DisposeConfigValue.CALL_ERROR_RETRY_TIMES * 10) { } else if (deviceTask.getErrRetry() < DisposeConfigValue.CALL_ERROR_RETRY_TIMES * 10) {
@ -482,9 +484,10 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
.forEach(d -> { .forEach(d -> {
log.info("Add dispose task for device: {}", d.getDev()); log.info("Add dispose task for device: {}", d.getDev());
if (!deviceTaskManager.addDisposeDeviceTaskInfo(v.getId(), d.getDev().getId(), if (!deviceTaskManager
d.getDb() .addDisposeDeviceTaskInfo(v.getId(),
.toDeviceAttackType(v.getAttackType()))) { d.getDev().getId(),
d.getDb().toDeviceAttackType(v.getAttackType()))) {
log.error("Add task {} to device {} error", v, d); log.error("Add task {} to device {} error", v, d);
} }
}); });