Package org.ametys.web.cache
Class AbstractSiteCacheObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.cache.AbstractCacheObserver
-
- org.ametys.web.cache.AbstractSiteCacheObserver
-
- All Implemented Interfaces:
Observer
,LogEnabled
,Serviceable
- Direct Known Subclasses:
InvalidateCacheOnContentCommentedObserver
,InvalidateCacheOnContentDeletionObserver
,InvalidateCacheOnContentPageModificationObserver
,InvalidateCacheOnContentPageModificationObserver
,InvalidateCacheOnContentReactionObserver
,InvalidateCacheOnContentUnpublishObserver
,InvalidateCacheOnContentValidationOrTaggingObserver
,InvalidateCacheOnPageDeletionObserver
,InvalidateCacheOnPageMinorChangeObserver
,InvalidateCacheOnPageModificationObserver
,InvalidateCacheOnPageMoveObserver
,InvalidateCacheOnRobotsChangeObserver
,InvalidateCacheOnSurveyReInitializedObserver
,InvalidateCacheOnZoneItemAdditionObserver
,InvalidateCacheOnZoneItemDeletionObserver
public abstract class AbstractSiteCacheObserver extends AbstractCacheObserver implements Serviceable
AbstractObserver
for invalidate site data.
-
-
Field Summary
Fields Modifier and Type Field Description protected CacheInvalidationPolicy
_cachePolicy
Cache invalidation policyprotected Repository
_repository
JCR repository.-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description AbstractSiteCacheObserver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Site
_getSite(Event event)
Retrieves the site needed for accessing the front-office.protected abstract void
_internalObserve(Event event, Site site, Session liveSession)
Observes the event with access to the target site and live workspace.void
observe(Event event, Map<String,Object> transientVars)
Observes an event.void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.web.cache.AbstractCacheObserver
getPriority
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_repository
protected Repository _repository
JCR repository.
-
_cachePolicy
protected CacheInvalidationPolicy _cachePolicy
Cache invalidation policy
-
-
Constructor Detail
-
AbstractSiteCacheObserver
public AbstractSiteCacheObserver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
observe
public void observe(Event event, Map<String,Object> transientVars) throws Exception
Description copied from interface:Observer
Observes an event.- Specified by:
observe
in interfaceObserver
- Parameters:
event
- the event.transientVars
- transientVars passed from one Observer to another when processing a single Event. This may allow optimizations between observers.- Throws:
Exception
- if an error occurs. All exceptions will be logged but not propagated, as the observation mechanism should never fail.
-
_getSite
protected abstract Site _getSite(Event event)
Retrieves the site needed for accessing the front-office.- Parameters:
event
- the event.- Returns:
- the site or
null
if not found.
-
_internalObserve
protected abstract void _internalObserve(Event event, Site site, Session liveSession) throws Exception
Observes the event with access to the target site and live workspace.- Parameters:
event
- the event.site
- the site.liveSession
- the session to the workspace live.- Throws:
Exception
- if an error occurs.
-
-