Class BlogVirtualPagesCachePolicy
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.blog.cachepolicy.BlogVirtualPagesCachePolicy
-
- All Implemented Interfaces:
PageElementCachePolicy
,LogEnabled
,Serviceable
- Direct Known Subclasses:
BlogVirtualPagesWithCommentsCachePolicy
public class BlogVirtualPagesCachePolicy extends AbstractLogEnabled implements Serviceable, PageElementCachePolicy
Cache policy for the sitemap, handling blog virtual pages linked with contents. Used for the Sitemap InputData as well as the Sitemap service, even if the page element cache is not the same.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.web.cache.pageelement.PageElementCachePolicy
PageElementCachePolicy.PolicyResult
-
-
Field Summary
Fields Modifier and Type Field Description protected BlogPageHandler
_blogPageHandler
The blog page handler.private static Set<String>
_TYPES
-
Constructor Summary
Constructors Constructor Description BlogVirtualPagesCachePolicy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>
_getRemovingCacheEventIds(String workspace)
Returns all event ids for which the cache should be removed.Set<String>
getPageElementTypes()
Returns the types of the associated page elements.void
service(ServiceManager manager)
PageElementCachePolicy.PolicyResult
shouldClearCache(String workspace, Site site, String pageElementType, String elementId, Event event)
Second pass of event processing, at the Page level.
This method is only called if the first pass resulted with NEED_MORE_INFORMATION.PageElementCachePolicy.PolicyResult
shouldClearCache(String workspace, Site site, String pageElementType, Event event)
First pass of event processing, at the type level.
Returning NEED_MORE_INFORMATION eventually leads to the second pass, which is more precise, and also depends on a particular element, but is more costly to compute.
Returning null means that this policy declares itself as not concerned by the current event.-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_blogPageHandler
protected BlogPageHandler _blogPageHandler
The blog page handler.
-
-
Constructor Detail
-
BlogVirtualPagesCachePolicy
public BlogVirtualPagesCachePolicy()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPageElementTypes
public Set<String> getPageElementTypes()
Description copied from interface:PageElementCachePolicy
Returns the types of the associated page elements.- Specified by:
getPageElementTypes
in interfacePageElementCachePolicy
- Returns:
- the types of the associated page elements.
-
shouldClearCache
public final PageElementCachePolicy.PolicyResult shouldClearCache(String workspace, Site site, String pageElementType, Event event)
Description copied from interface:PageElementCachePolicy
First pass of event processing, at the type level.
Returning NEED_MORE_INFORMATION eventually leads to the second pass, which is more precise, and also depends on a particular element, but is more costly to compute.
Returning null means that this policy declares itself as not concerned by the current event.- Specified by:
shouldClearCache
in interfacePageElementCachePolicy
- Parameters:
workspace
- the current JCR workspace.site
- the current site.pageElementType
- the page element type.event
- the current event.- Returns:
- the policy result or null if this policy declares itself as not concerned.
-
shouldClearCache
public final PageElementCachePolicy.PolicyResult shouldClearCache(String workspace, Site site, String pageElementType, String elementId, Event event)
Description copied from interface:PageElementCachePolicy
Second pass of event processing, at the Page level.
This method is only called if the first pass resulted with NEED_MORE_INFORMATION. If this method also returns NEED_MORE_INFORMATION, it will be interpreted as REMOVE.- Specified by:
shouldClearCache
in interfacePageElementCachePolicy
- Parameters:
workspace
- the current JCR workspace.site
- the current site.pageElementType
- the page element type.elementId
- the current element id.event
- the current event.- Returns:
- the policy result.
-
_getRemovingCacheEventIds
protected List<String> _getRemovingCacheEventIds(String workspace)
Returns all event ids for which the cache should be removed.- Parameters:
workspace
- the current JCR workspace.- Returns:
- all event ids for which the cache should be removed.
-
-