Package net.i2p.i2ptunnel.access
Class AccessCounter
- java.lang.Object
-
- net.i2p.i2ptunnel.access.AccessCounter
-
class AccessCounter extends Object
Counts connection attempts and decides if specified thresholds have been breached.- Since:
- 0.9.40
-
-
Constructor Summary
Constructors Constructor Description AccessCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (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
-
-
-
Method Detail
-
recordAccess
void recordAccess(long now)
records that a connection attempt was made- Parameters:
now- the current time
-
isBreached
boolean isBreached(Threshold threshold, long now)
- 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
-
-