Package net.i2p.i2ptunnel.access
Class AccessCounter
java.lang.Object
net.i2p.i2ptunnel.access.AccessCounter
Counts connection attempts and decides if specified thresholds have been
breached.
- Since:
- 0.9.40
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) boolean
isBreached
(Threshold threshold, long now) (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
-
Constructor Details
-
AccessCounter
AccessCounter()
-
-
Method Details
-
recordAccess
void recordAccess(long now) records that a connection attempt was made- Parameters:
now
- the current time
-
isBreached
- Parameters:
threshold
- definition of a thresholdnow
- 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
-