Package host.anzo.core.service
Class FirewallService
java.lang.Object
host.anzo.core.service.FirewallService
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd firewall block rule for specified parametersvoidvoidclear()Clear blocked IP listvoidbooleanisAllowedAddress(Class<?> clazz, String ip, int destPort, double allowedRequestsPerSecond, ERestrictionType restrictionType) booleanisAllowedAddress(String className, String ip, int destPort, double allowedRequestsPerSecond, ERestrictionType restrictionType) voidremoveBlock(String ipAddress) Remove specified IP address from internal firewall
-
Method Details
-
isAllowedAddress
public boolean isAllowedAddress(Class<?> clazz, String ip, int destPort, double allowedRequestsPerSecond, ERestrictionType restrictionType) - Parameters:
clazz- service classip- client IP addressdestPort- destination service portallowedRequestsPerSecond- maximum allowed requests per secondrestrictionType- restriction, applied to connection exceeded rate limit- Returns:
trueif specified IP allowed to connect/request specified service clazz,falseotherwise
-
isAllowedAddress
public boolean isAllowedAddress(String className, String ip, int destPort, double allowedRequestsPerSecond, ERestrictionType restrictionType) - Parameters:
className- service class nameip- client IP addressdestPort- destination service portallowedRequestsPerSecond- maximum allowed requests per secondrestrictionType- restriction, applied to connection exceeded rate limit- Returns:
trueif specified IP allowed to connect/request specified service clazz,falseotherwise
-
addBlock
Add firewall block rule for specified parameters- Parameters:
className- service class nameip- client IP addressdestPort- destination service portbanTime- ban time in specified time unit'sbanTimeUnit- ban time unit's
-
removeBlock
Remove specified IP address from internal firewall- Parameters:
ipAddress- IP address to remove
-
clear
public void clear()Clear blocked IP list -
flushSystemFirewall
public void flushSystemFirewall() -
cleanupBans
public void cleanupBans()
-