public class CauchoResponseWrapper extends ResponseWrapper implements CauchoResponse
Modifier and Type | Field and Description |
---|---|
protected AbstractResponseStream |
_stream |
_response
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
Constructor and Description |
---|
CauchoResponseWrapper() |
CauchoResponseWrapper(HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
void |
addFooter(java.lang.String key,
java.lang.String value) |
void |
clearBuffer() |
void |
close()
complete the response.
|
void |
completeCache() |
boolean |
disableHeaders(boolean disable) |
void |
flushBuffer()
Flushes the buffer to the client.
|
java.lang.String |
getCharacterEncodingAssigned()
Assigned value of response encoding, not calculated/default.
|
FlushBuffer |
getFlushBuffer()
Gets the flush buffer
|
boolean |
getForbidForward()
Returns true if RequestDispatcher.forward() is disallowed on
this stream.
|
java.lang.String |
getHeader(java.lang.String key)
Retuns value of header with a given name
|
java.util.Collection<java.lang.String> |
getHeaderNames()
Returns an Iterable for header names set via
HttpServletResponse.setHeader(java.lang.String, java.lang.String) , HttpServletResponse.addHeader(java.lang.String, java.lang.String) , HttpServletResponse.setDateHeader(java.lang.String, long) , HttpServletResponse.addDateHeader(java.lang.String, long) , HttpServletResponse.setIntHeader(java.lang.String, int) , or HttpServletResponse.addIntHeader(java.lang.String, int) , respectively. |
java.util.Collection<java.lang.String> |
getHeaders(java.lang.String name)
Returns an Iterable for header values with a given name
|
ServletOutputStream |
getOutputStream()
Returns the servlet output stream.
|
int |
getRemaining() |
ServletResponse |
getResponse()
Gets the wrapped response
|
AbstractResponseStream |
getResponseStream()
Gets the response stream.
|
int |
getStatus()
Returns the current status code of this response
|
java.lang.String |
getStatusMessage() |
protected java.io.OutputStream |
getStream()
Returns the output stream for this wrapper.
|
java.io.PrintWriter |
getWriter()
Returns the print writer.
|
boolean |
hasError()
Returns true if we're processing an error.
|
void |
init(HttpServletResponse response)
Initialize the response.
|
boolean |
isCauchoResponseStream()
Returns true for a caucho response stream.
|
boolean |
isForwardEnclosed() |
boolean |
isNoCacheUnlessVary() |
void |
killCache()
Kills the cache for an error.
|
void |
reset()
Resets the output stream, clearing headers and the output buffer.
|
void |
resetBuffer()
Resets the output stream without clearing headers and the output buffer.
|
void |
setContentLength(long length) |
void |
setContentType(java.lang.String value)
Sets the response content type.
|
void |
setFlushBuffer(FlushBuffer flushBuffer)
Sets the flush buffer
|
void |
setFooter(java.lang.String key,
java.lang.String value) |
void |
setForbidForward(boolean forbid)
When set to true, RequestDispatcher.forward() is disallowed on
this stream.
|
void |
setForwardEnclosed(boolean isForwardEnclosed) |
void |
setHasError(boolean hasError)
Set to true while processing an error.
|
void |
setLocale(java.util.Locale locale)
Sets the output locale.
|
void |
setNoCache(boolean isPrivate) |
void |
setPrivateCache(boolean isPrivate) |
void |
setResponseStream(AbstractResponseStream stream)
Sets the ResponseStream
|
void |
setSessionId(java.lang.String id) |
void |
writeHeaders(int length) |
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, disable, enable, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getAbstractHttpResponse, getBufferSize, getCharacterEncoding, getContentType, getLocale, isCaching, isCommitted, isDisabled, sendError, sendError, sendRedirect, setBufferSize, setCacheInvocation, setCharacterEncoding, setContentLength, setDateHeader, setHeader, setIntHeader, setMatchCacheEntry, setResponse, setStatus, setStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAbstractHttpResponse, isCaching, setCacheInvocation
addCookie, addDateHeader, addHeader, addIntHeader, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, sendError, sendError, sendRedirect, setDateHeader, setHeader, setIntHeader, setStatus, setStatus
getBufferSize, getCharacterEncoding, getContentType, getLocale, isCommitted, setBufferSize, setCharacterEncoding, setContentLength
protected AbstractResponseStream _stream
public CauchoResponseWrapper()
public CauchoResponseWrapper(HttpServletResponse response)
public void init(HttpServletResponse response)
public void close() throws java.io.IOException
close
in interface CauchoResponse
java.io.IOException
public ServletResponse getResponse()
ResponseWrapper
getResponse
in interface CauchoResponse
getResponse
in class ResponseWrapper
public void setContentType(java.lang.String value)
setContentType
in interface ServletResponse
setContentType
in class ResponseWrapper
value
- the mime type of the outputpublic void setResponseStream(AbstractResponseStream stream)
setResponseStream
in interface CauchoResponse
public AbstractResponseStream getResponseStream()
getResponseStream
in interface CauchoResponse
public boolean isCauchoResponseStream()
isCauchoResponseStream
in interface CauchoResponse
public ServletOutputStream getOutputStream() throws java.io.IOException
getOutputStream
in interface ServletResponse
getOutputStream
in class ResponseWrapper
java.io.IOException
public java.io.PrintWriter getWriter() throws java.io.IOException
getWriter
in interface ServletResponse
getWriter
in class ResponseWrapper
java.io.IOException
protected java.io.OutputStream getStream() throws java.io.IOException
java.io.IOException
public void setFlushBuffer(FlushBuffer flushBuffer)
public FlushBuffer getFlushBuffer()
public void flushBuffer() throws java.io.IOException
ResponseWrapper
flushBuffer
in interface ServletResponse
flushBuffer
in class ResponseWrapper
java.io.IOException
public void reset()
ResponseWrapper
reset()
after data has been committed is illegal.reset
in interface ServletResponse
reset
in class ResponseWrapper
public void resetBuffer()
ResponseWrapper
resetBuffer()
after data has been committed is
illegal.resetBuffer
in interface ServletResponse
resetBuffer
in class ResponseWrapper
public void clearBuffer()
public void setLocale(java.util.Locale locale)
ResponseWrapper
setLocale
in interface ServletResponse
setLocale
in class ResponseWrapper
public java.lang.String getHeader(java.lang.String key)
HttpServletResponse
getHeader
in interface CauchoResponse
getHeader
in interface HttpServletResponse
public boolean disableHeaders(boolean disable)
public void setContentLength(long length)
setContentLength
in interface CauchoResponse
public void setFooter(java.lang.String key, java.lang.String value)
setFooter
in interface CauchoResponse
setFooter
in class ResponseWrapper
public void addFooter(java.lang.String key, java.lang.String value)
addFooter
in interface CauchoResponse
addFooter
in class ResponseWrapper
public int getRemaining()
public void setForbidForward(boolean forbid)
setForbidForward
in interface CauchoResponse
public boolean getForbidForward()
getForbidForward
in interface CauchoResponse
public java.lang.String getStatusMessage()
getStatusMessage
in interface CauchoResponse
public void setHasError(boolean hasError)
setHasError
in interface CauchoResponse
public boolean hasError()
hasError
in interface CauchoResponse
public void killCache()
killCache
in interface CauchoResponse
public void completeCache()
completeCache
in interface CauchoResponse
public void setSessionId(java.lang.String id)
setSessionId
in interface CauchoResponse
public void setPrivateCache(boolean isPrivate)
setPrivateCache
in interface CauchoResponse
public void setNoCache(boolean isPrivate)
setNoCache
in interface CauchoResponse
public void writeHeaders(int length) throws java.io.IOException
writeHeaders
in interface CauchoResponse
java.io.IOException
public int getStatus()
HttpServletResponse
getStatus
in interface HttpServletResponse
public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
HttpServletResponse
getHeaders
in interface HttpServletResponse
public java.util.Collection<java.lang.String> getHeaderNames()
HttpServletResponse
HttpServletResponse.setHeader(java.lang.String, java.lang.String)
, HttpServletResponse.addHeader(java.lang.String, java.lang.String)
, HttpServletResponse.setDateHeader(java.lang.String, long)
, HttpServletResponse.addDateHeader(java.lang.String, long)
, HttpServletResponse.setIntHeader(java.lang.String, int)
, or HttpServletResponse.addIntHeader(java.lang.String, int)
, respectively.getHeaderNames
in interface HttpServletResponse
public void setForwardEnclosed(boolean isForwardEnclosed)
setForwardEnclosed
in interface CauchoResponse
public boolean isForwardEnclosed()
isForwardEnclosed
in interface CauchoResponse
public boolean isNoCacheUnlessVary()
isNoCacheUnlessVary
in interface CauchoResponse
public java.lang.String getCharacterEncodingAssigned()
CauchoResponse
getCharacterEncodingAssigned
in interface CauchoResponse