com.atlassian.core.filters.cache
Class AbstractCachingFilter

java.lang.Object
  extended by com.atlassian.core.filters.AbstractHttpFilter
      extended by com.atlassian.core.filters.cache.AbstractCachingFilter
All Implemented Interfaces:
javax.servlet.Filter

public abstract class AbstractCachingFilter
extends AbstractHttpFilter

Uses a list of caching strategies provided by the subclass, applying the first one which matches. After the caching headers are applied (or not, if no strategies match), the request is processed as normal.

Since:
4.0
See Also:
CachingStrategy

Constructor Summary
AbstractCachingFilter()
           
 
Method Summary
 void destroy()
          Default implementation which does nothing.
 void doFilter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain filterChain)
          Before processing the filter chain, iterates through the caching strategies returned by getCachingStrategies() and applies the first one that matches.
protected abstract  CachingStrategy[] getCachingStrategies()
          Subclasses should return an array of caching strategies to use.
 void init(javax.servlet.FilterConfig filterConfig)
          Default implementation which does nothing.
 
Methods inherited from class com.atlassian.core.filters.AbstractHttpFilter
doFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCachingFilter

public AbstractCachingFilter()
Method Detail

doFilter

public final void doFilter(javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response,
                           javax.servlet.FilterChain filterChain)
                    throws java.io.IOException,
                           javax.servlet.ServletException
Before processing the filter chain, iterates through the caching strategies returned by getCachingStrategies() and applies the first one that matches.

Specified by:
doFilter in class AbstractHttpFilter
Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
Filter.doFilter(ServletRequest, ServletResponse, FilterChain)

getCachingStrategies

protected abstract CachingStrategy[] getCachingStrategies()
Subclasses should return an array of caching strategies to use. The first one that matches will be applied by this filter.


init

public final void init(javax.servlet.FilterConfig filterConfig)
                throws javax.servlet.ServletException
Description copied from class: AbstractHttpFilter
Default implementation which does nothing.

Specified by:
init in interface javax.servlet.Filter
Overrides:
init in class AbstractHttpFilter
Throws:
javax.servlet.ServletException

destroy

public final void destroy()
Description copied from class: AbstractHttpFilter
Default implementation which does nothing.

Specified by:
destroy in interface javax.servlet.Filter
Overrides:
destroy in class AbstractHttpFilter


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.