|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.module.cache.filter.ContentCachedEntry
public abstract class ContentCachedEntry
Wraps a page response. It is assumed that the given content is gzipped if appropriate (i.e if the gzip filter is in the chain) and this class thus ungzips it to be able to serve both contents.
Constructor Summary | |
---|---|
ContentCachedEntry(String contentType,
String characterEncoding,
int statusCode,
org.apache.commons.collections.MultiMap headers,
long modificationDate,
String originalUrl,
int timeToLiveInSeconds)
|
Method Summary | |
---|---|
protected void |
addHeaders(boolean acceptsGzipEncoding,
javax.servlet.http.HttpServletResponse response)
Sets headers in the response object. |
protected abstract boolean |
canServeGzipContent()
|
String |
getCharacterEncoding()
|
String |
getContentType()
|
org.apache.commons.collections.MultiMap |
getHeaders()
|
long |
getLastModificationTime()
Produce last modification date of the cache entry. |
String |
getOriginalURL()
Entry might be required to produce url used to create it in the first place. |
int |
getStatusCode()
|
int |
getTimeToLiveInSeconds()
|
protected boolean |
isAcceptsGzip(javax.servlet.http.HttpServletRequest request)
|
void |
replay(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
|
String |
toString()
|
protected abstract void |
writeContent(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain,
boolean acceptsGzipEncoding)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContentCachedEntry(String contentType, String characterEncoding, int statusCode, org.apache.commons.collections.MultiMap headers, long modificationDate, String originalUrl, int timeToLiveInSeconds) throws IOException
contentType
- MIME type of the cached content.characterEncoding
- Character encoding of the cached content.statusCode
- HTTP response status code (E.g. 200 - OK);headers
- Additional HTTP headers to be sent when serving this cached content.modificationDate
- Content modification date to set in the response.timeToLiveInSeconds
-
IOException
- when failing to compress the content.Method Detail |
---|
public String getOriginalURL()
CachedEntry
getOriginalURL
in interface CachedEntry
public String getContentType()
public String getCharacterEncoding()
public int getStatusCode()
public org.apache.commons.collections.MultiMap getHeaders()
public long getLastModificationTime()
CachedEntry
getLastModificationTime
in interface CachedEntry
public int getTimeToLiveInSeconds()
getTimeToLiveInSeconds
in interface CachedEntry
public String toString()
toString
in class Object
public void replay(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
replay
in interface CachedEntry
chain
- a cache entry might want to delegate to the filter chain, see DelegatingBlobCachedEntry.replay(HttpServletRequest, HttpServletResponse, FilterChain)
IOException
javax.servlet.ServletException
protected abstract void writeContent(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain, boolean acceptsGzipEncoding) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
protected void addHeaders(boolean acceptsGzipEncoding, javax.servlet.http.HttpServletResponse response)
protected boolean isAcceptsGzip(javax.servlet.http.HttpServletRequest request)
protected abstract boolean canServeGzipContent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |