parent
dae44b609e
commit
26283fe135
|
@ -101,6 +101,14 @@ public interface DisposeAbility {
|
|||
*/
|
||||
boolean isCarryProtectIp(String ipAddr);
|
||||
|
||||
/**
|
||||
* Is carry attack type boolean.
|
||||
*
|
||||
* @param attackType the attack type
|
||||
* @return the boolean
|
||||
*/
|
||||
boolean isCarryAttackType(Long attackType);
|
||||
|
||||
/**
|
||||
* Period task runtime.
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.dispose.ability.impl;
|
|||
|
||||
import com.dispose.ability.DisposeAbility;
|
||||
import com.dispose.common.CommonEnumHandler;
|
||||
import com.dispose.common.DDoSAttackType;
|
||||
import com.dispose.common.DisposeCapacityType;
|
||||
import com.dispose.common.DisposeConfigValue;
|
||||
import com.dispose.common.DisposeObjectType;
|
||||
|
@ -395,4 +396,15 @@ public class DpTechAbilityImpl implements DisposeAbility {
|
|||
public void upgradeServiceGroup(List<ServiceInfo> svrList) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Is carry attack type boolean.
|
||||
*
|
||||
* @param attackType the attack type
|
||||
* @return the boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isCarryAttackType(Long attackType) {
|
||||
return !DDoSAttackType.maskToDdosAttackType(attackType).contains(DDoSAttackType.NONE_ATTACKS);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.dispose.ability.impl;
|
|||
|
||||
import com.dispose.common.CommonEnumHandler;
|
||||
import com.dispose.common.ConstValue;
|
||||
import com.dispose.common.DDoSAttackType;
|
||||
import com.dispose.common.DisposeCapacityType;
|
||||
import com.dispose.common.DisposeConfigValue;
|
||||
import com.dispose.common.DisposeObjectType;
|
||||
|
@ -165,8 +166,8 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
}
|
||||
|
||||
// 清理缓存中的对象
|
||||
for(String v : disposeObjectCache.keySet()) {
|
||||
if(disposeObjectCache.get(v).equals(objName)) {
|
||||
for (String v : disposeObjectCache.keySet()) {
|
||||
if (disposeObjectCache.get(v).equals(objName)) {
|
||||
disposeObjectCache.remove(v);
|
||||
}
|
||||
}
|
||||
|
@ -982,4 +983,31 @@ public class DpTechBypassAbilityImpl extends DpTechAbilityImpl {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Is carry attack type boolean.
|
||||
*
|
||||
* @param attackType the attack type
|
||||
* @return the boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isCarryAttackType(Long attackType) {
|
||||
return DDoSAttackType.maskToDdosAttackType(attackType).contains(DDoSAttackType.NONE_ATTACKS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Device ready boolean.
|
||||
*
|
||||
* @return the boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean deviceReady() {
|
||||
if (disposeServiceGroup.keySet().size() == 0
|
||||
|| dpBypassManager.getProtectObject().keySet().size() == 0
|
||||
|| dpBypassManager.getProtectStrategy().keySet().size() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.deviceReady();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,6 +278,16 @@ public class HaoHanAbilityImpl implements DisposeAbility {
|
|||
*/
|
||||
@Override
|
||||
public void upgradeServiceGroup(List<ServiceInfo> svrList) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is carry attack type boolean.
|
||||
*
|
||||
* @param attackType the attack type
|
||||
* @return the boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isCarryAttackType(Long attackType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -389,7 +389,17 @@ public class HuaWeiAbilityImpl implements DisposeAbility {
|
|||
*/
|
||||
@Override
|
||||
public void upgradeServiceGroup(List<ServiceInfo> svrList) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is carry attack type boolean.
|
||||
*
|
||||
* @param attackType the attack type
|
||||
* @return the boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isCarryAttackType(Long attackType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -537,6 +537,16 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
|||
*/
|
||||
@Override
|
||||
public void upgradeServiceGroup(List<ServiceInfo> svrList) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is carry attack type boolean.
|
||||
*
|
||||
* @param attackType the attack type
|
||||
* @return the boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isCarryAttackType(Long attackType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,6 +171,16 @@ public class VirtualAbilityImpl implements DisposeAbility {
|
|||
*/
|
||||
@Override
|
||||
public void upgradeServiceGroup(List<ServiceInfo> svrList) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is carry attack type boolean.
|
||||
*
|
||||
* @param attackType the attack type
|
||||
* @return the boolean
|
||||
*/
|
||||
@Override
|
||||
public boolean isCarryAttackType(Long attackType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -475,6 +475,10 @@ public class DeviceTaskManagerServiceImpl implements DeviceTaskManagerService {
|
|||
.getDisposeCapacity()))
|
||||
// 当前设备是否支持处置该IP
|
||||
.filter(c -> c.getDb().isCarryProtectIp(v.getDisposeObject()))
|
||||
// 判断当前攻击类型是否支持
|
||||
.filter(c -> c.getDb().isCarryAttackType(v.getAttackType()))
|
||||
// 判断设备是否就绪
|
||||
.filter(c -> c.getDb().deviceReady())
|
||||
.forEach(d -> {
|
||||
log.info("Add dispose task for device: {}", d.getDev());
|
||||
|
||||
|
|
Loading…
Reference in New Issue