public class ActivityStatsService extends Object implements org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
static String |
TRACKER_CACHE_NAME
The Constant TRACKER_CACHE_NAME.
|
static int |
TRACKER_CACHE_PERIOD
The Constant TRACKER_CACHE_PERIOD.
|
| Constructor and Description |
|---|
ActivityStatsService(ActivityFocusDAO focusStorage,
org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.container.xml.InitParams params)
Instantiates a new smart activity service.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
agregateFocus(ActivityFocusEntity tracked,
ActivityFocusEntity add)
Aggregate the adding focus into the tracked one.
|
protected String |
focusKey(ActivityFocusEntity focus)
Focus key.
|
boolean |
isTrackersEnabled()
Checks if is trackers enabled.
|
protected void |
saveActivityFocus(ActivityFocusEntity focus)
Save activity focus.
|
protected void |
saveCacheInContainerContext(org.exoplatform.container.ExoContainer exoContainer,
boolean readyOnly)
Save cached trackers in the container context.
|
protected void |
saveTrackerCache(boolean readyOnly)
Save tracker cache.
|
void |
saveTrackers()
Save all cached trackers to database.
|
void |
start() |
void |
stop() |
void |
submitActivityFocus(ActivityFocusEntity focus)
Submit activity focus.
|
protected Long |
sum(Long existing,
Long add)
Sum.
|
public static final String TRACKER_CACHE_NAME
public static final int TRACKER_CACHE_PERIOD
public ActivityStatsService(ActivityFocusDAO focusStorage, org.exoplatform.services.cache.CacheService cacheService, org.exoplatform.container.xml.InitParams params)
focusStorage - the focus storagecacheService - the cache serviceparams - the paramspublic void submitActivityFocus(ActivityFocusEntity focus) throws ActivityStatsException
focus - the focusActivityStatsException - the smart activity exceptionpublic void saveTrackers()
ActivityFocusTracker.BATCH_LIFETIME).public boolean isTrackersEnabled()
public void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startableprotected String focusKey(ActivityFocusEntity focus)
focus - the focusprotected void agregateFocus(ActivityFocusEntity tracked, ActivityFocusEntity add)
tracked - the tracked focus entityadd - the adding focus entityprotected Long sum(Long existing, Long add)
existing - the existingadd - the addprotected void saveActivityFocus(ActivityFocusEntity focus) throws ActivityStatsException
focus - the focusActivityStatsException - the smart activity exceptionprotected void saveTrackerCache(boolean readyOnly)
throws Exception
readyOnly - the ready onlyException - the exceptionprotected void saveCacheInContainerContext(org.exoplatform.container.ExoContainer exoContainer,
boolean readyOnly)
exoContainer - the exo containerreadyOnly - if true then will save ready only trackersCopyright © 2003–2020 eXo Platform SAS. All rights reserved.