public class ReadEventCounterCache extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,org.joda.time.DateTime> |
idMap |
static int |
STANDARD_COUNTER_INTERVAL_PDF |
protected Map<org.joda.time.DateTime,HashSet<String>> |
timeMap |
Constructor and Description |
---|
ReadEventCounterCache()
Creates a ReadEventCounterCache with the standard double-click window
of 30 seconds.
|
ReadEventCounterCache(int timeWindowSeconds)
Creates a ReadEventCounterCache with the specified double-click / repeatVisit
time window.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String eventKey)
A method to determine if an eventKey is present in the cache.
|
boolean |
isLaterOrSameAsLatestCachedTime(org.joda.time.DateTime testValue)
Useful for checking that log Entries are being processed in chronological order.
|
boolean |
isRepeatVisit(String eventKey,
org.joda.time.DateTime value)
Used to determine if an event is a repeatVisit.
|
int |
pruneOutdatedCacheEntries()
Removes items from the cache that are more than the configured seconds
older than the latest time in the cache.
|
void |
putEvent(String eventKey,
org.joda.time.DateTime value)
Puts a read event into the cache, with the same add / replace semantics as Map.put.
|
int |
size()
gets the number of IDs in the Cache
|
public static final int STANDARD_COUNTER_INTERVAL_PDF
public ReadEventCounterCache()
public ReadEventCounterCache(int timeWindowSeconds)
timeWindowSeconds
- public int size()
public boolean contains(String eventKey)
eventKey
- public boolean isLaterOrSameAsLatestCachedTime(org.joda.time.DateTime testValue)
testValue
- public boolean isRepeatVisit(String eventKey, org.joda.time.DateTime value)
eventKey
- value
- public void putEvent(String eventKey, org.joda.time.DateTime value)
eventKey
- value
- public int pruneOutdatedCacheEntries()
Copyright © 2019. All rights reserved.