public class SmartActivityService extends Object implements org.picocontainer.Startable
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
enableTrackers
The enable trackers.
|
protected Timer |
focusSaver
The focus saver.
|
protected ActivityFocusDAO |
focusStorage
The focus storage.
|
static String |
TRACKER_CACHE_NAME
The Constant TRACKER_CACHE_NAME.
|
static int |
TRACKER_CACHE_PERIOD
The Constant TRACKER_CACHE_PERIOD.
|
protected org.exoplatform.services.cache.ExoCache<String,ActivityFocusEntity> |
trackerCache
Cache of tracking activities.
|
| Constructor and Description |
|---|
SmartActivityService(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 existing,
ActivityFocusEntity add)
Agregate focus.
|
protected String |
focusKey(ActivityFocusEntity focus)
Focus key.
|
boolean |
isTrackersEnabled()
Checks if is trackers enabled.
|
protected void |
saveActivityFocus(ActivityFocusEntity focus)
Save activity focus.
|
protected void |
saveReadyCacheInContainerContext(String containerName,
boolean readyOnly)
Save ready cache in container context.
|
protected void |
saveTrackerCache(boolean readyOnly)
Save tracker cache.
|
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
protected final org.exoplatform.services.cache.ExoCache<String,ActivityFocusEntity> trackerCache
protected final ActivityFocusDAO focusStorage
protected final Timer focusSaver
protected boolean enableTrackers
public SmartActivityService(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 SmartActivityException
focus - the focusSmartActivityException - the smart activity exceptionpublic 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 existing, ActivityFocusEntity add)
existing - the existingadd - the addprotected Long sum(Long existing, Long add)
existing - the existingadd - the addprotected void saveActivityFocus(ActivityFocusEntity focus) throws SmartActivityException
focus - the focusSmartActivityException - the smart activity exceptionprotected void saveTrackerCache(boolean readyOnly)
throws Exception
readyOnly - the ready onlyException - the exceptionprotected void saveReadyCacheInContainerContext(String containerName, boolean readyOnly)
containerName - the container namereadyOnly - the ready onlyCopyright © 2003–2019 eXo Platform SAS. All rights reserved.