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 java.lang.Object implements org.springframework.web.servlet.AsyncHandlerInterceptorHandler interceptor that adds a Cache-Control header to the response based on @link{CacheControl} annotation.
-
-
Constructor Summary
Constructors Constructor Description CacheControlHandlerInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcreateCacheControlHeaderField(CacheControl cacheAnnotation)protected CacheControlgetCacheControlAnnotation(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)protected booleanisEligibleForCacheControl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)Indicates whether the given request and response are eligible for Cache-Control generation.booleanpreHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
preHandle
public final boolean preHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler) throws java.lang.Exception- Specified by:
preHandlein interfaceorg.springframework.web.servlet.HandlerInterceptor- Throws:
java.lang.Exception
-
isEligibleForCacheControl
protected boolean isEligibleForCacheControl(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.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, java.lang.Object handler)
-
createCacheControlHeaderField
protected java.lang.String createCacheControlHeaderField(CacheControl cacheAnnotation)
-
-