de.neteye.actioncache
Interface CacheableAction

All Known Implementing Classes:
AbstractCacheableAction

public interface CacheableAction

Actions that want their output to be cached must implement this interface.

Version:
$Revision: 1.2 $
Author:
Felix Gnass
See Also:
AbstractCacheableAction

Method Summary
 java.lang.String getCacheKey(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm formInstance, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implementing classes must return a key that uniquely identifies the corresponding cache item.
 long getLastModified(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm formInstance, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ActionCacheItem cacheItem)
          Implementing classes must return the time when the underlying data was last modified.
 

Method Detail

getCacheKey

public java.lang.String getCacheKey(org.apache.struts.action.ActionMapping mapping,
                                    org.apache.struts.action.ActionForm formInstance,
                                    javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response)
Implementing classes must return a key that uniquely identifies the corresponding cache item. All headers, parameters, attributes, etc. that influence the actions output must be included within this key.


getLastModified

public long getLastModified(org.apache.struts.action.ActionMapping mapping,
                            org.apache.struts.action.ActionForm formInstance,
                            javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response,
                            ActionCacheItem cacheItem)
                     throws java.io.IOException,
                            javax.servlet.ServletException
Implementing classes must return the time when the underlying data was last modified. This can be a field from a database or the mtime of a file. If the result is made up of multiple data records the time of the latest modification must be returned.

java.io.IOException
javax.servlet.ServletException