Class NuxeoRequestControllerFilter
- java.lang.Object
-
- org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoRequestControllerFilter
-
- All Implemented Interfaces:
javax.servlet.Filter
public class NuxeoRequestControllerFilter extends Object implements javax.servlet.Filter
Filter to handle transactions, response buffering, and request synchronization.- Author:
- tiry
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatter
HTTP_EXPIRES_DATE_FORMAT
protected static int
LOCK_TIMEOUT_S
protected static String
SESSION_LOCK_KEY
protected static String
SYNCED_REQUEST_FLAG
-
Constructor Summary
Constructors Constructor Description NuxeoRequestControllerFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addCacheHeaders(javax.servlet.http.HttpServletResponse response, RequestFilterConfig config)
protected void
addConfiguredHeaders(javax.servlet.http.HttpServletResponse response)
protected void
addHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RequestFilterConfig config)
void
destroy()
void
doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain chain)
static String
doFormatLogMessage(javax.servlet.http.HttpServletRequest request, String info)
void
init(javax.servlet.FilterConfig filterConfig)
static boolean
simpleReleaseSyncOnSession(javax.servlet.http.HttpServletRequest request)
Releases theLock
if present in the HttpSession.static boolean
simpleSyncOnSession(javax.servlet.http.HttpServletRequest request)
Synchronizes the HttpSession.
-
-
-
Field Detail
-
SESSION_LOCK_KEY
protected static final String SESSION_LOCK_KEY
- See Also:
- Constant Field Values
-
SYNCED_REQUEST_FLAG
protected static final String SYNCED_REQUEST_FLAG
- See Also:
- Constant Field Values
-
LOCK_TIMEOUT_S
protected static final int LOCK_TIMEOUT_S
- See Also:
- Constant Field Values
-
HTTP_EXPIRES_DATE_FORMAT
public static final DateTimeFormatter HTTP_EXPIRES_DATE_FORMAT
-
-
Method Detail
-
init
public void init(javax.servlet.FilterConfig filterConfig)
- Specified by:
init
in interfacejavax.servlet.Filter
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.servlet.Filter
-
doFormatLogMessage
public static String doFormatLogMessage(javax.servlet.http.HttpServletRequest request, String info)
-
doFilter
public void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
- Specified by:
doFilter
in interfacejavax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
-
simpleSyncOnSession
public static boolean simpleSyncOnSession(javax.servlet.http.HttpServletRequest request)
Synchronizes the HttpSession.Uses a
Lock
object in the HttpSession and locks it. If HttpSession is not created, exits without locking anything.
-
simpleReleaseSyncOnSession
public static boolean simpleReleaseSyncOnSession(javax.servlet.http.HttpServletRequest request)
Releases theLock
if present in the HttpSession.
-
addHeaders
protected void addHeaders(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, RequestFilterConfig config)
-
addConfiguredHeaders
protected void addConfiguredHeaders(javax.servlet.http.HttpServletResponse response)
-
addCacheHeaders
protected void addCacheHeaders(javax.servlet.http.HttpServletResponse response, RequestFilterConfig config)
-
-