public class SFSFloodFilter extends com.smartfoxserver.v2.core.service.BaseCoreService implements IFloodFilter
Constructor and Description |
---|
SFSFloodFilter(com.smartfoxserver.v2.entities.managers.IBannedUserManager manager) |
Modifier and Type | Method and Description |
---|---|
void |
addRequestFilter(SystemRequest request,
int reqPerSecond) |
void |
clearAllFilters() |
void |
filterRequest(SystemRequest reqType,
User user) |
int |
getBanDurationMinutes() |
java.lang.String |
getBanMessage() |
BanMode |
getBanMode() |
int |
getMaxFloodingAttempts() |
java.util.Map<SystemRequest,java.lang.Integer> |
getRequestTable() |
int |
getSecondsBeforeBan() |
void |
init(java.lang.Object o)
Initialize service
|
boolean |
isLogFloodingAttempts() |
boolean |
isRequestFiltered(SystemRequest request) |
void |
setActive(boolean flag) |
void |
setBanDurationMinutes(int banDurationMinutes) |
void |
setBanMessage(java.lang.String banMessage) |
void |
setBanMode(BanMode banMode) |
void |
setLogFloodingAttempts(boolean logFloodingAttempts) |
void |
setMaxFloodingAttempts(int maxFloodingAttempts) |
void |
setSecondsBeforeBan(int secondsBeforeBan) |
destroy, getId, getName, handleMessage, isActive, setName, toString
public SFSFloodFilter(com.smartfoxserver.v2.entities.managers.IBannedUserManager manager)
public void init(java.lang.Object o)
com.smartfoxserver.bitswarm.service.IService
init
in interface com.smartfoxserver.bitswarm.service.IService
init
in class com.smartfoxserver.v2.core.service.BaseCoreService
o
- custom parameterspublic void filterRequest(SystemRequest reqType, User user) throws SFSFloodingException
filterRequest
in interface IFloodFilter
SFSFloodingException
public void setActive(boolean flag)
setActive
in interface IFloodFilter
public void addRequestFilter(SystemRequest request, int reqPerSecond)
addRequestFilter
in interface IFloodFilter
public java.util.Map<SystemRequest,java.lang.Integer> getRequestTable()
getRequestTable
in interface IFloodFilter
public void clearAllFilters()
clearAllFilters
in interface IFloodFilter
public boolean isRequestFiltered(SystemRequest request)
isRequestFiltered
in interface IFloodFilter
public int getBanDurationMinutes()
getBanDurationMinutes
in interface IFloodFilter
public void setBanDurationMinutes(int banDurationMinutes)
setBanDurationMinutes
in interface IFloodFilter
public int getMaxFloodingAttempts()
getMaxFloodingAttempts
in interface IFloodFilter
public void setMaxFloodingAttempts(int maxFloodingAttempts)
setMaxFloodingAttempts
in interface IFloodFilter
public int getSecondsBeforeBan()
getSecondsBeforeBan
in interface IFloodFilter
public void setSecondsBeforeBan(int secondsBeforeBan)
setSecondsBeforeBan
in interface IFloodFilter
public boolean isLogFloodingAttempts()
isLogFloodingAttempts
in interface IFloodFilter
public void setLogFloodingAttempts(boolean logFloodingAttempts)
setLogFloodingAttempts
in interface IFloodFilter
public BanMode getBanMode()
getBanMode
in interface IFloodFilter
public void setBanMode(BanMode banMode)
setBanMode
in interface IFloodFilter
public java.lang.String getBanMessage()
getBanMessage
in interface IFloodFilter
public void setBanMessage(java.lang.String banMessage)
setBanMessage
in interface IFloodFilter