class AccessCounter extends Object
| Constructor and Description |
|---|
AccessCounter()Create a new access counter. |
| 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 |
boolean isBreached(Threshold threshold, long now)
threshold - definition of a thresholdnow - current timeboolean purge(long olderThan)
olderThan - remove all accesses older than the given timestampvoid recordAccess(long now)
now - the current time