Package org.ametys.web.cache.pageelement
Class AbstractSimplePageElementCachePolicy
java.lang.Object
org.ametys.web.cache.pageelement.AbstractSimplePageElementCachePolicy
- All Implemented Interfaces:
PageElementCachePolicy
- Direct Known Subclasses:
AbstractACLPageElementCachePolicy
,CalendarServiceCachePolicy
,ContentZoneItemCachePolicy
,ExplorerResourcesServiceCachePolicy
,FilteredContentsServiceCachePolicy
,GlossaryContentsCachePolicy
,GlossaryServiceCachePolicy
,InsertProgramServiceCachePolicy
,LinkDirectoryServiceCachePolicy
,NewsletterArchiveServiceCachePolicy
,SearchPagesServiceCachePolicy
,SearchServiceCachePolicy
,SurveyDisplayServiceCachePolicy
,TagCloudServiceCachePolicy
,WordCloudServiceCachePolicy
public abstract class AbstractSimplePageElementCachePolicy
extends Object
implements PageElementCachePolicy
Base class for simple
Implementations should provide a list of event ids for which the cache should be removed. Be aware that for all other events, the returned value will be KEEP.
PageElementCachePolicy
only based on event ids.Implementations should provide a list of event ids for which the cache should be removed. Be aware that for all other events, the returned value will be KEEP.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.web.cache.pageelement.PageElementCachePolicy
PageElementCachePolicy.PolicyResult
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_getRemovingCacheEventIds
(String workspace) Returns all event ids for which the cache should be removed.protected boolean
Checks if the event is supported.shouldClearCache
(String workspace, Site site, String pageElementType, String elementId, Event event) Never called because the first-level method never returns NEED_INFORMATION.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.web.cache.pageelement.PageElementCachePolicy
getPageElementTypes
-
Constructor Details
-
AbstractSimplePageElementCachePolicy
public AbstractSimplePageElementCachePolicy()
-
-
Method Details
-
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.
-
_supports
Checks if the event is supported.- Parameters:
event
- The eventworkspace
- The JCR workspace.- Returns:
- If true, the cache should be clear
-
_getRemovingCacheEventIds
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.
-
shouldClearCache
public final PageElementCachePolicy.PolicyResult shouldClearCache(String workspace, Site site, String pageElementType, String elementId, Event event) Never called because the first-level method never returns NEED_INFORMATION.- 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.
-