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
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) booleanisBreached(Threshold threshold, long now) (package private) booleanpurge(long olderThan) Purges old accesses from the list.(package private) voidrecordAccess(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
-