Class AbstractHttpCacheHandlingRule
java.lang.Object
com.adobe.acs.commons.httpcache.rule.AbstractHttpCacheHandlingRule
- All Implemented Interfaces:
HttpCacheHandlingRule
Utility abstract implementation providing default behavior for any cache handling rules.
All methods in this
return true indicating that this does nothing other than instructing the HttpCacheEngine to move on with next rule. Any custom implementation could
leverage this to facilitate overriding only the methods the custom rule is intended for.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanonCacheDeliver(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, HttpCacheConfig cacheConfig, CacheContent cacheContent) Hook to supply custom behavior onHttpCacheEnginedelivering cache content after being read from cache store.booleanonCacheInvalidate(String path) Hook to supply custom behavior onHttpCacheEngineinvalidating cache for the changes in the given JCR repository path.booleanonRequestReceive(org.apache.sling.api.SlingHttpServletRequest request) Hook to supply custom behavior onHttpCacheEnginereceiving the request.booleanonResponseCache(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, HttpCacheConfig cacheConfig, CacheContent cacheContent) Hook to supply custom behavior onHttpCacheEngineabout to cache a response.
-
Constructor Details
-
AbstractHttpCacheHandlingRule
public AbstractHttpCacheHandlingRule()
-
-
Method Details
-
onRequestReceive
public boolean onRequestReceive(org.apache.sling.api.SlingHttpServletRequest request) Description copied from interface:HttpCacheHandlingRuleHook to supply custom behavior onHttpCacheEnginereceiving the request.- Specified by:
onRequestReceivein interfaceHttpCacheHandlingRule- Returns:
- True represents success and cache handling rules will be continued. False represents failure with cache handling rules being stopped and fallback action will be taken.
-
onResponseCache
public boolean onResponseCache(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, HttpCacheConfig cacheConfig, CacheContent cacheContent) Description copied from interface:HttpCacheHandlingRuleHook to supply custom behavior onHttpCacheEngineabout to cache a response.- Specified by:
onResponseCachein interfaceHttpCacheHandlingRulecacheContent- Object carring data to be cached.- Returns:
- True represents success and cache handling rules will be continued. False represents failure with cache handling rules being stopped and fallback action will be taken.
-
onCacheDeliver
public boolean onCacheDeliver(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, HttpCacheConfig cacheConfig, CacheContent cacheContent) Description copied from interface:HttpCacheHandlingRuleHook to supply custom behavior onHttpCacheEnginedelivering cache content after being read from cache store.- Specified by:
onCacheDeliverin interfaceHttpCacheHandlingRulecacheContent- Object carrying data to be delivered.- Returns:
- True represents success and cache handling rules will be continued. False represents failure with cache handling rules being stopped and fallback action will be taken.
-
onCacheInvalidate
Description copied from interface:HttpCacheHandlingRuleHook to supply custom behavior onHttpCacheEngineinvalidating cache for the changes in the given JCR repository path.- Specified by:
onCacheInvalidatein interfaceHttpCacheHandlingRule- Parameters:
path- JCR repository path- Returns:
- True represents success and cache handling rules will be continued. False represents failure with cache handling rules being stopped and fallback action will be taken.
-