Nuxeo ECM Projects 5.4.3-SNAPSHOT

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:
Filter

public class NuxeoRequestControllerFilter
extends Object
implements 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 DateFormat HTTP_EXPIRES_DATE_FORMAT
           
 
Constructor Summary
NuxeoRequestControllerFilter()
           
 
Method Summary
static void addCacheHeader(HttpServletResponse httpResponse, Boolean isPrivate, String cacheTime)
          Set cache parameters to httpResponse.
 void destroy()
           
 void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
           
static String doFormatLogMessage(HttpServletRequest request, String info)
           
 void init(FilterConfig filterConfig)
           
static boolean simpleReleaseSyncOnSession(HttpServletRequest request)
          Releases the Lock if present in the HttpSession.
static boolean simpleSyncOnSession(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 DateFormat HTTP_EXPIRES_DATE_FORMAT
Constructor Detail

NuxeoRequestControllerFilter

public NuxeoRequestControllerFilter()
Method Detail

init

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

doFormatLogMessage

public static String doFormatLogMessage(HttpServletRequest request,
                                        String info)

doFilter

public void doFilter(ServletRequest request,
                     ServletResponse response,
                     FilterChain chain)
              throws IOException,
                     ServletException
Specified by:
doFilter in interface Filter
Throws:
IOException
ServletException

simpleSyncOnSession

public static boolean simpleSyncOnSession(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(HttpServletRequest request)
Releases the Lock if present in the HttpSession.


addCacheHeader

public static void addCacheHeader(HttpServletResponse httpResponse,
                                  Boolean isPrivate,
                                  String cacheTime)
Set cache parameters to httpResponse.


destroy

public void destroy()
Specified by:
destroy in interface Filter

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.