|
||||||||||
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(java.lang.String contentType,
java.lang.String characterEncoding,
int statusCode,
org.apache.commons.collections.MultiMap headers,
long modificationDate,
java.lang.String originalUrl)
|
Method Summary | |
---|---|
protected void |
addHeaders(boolean acceptsGzipEncoding,
javax.servlet.http.HttpServletResponse response)
Sets headers in the response object. |
protected abstract boolean |
canServeGzipContent()
|
java.lang.String |
getCharacterEncoding()
|
java.lang.String |
getContentType()
|
org.apache.commons.collections.MultiMap |
getHeaders()
|
long |
getLastModificationTime()
Produce last modification date of the cache entry. |
java.lang.String |
getOriginalURL()
Entry might be required to produce url used to create it in the first place. |
int |
getStatusCode()
|
protected boolean |
isAcceptsGzip(javax.servlet.http.HttpServletRequest request)
|
void |
replay(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain chain)
|
java.lang.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(java.lang.String contentType, java.lang.String characterEncoding, int statusCode, org.apache.commons.collections.MultiMap headers, long modificationDate, java.lang.String originalUrl) throws java.io.IOException
out
- Cached content.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.shouldCompress
- Flag marking this content as desirable to be sent in compressed form (should the client support such compression). Setting this to true means cache entry will contain both, compressed and flat version of the content. Compression is applied here only if content is not gzipped already.
java.io.IOException
- when failing to compress the content.Method Detail |
---|
public java.lang.String getOriginalURL()
CachedEntry
getOriginalURL
in interface CachedEntry
public java.lang.String getContentType()
public java.lang.String getCharacterEncoding()
public int getStatusCode()
public org.apache.commons.collections.MultiMap getHeaders()
public long getLastModificationTime()
CachedEntry
getLastModificationTime
in interface CachedEntry
public java.lang.String toString()
toString
in class java.lang.Object
public void replay(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.FilterChain chain) throws java.io.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)
java.io.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 java.io.IOException, javax.servlet.ServletException
java.io.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 |