com.caucho.server.http
Class HttpResponse

java.lang.Object
  extended by com.caucho.server.connection.AbstractHttpResponse
      extended by com.caucho.server.http.HttpResponse
All Implemented Interfaces:
CauchoResponse, HttpServletResponse, ServletResponse

public class HttpResponse
extends AbstractHttpResponse


Field Summary
 
Fields inherited from class com.caucho.server.connection.AbstractHttpResponse
_calendar, _cb, _charEncoding, _contentLength, _contentPrefix, _contentType, _cookiesOut, _disableCaching, _disableHeaders, _footerKeys, _footerValues, _forbidForward, _hasCharEncoding, _hasError, _hasOutputStream, _hasSentLog, _hasWriter, _headerBuffer, _headerCodes, _headerKeys, _headerValues, _isClosed, _isNoCache, _isTopCache, _originalRequest, _rawWrite, _statusCode, _statusMessage, HEADER_CACHE_CONTROL, HEADER_CONNECTION, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_DATE, HEADER_SERVER, log
 
Fields inherited from interface javax.servlet.http.HttpServletResponse
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_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY_TYPE
 
Method Summary
 WriteStream getRawOutput()
          Switch to raw socket mode.
 boolean isTop()
          Return true for the top request.
 void switchToRaw()
          Switch to raw socket mode.
 java.lang.String toString()
           
 TcpDuplexController upgradeProtocol(TcpDuplexHandler handler)
          Upgrade protocol
protected  void writeContinueInt(WriteStream os)
          Writes the 100 continue response.
protected  boolean writeHeadersInt(WriteStream os, int length, boolean isHead)
          Implementation to write the HTTP headers.
 
Methods inherited from class com.caucho.server.connection.AbstractHttpResponse
addCookie, addDateHeader, addFooter, addHeader, addIntHeader, clearBuffer, close, containsHeader, createResponseStream, disable, disableCaching, disableHeaders, enable, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, fillCookie, finish, flushBuffer, flushHeader, free, getBufferSize, getCalendar, getCharacterEncoding, getContentLength, getContentLengthHeader, getContentType, getController, getCookie, getCookies, getFlushBuffer, getForbidForward, getHeader, getLocale, getNextWriter, getOriginalRequest, getOriginalStream, getOutputStream, getPrivateCache, getRemaining, getRequest, getResponse, getResponseStream, getStatusCode, getStatusMessage, getWriter, hasError, init, init, isCacheHit, isCauchoResponseStream, isClosed, isCommitted, isDisabled, isHead, isHeaderWritten, isIgnoreClientDisconnect, isNoCache, isPrivateCache, killCache, killCaching, removeHeader, reset, resetBuffer, sendError, sendError, sendRedirect, setBufferSize, setCacheHit, setCacheInvocation, setCharacterEncoding, setContentLength, setContentType, setDateHeader, setDisableAutoFlush, setFlushBuffer, setFooter, setForbidForward, setHasError, setHeader, setHeaderWritten, setIntHeader, setLocale, setMatchCacheEntry, setNoCache, setPrivateCache, setPrivateOrResinCache, setRequest, setResponseStream, setSessionId, setSpecial, setStatus, setStatus, setTopCache, start, startCaching, writeHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

switchToRaw

public void switchToRaw()
                 throws java.io.IOException
Switch to raw socket mode.

Overrides:
switchToRaw in class AbstractHttpResponse
Throws:
java.io.IOException

getRawOutput

public WriteStream getRawOutput()
                         throws java.io.IOException
Switch to raw socket mode.

Overrides:
getRawOutput in class AbstractHttpResponse
Throws:
java.io.IOException

upgradeProtocol

public TcpDuplexController upgradeProtocol(TcpDuplexHandler handler)
Upgrade protocol

Overrides:
upgradeProtocol in class AbstractHttpResponse

isTop

public boolean isTop()
Return true for the top request.

Overrides:
isTop in class AbstractHttpResponse

writeContinueInt

protected void writeContinueInt(WriteStream os)
                         throws java.io.IOException
Writes the 100 continue response.

Overrides:
writeContinueInt in class AbstractHttpResponse
Throws:
java.io.IOException

writeHeadersInt

protected boolean writeHeadersInt(WriteStream os,
                                  int length,
                                  boolean isHead)
                           throws java.io.IOException
Implementation to write the HTTP headers. If the length is positive, it's a small request where the buffer contains the entire request, so the length is already known.

Specified by:
writeHeadersInt in class AbstractHttpResponse
Parameters:
os - the output stream to write the headers to.
length - if non-negative, the length of the entire request.
Returns:
true if the data in the request should use chunked encoding.
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object