Class DurationChecker
- java.lang.Object
-
- com.atlassian.confluence.impl.event.DurationChecker
-
public class DurationChecker extends Object
Helper class that is used to check whether time that has passed since previous event is exceeding a threshold- Since:
- 7.7.0
-
-
Field Summary
Fields Modifier and Type Field Description static String
THRESHOLD_IN_SECONDS_KEY
-
Constructor Summary
Constructors Constructor Description DurationChecker(int defaultThresholdInSeconds)
DurationChecker(int defaultThresholdInSeconds, LongSupplier nanoTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getThresholdInSeconds()
Amount of seconds that should pass between the eventsboolean
thresholdElapsed()
Checks whether amount of time that is passed between the events has exceeded the threshold
-
-
-
Field Detail
-
THRESHOLD_IN_SECONDS_KEY
public static final String THRESHOLD_IN_SECONDS_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DurationChecker
public DurationChecker(int defaultThresholdInSeconds)
-
DurationChecker
public DurationChecker(int defaultThresholdInSeconds, LongSupplier nanoTime)
-
-
Method Detail
-
getThresholdInSeconds
public int getThresholdInSeconds()
Amount of seconds that should pass between the events
-
thresholdElapsed
public boolean thresholdElapsed()
Checks whether amount of time that is passed between the events has exceeded the threshold- Returns:
- True if amount of time exceeds the threshold or this is a first event
-
-