Class CacheControlHandlerInterceptor
java.lang.Object
de.hybris.platform.webservicescommons.interceptors.CacheControlHandlerInterceptor
- All Implemented Interfaces:
org.springframework.web.servlet.AsyncHandlerInterceptor,org.springframework.web.servlet.HandlerInterceptor
public class CacheControlHandlerInterceptor
extends Object
implements org.springframework.web.servlet.AsyncHandlerInterceptor
Handler interceptor that adds a Cache-Control header to the response based on @link{CacheControl} annotation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateCacheControlHeaderField(CacheControl cacheAnnotation) protected CacheControlgetCacheControlAnnotation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) protected booleanisEligibleForCacheControl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) Indicates whether the given request and response are eligible for Cache-Control generation.final booleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.web.servlet.AsyncHandlerInterceptor
afterConcurrentHandlingStartedMethods inherited from interface org.springframework.web.servlet.HandlerInterceptor
afterCompletion, postHandle
-
Constructor Details
-
CacheControlHandlerInterceptor
public CacheControlHandlerInterceptor()
-
-
Method Details
-
preHandle
public final boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) throws Exception - Specified by:
preHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor- Throws:
Exception
-
isEligibleForCacheControl
protected boolean isEligibleForCacheControl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) Indicates whether the given request and response are eligible for Cache-Control generation.- Parameters:
request- the HTTP requestresponse- the HTTP responsehandler- handler (orHandlerMethod)- Returns:
trueif eligible;falseotherwise
-
getCacheControlAnnotation
protected CacheControl getCacheControlAnnotation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler) -
createCacheControlHeaderField
-