Package com.academy.stratum.service.impl
Class AntiSpamServiceImpl
- java.lang.Object
-
- com.academy.stratum.service.impl.AntiSpamServiceImpl
-
- All Implemented Interfaces:
AntiSpamService
@Service("antiSpamService") public class AntiSpamServiceImpl extends java.lang.Object implements AntiSpamServiceImplementation ofAntiSpamServiceinterface- Author:
- Ruslan Nazirov
-
-
Constructor Summary
Constructors Constructor Description AntiSpamServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisBlocked(java.lang.String ip, java.lang.String operation, long unblockInterval, long blockInterval)Check if user blocked and can't execute certain operationbooleanisBlocked(java.lang.String ip, java.lang.String operation, long unblockInterval, long blockInterval, java.lang.String data)Check if user blocked and can't execute certain operation
-
-
-
Method Detail
-
isBlocked
public boolean isBlocked(java.lang.String ip, java.lang.String operation, long unblockInterval, long blockInterval, java.lang.String data)Description copied from interface:AntiSpamServiceCheck if user blocked and can't execute certain operation- Specified by:
isBlockedin interfaceAntiSpamService- Parameters:
ip- IP address of a useroperation- operation to executeunblockInterval- how much time (value = 1000 means 1 second) should pass to unblock user so he can call operations on integration server.blockInterval- how much time (value = 1000 means 1 second) should pass between operation calls to process operation request as normal, otherwise activate anti-spam protection.data- if operation have specific data and each request has it, check for previous call data equality- Returns:
- true if user is blocked and can't execute this operation
-
isBlocked
public boolean isBlocked(java.lang.String ip, java.lang.String operation, long unblockInterval, long blockInterval)Description copied from interface:AntiSpamServiceCheck if user blocked and can't execute certain operation- Specified by:
isBlockedin interfaceAntiSpamService- Parameters:
ip- IP address of a useroperation- operation to executeunblockInterval- how much time (value = 1000 means 1 second) should pass to unblock user so he can call operations on integration server.blockInterval- how much time (value = 1000 means 1 second) should pass between operation calls to process operation request as normal, otherwise activate anti-spam protection.- Returns:
- true if user is blocked and can't execute this operation
-
-