Package org.bgerp.util

# Class AntiSpam

java.lang.Object
org.bgerp.util.AntiSpam

public class AntiSpam extends Object
Simple IP based anti-spam. Prevents sequential requests from single IP address more often than some timeout.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AntiSpam(long timeout)`
  Constructor.
  `AntiSpam(Duration timeout)`
  Constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getWaitTimeout(String ip)`
  How many milliseconds wait until next request from the IP.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AntiSpam

    public AntiSpam(long timeout)
    Constructor.
    Parameters:
      `timeout` - - timeout in milliseconds.

  - ### AntiSpam

    public AntiSpam(Duration timeout)
    Constructor.
    Parameters:
      `timeout` -

- ## Method Details

  - ### getWaitTimeout

    public long getWaitTimeout(String ip)
    How many milliseconds wait until next request from the IP.
    Parameters:
      `ip` - IP address.
    Returns: