Class UserContentCacheObserver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.userdirectory.observation.AbstractContentObserver
-
- org.ametys.plugins.userdirectory.observation.UserContentCacheObserver
-
- All Implemented Interfaces:
Observer
,LogEnabled
,Contextualizable
,Serviceable
public class UserContentCacheObserver extends AbstractContentObserver
Observer
when a user content is modified, deleted or validated. Clear the cache of virtual user pages and reindex all virtual pages on modification.
-
-
Field Summary
Fields Modifier and Type Field Description protected SynchronizableContentsCollectionDAO
_synchronizableContentsCollectionDAO
The DAO for synchronizable contents collectionsprotected UserDirectoryPageHandler
_userPageHandler
The user directory page handler.-
Fields inherited from class org.ametys.plugins.userdirectory.observation.AbstractContentObserver
_cocoonContext, _contentTypeHelper, _context, _organisationChartPageResolver, _resolver, _userDirectoryPageResolver, _zoneItemCache
-
Fields inherited from interface org.ametys.core.observation.Observer
MAX_PRIORITY, MIN_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description UserContentCacheObserver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_internalObserve(Event event, Page rootUsersPage, Content userContent)
Do the actual work.int
getPriority(Event event)
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.void
service(ServiceManager manager)
boolean
supports(Event event)
Checks if the event is supported.-
Methods inherited from class org.ametys.plugins.userdirectory.observation.AbstractContentObserver
_getOrgUnitRootPages, _getTarget, _getUserRootPages, _isOrgUnitContent, _isUserContent, _removeZoneItemCache, contextualize, observe
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_userPageHandler
protected UserDirectoryPageHandler _userPageHandler
The user directory page handler.
-
_synchronizableContentsCollectionDAO
protected SynchronizableContentsCollectionDAO _synchronizableContentsCollectionDAO
The DAO for synchronizable contents collections
-
-
Constructor Detail
-
UserContentCacheObserver
public UserContentCacheObserver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractContentObserver
- 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.
-
getPriority
public int getPriority(Event event)
Description copied from interface:Observer
Retrieves the priority to observe this event.
This can be used to process a supported event before others observers.- Parameters:
event
- the event.- Returns:
- the priority where 0 the max priority and Integer.MAX_VALUE the min priority.
-
_internalObserve
protected void _internalObserve(Event event, Page rootUsersPage, Content userContent)
Description copied from class:AbstractContentObserver
Do the actual work.- Specified by:
_internalObserve
in classAbstractContentObserver
- Parameters:
event
- the observation event.rootUsersPage
- the page holding the virtual user pagesuserContent
- a list containing all impacted user contents.
-
-