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
AbstractObserverfor invalidate site data.
-
-
Field Summary
Fields Modifier and Type Field Description protected CacheInvalidationPolicy_cachePolicyCache invalidation policyprotected Repository_repositoryJCR 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.voidobserve(Event event, Map<String,Object> transientVars)Observes an event.voidservice(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:
servicein interfaceServiceable- Throws:
ServiceException
-
observe
public void observe(Event event, Map<String,Object> transientVars) throws Exception
Description copied from interface:ObserverObserves an event.- Specified by:
observein 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
nullif 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.
-
-