Class AntiSpamServiceImpl

  • All Implemented Interfaces:
    AntiSpamService

    @Service("antiSpamService")
    public class AntiSpamServiceImpl
    extends java.lang.Object
    implements AntiSpamService
    Implementation of AntiSpamService interface
    Author:
    Ruslan Nazirov
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isBlocked​(java.lang.String ip, java.lang.String operation, long unblockInterval, long blockInterval)
      Check if user blocked and can't execute certain operation
      boolean isBlocked​(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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AntiSpamServiceImpl

        public AntiSpamServiceImpl()
    • 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: AntiSpamService
        Check if user blocked and can't execute certain operation
        Specified by:
        isBlocked in interface AntiSpamService
        Parameters:
        ip - IP address of a user
        operation - operation to execute
        unblockInterval - 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: AntiSpamService
        Check if user blocked and can't execute certain operation
        Specified by:
        isBlocked in interface AntiSpamService
        Parameters:
        ip - IP address of a user
        operation - operation to execute
        unblockInterval - 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