Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.web.common.requestcontroller.filter
Class NuxeoRequestControllerFilter

java.lang.Object
  extended by org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoRequestControllerFilter
All Implemented Interfaces:
javax.servlet.Filter

public class NuxeoRequestControllerFilter
extends java.lang.Object
implements javax.servlet.Filter

Filter to handle Transactions and Requests synchronization. This filter is useful when accessing web resources that are not protected by Seam Filter. This is the case for specific Servlets, WebEngine, XML-RPC connector ...

Author:
tiry

Nested Class Summary
static class NuxeoRequestControllerFilter.CommittingServletResponseWrapper
          Response Wrapper that commits the transaction as soon as something is written to the output.
 
Field Summary
static java.text.DateFormat HTTP_EXPIRES_DATE_FORMAT
           
 
Constructor Summary
NuxeoRequestControllerFilter()
           
 
Method Summary
static void addCacheHeader(javax.servlet.http.HttpServletResponse httpResponse, java.lang.Boolean isPrivate, java.lang.String cacheTime)
          Set cache parameters to httpResponse.
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
           
static java.lang.String doFormatLogMessage(javax.servlet.http.HttpServletRequest request, java.lang.String info)
           
 void init(javax.servlet.FilterConfig filterConfig)
           
static boolean simpleReleaseSyncOnSession(javax.servlet.http.HttpServletRequest request)
          Releases the Lock if present in the HttpSession.
static boolean simpleSyncOnSession(javax.servlet.http.HttpServletRequest request)
          Synchronizes the HttpSession.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_EXPIRES_DATE_FORMAT

public static final java.text.DateFormat HTTP_EXPIRES_DATE_FORMAT
Constructor Detail

NuxeoRequestControllerFilter

public NuxeoRequestControllerFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

doFormatLogMessage

public static java.lang.String doFormatLogMessage(javax.servlet.http.HttpServletRequest request,
                                                  java.lang.String info)

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.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 the Lock if present in the HttpSession.


addCacheHeader

public static void addCacheHeader(javax.servlet.http.HttpServletResponse httpResponse,
                                  java.lang.Boolean isPrivate,
                                  java.lang.String cacheTime)
Set cache parameters to httpResponse.


destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.