net.i2p.i2ptunnel.access

## Class AccessCounter

- java.lang.Object
- - net.i2p.i2ptunnel.access.AccessCounter

-     class AccessCounter
      extends Object

  Access attempt counter.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AccessCounter()` Create a new access counter.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) boolean` | `isBreached(Threshold threshold, long now)` Check if the given threshold has been breached.
    `(package private) boolean` | `purge(long olderThan)` Purges old accesses from the list.
    `(package private) void` | `recordAccess(long now)` records that a connection attempt was made

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

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

- - ### Constructor Detail

    - #### AccessCounter

          AccessCounter()

      Create a new access counter.

  - ### Method Detail

    - #### isBreached

          boolean isBreached(Threshold threshold,
                             long now)

      Check if the given threshold has been breached.
      Parameters:
        `threshold` - definition of a threshold
        `now` - current time
      Returns:
        true if the given threshold has been breached

    - #### purge

          boolean purge(long olderThan)

      Purges old accesses from the list.
      Parameters:
        `olderThan` - remove all accesses older than the given timestamp
      Returns:
        true if there is nothing left in the access history

    - #### recordAccess

          void recordAccess(long now)

      records that a connection attempt was made
      Parameters:
        `now` - the current time