public abstract class ContentCachedEntry extends Object implements CachedEntry, Serializable
Constructor and Description |
---|
ContentCachedEntry(String contentType,
String characterEncoding,
int statusCode,
org.apache.commons.collections.MultiMap headers,
long modificationDate,
String originalUrl,
int timeToLiveInSeconds) |
Modifier and Type | Method and Description |
---|---|
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) |
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.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 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()
Copyright © 2015 Magnolia International Ltd.. All rights reserved.