Class InvalidateCacheOnSurveyReInitializedObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.cache.AbstractCacheObserver
-
- org.ametys.web.cache.AbstractSiteCacheObserver
-
- org.ametys.plugins.survey.observation.InvalidateCacheOnSurveyReInitializedObserver
-
- All Implemented Interfaces:
Observer
,LogEnabled
,Serviceable
public class InvalidateCacheOnSurveyReInitializedObserver extends AbstractSiteCacheObserver
Observer
for observing survey re-initialization in order to invalidate cache on front-office.
-
-
Field Summary
Fields Modifier and Type Field Description protected SurveyDAO
_surveyDAO
The survey DAO-
Fields inherited from class org.ametys.web.cache.AbstractSiteCacheObserver
_cachePolicy, _repository
-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description InvalidateCacheOnSurveyReInitializedObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Site
_getSite(Event event)
Retrieves the site needed for accessing the front-office.protected void
_internalObserve(Event event, Site site, Session liveSession)
Observes the event with access to the target site and live workspace.void
service(ServiceManager manager)
boolean
supports(Event event)
Checks if the event is supported.-
Methods inherited from class org.ametys.web.cache.AbstractSiteCacheObserver
observe
-
Methods inherited from class org.ametys.web.cache.AbstractCacheObserver
getPriority
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_surveyDAO
protected SurveyDAO _surveyDAO
The survey DAO
-
-
Constructor Detail
-
InvalidateCacheOnSurveyReInitializedObserver
public InvalidateCacheOnSurveyReInitializedObserver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractSiteCacheObserver
- Throws:
ServiceException
-
supports
public boolean supports(Event event)
Description copied from interface:Observer
Checks if the event is supported. If true, the observe(Event) method will be called.- Parameters:
event
- the event.- Returns:
true
for observing this event,false
otherwise.
-
_internalObserve
protected void _internalObserve(Event event, Site site, Session liveSession) throws Exception
Description copied from class:AbstractSiteCacheObserver
Observes the event with access to the target site and live workspace.- Specified by:
_internalObserve
in classAbstractSiteCacheObserver
- Parameters:
event
- the event.site
- the site.liveSession
- the session to the workspace live.- Throws:
Exception
- if an error occurs.
-
_getSite
protected Site _getSite(Event event)
Description copied from class:AbstractSiteCacheObserver
Retrieves the site needed for accessing the front-office.- Specified by:
_getSite
in classAbstractSiteCacheObserver
- Parameters:
event
- the event.- Returns:
- the site or
null
if not found.
-
-