Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.util
Class JiveCacheFilter

java.lang.Object
  extended by com.opensymphony.oscache.web.filter.CacheFilter
      extended by com.jivesoftware.base.util.JiveCacheFilter
All Implemented Interfaces:
JivePropertyListener, com.opensymphony.oscache.web.filter.ICacheGroupsProvider, com.opensymphony.oscache.web.filter.ICacheKeyProvider, javax.servlet.Filter

public class JiveCacheFilter
extends com.opensymphony.oscache.web.filter.CacheFilter
implements JivePropertyListener

A filter which allows page level caching for anonymous users. Any uri's to which this filter is mapped will be served from cache. Since we can't do page level caching for logged in users (due to the personalized views they see), they will bypass the cache entirely, and their requests will actually result in calls through to the action and underlying api. This filter can be configured with the Jive Properties

By default the cache will contain at most 1000 entries which will live for 30 seconds. This filter users the underlying oscache mechanism and assumes an application scope cache. Use of session scope caches is not supported.


Field Summary
 
Fields inherited from class com.opensymphony.oscache.web.filter.CacheFilter
EXPIRES_OFF, EXPIRES_ON, EXPIRES_TIME, FRAGMENT_AUTODETECT, FRAGMENT_NO, FRAGMENT_YES, HEADER_ACCEPT_ENCODING, HEADER_CACHE_CONTROL, HEADER_CONTENT_ENCODING, HEADER_CONTENT_TYPE, HEADER_EXPIRES, HEADER_IF_MODIFIED_SINCE, HEADER_LAST_MODIFIED, LAST_MODIFIED_INITIAL, LAST_MODIFIED_OFF, LAST_MODIFIED_ON, MAX_AGE_NO_INIT, MAX_AGE_TIME, NOCACHE_OFF, NOCACHE_SESSION_ID_IN_URL
 
Constructor Summary
JiveCacheFilter()
           
 
Method Summary
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          Tests for requests by anonymous users and passes them up to the superclass to be served from the page cache.
 void init(javax.servlet.FilterConfig filterConfig)
           
 void jivePropertyAdded(JivePropertyEvent jivePropertyEvent)
          Fired when a jive property is added
 void jivePropertyModified(JivePropertyEvent jivePropertyEvent)
          Fired when a jive property is modified
 void jivePropertyRemoved(JivePropertyEvent jivePropertyEvent)
          Fired when a jive property is removed
 
Methods inherited from class com.opensymphony.oscache.web.filter.CacheFilter
acceptsGZipEncoding, createCacheGroups, createCacheKey, destroy, getCacheControlMaxAge, getCacheGroupsProvider, getCacheKeyProvider, getCacheScope, getCron, getDisableCacheOnMethods, getExpires, getExpiresRefreshPolicy, getFragment, getLastModified, getNocache, getTime, isCacheable, isCacheable, isFilteredBefore, isFragment, setCacheControlMaxAge, setCacheGroupsProvider, setCacheKeyProvider, setCacheScope, setCron, setDisableCacheOnMethods, setExpires, setExpiresRefreshPolicy, setFragment, setLastModified, setNocache, setTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JiveCacheFilter

public JiveCacheFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
Specified by:
init in interface javax.servlet.Filter
Overrides:
init in class com.opensymphony.oscache.web.filter.CacheFilter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws javax.servlet.ServletException,
                     java.io.IOException
Tests for requests by anonymous users and passes them up to the superclass to be served from the page cache. Logged in users do not see cached pages.

Specified by:
doFilter in interface javax.servlet.Filter
Overrides:
doFilter in class com.opensymphony.oscache.web.filter.CacheFilter
Parameters:
request - The servlet request
response - The servlet response
chain - The filter chain
Throws:
javax.servlet.ServletException - IOException
java.io.IOException

jivePropertyAdded

public void jivePropertyAdded(JivePropertyEvent jivePropertyEvent)
Description copied from interface: JivePropertyListener
Fired when a jive property is added

Specified by:
jivePropertyAdded in interface JivePropertyListener
Parameters:
jivePropertyEvent - event fired

jivePropertyRemoved

public void jivePropertyRemoved(JivePropertyEvent jivePropertyEvent)
Description copied from interface: JivePropertyListener
Fired when a jive property is removed

Specified by:
jivePropertyRemoved in interface JivePropertyListener
Parameters:
jivePropertyEvent - event fired

jivePropertyModified

public void jivePropertyModified(JivePropertyEvent jivePropertyEvent)
Description copied from interface: JivePropertyListener
Fired when a jive property is modified

Specified by:
jivePropertyModified in interface JivePropertyListener
Parameters:
jivePropertyEvent - event fired

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.