Save This Page
Home » oscache-2.4.1-full » com.opensymphony.oscache » web » filter » [javadoc | source]
com.opensymphony.oscache.web.filter
public class: CacheHttpServletResponseWrapper [javadoc | source]
java.lang.Object
   javax.servlet.ServletResponseWrapper
      javax.servlet.http.HttpServletResponseWrapper
         com.opensymphony.oscache.web.filter.CacheHttpServletResponseWrapper

All Implemented Interfaces:
    HttpServletResponse, ServletResponse

CacheServletResponse is a serialized representation of a response
Constructor:
 public CacheHttpServletResponseWrapper(HttpServletResponse response) 
    Constructor
    Parameters:
    response - The servlet response
 public CacheHttpServletResponseWrapper(HttpServletResponse response,
    boolean fragment,
    long time,
    long lastModified,
    long expires,
    long cacheControl) 
    Constructor
    Parameters:
    response - The servlet response
    fragment - true if the repsonse indicates that it is a fragement of a page
    time - the refresh time in millis
    lastModified - defines if last modified header will be send, @see CacheFilter
    expires - defines if expires header will be send, @see CacheFilter
    cacheControl - defines if cache control header will be send, @see CacheFilter
Method from com.opensymphony.oscache.web.filter.CacheHttpServletResponseWrapper Summary:
addDateHeader,   addHeader,   flushBuffer,   getContent,   getOutputStream,   getStatus,   getWriter,   isCommitted,   reset,   resetBuffer,   sendError,   sendError,   sendRedirect,   setContentType,   setDateHeader,   setHeader,   setIntHeader,   setLocale,   setStatus,   setStatus
Methods from javax.servlet.http.HttpServletResponseWrapper:
addCookie,   addDateHeader,   addHeader,   addIntHeader,   containsHeader,   encodeRedirectURL,   encodeRedirectUrl,   encodeURL,   encodeUrl,   sendError,   sendError,   sendRedirect,   setDateHeader,   setHeader,   setIntHeader,   setStatus,   setStatus
Methods from javax.servlet.ServletResponseWrapper:
flushBuffer,   getBufferSize,   getCharacterEncoding,   getContentType,   getLocale,   getOutputStream,   getResponse,   getWriter,   isCommitted,   reset,   resetBuffer,   setBufferSize,   setCharacterEncoding,   setContentLength,   setContentType,   setLocale,   setResponse
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.opensymphony.oscache.web.filter.CacheHttpServletResponseWrapper Detail:
 public  void addDateHeader(String name,
    long value) 
    Add the date of a header
 public  void addHeader(String name,
    String value) 
    Add a header field
 public  void flushBuffer() throws IOException 
 public ResponseContent getContent() 
    Get a response content
 public ServletOutputStream getOutputStream() throws IOException 
    Get an output stream
 public int getStatus() 
    Retrieves the captured HttpResponse status.
 public PrintWriter getWriter() throws IOException 
    Get a print writer
 public boolean isCommitted() 
    Returns a boolean indicating if the response has been committed. A commited response has already had its status code and headers written.
 public  void reset() 
    Clears any data that exists in the buffer as well as the status code and headers. If the response has been committed, this method throws an IllegalStateException.
 public  void resetBuffer() 
    Clears the content of the underlying buffer in the response without clearing headers or status code. If the response has been committed, this method throws an IllegalStateException.
 public  void sendError(int status) throws IOException 
    We override this so we can catch the response status. Only responses with a status of 200 (SC_OK) will be cached.
 public  void sendError(int status,
    String string) throws IOException 
    We override this so we can catch the response status. Only responses with a status of 200 (SC_OK) will be cached.
 public  void sendRedirect(String location) throws IOException 
    We override this so we can catch the response status. Only responses with a status of 200 (SC_OK) will be cached.
 public  void setContentType(String value) 
    Set the content type
 public  void setDateHeader(String name,
    long value) 
    Set the date of a header
 public  void setHeader(String name,
    String value) 
    Set a header field
 public  void setIntHeader(String name,
    int value) 
    Set the int value of the header
 public  void setLocale(Locale value) 
    Set the locale
 public  void setStatus(int status) 
    We override this so we can catch the response status. Only responses with a status of 200 (SC_OK) will be cached.
 public  void setStatus(int status,
    String string) 
    We override this so we can catch the response status. Only responses with a status of 200 (SC_OK) will be cached.