Interface IResponse
- 
- All Known Subinterfaces:
- IResponse
 
 public interface IResponseInterface that the webcontainer expects the response objects to implement. The methods on this interface will be called by the webcontainer in the process of writing back the response.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCookie(javax.servlet.http.Cookie cookie)Add a cookie to the response.voidaddDateHeader(java.lang.String name, long t)Add a header as a long valuevoidaddHeader(byte[] name, byte[] value)Add a headervoidaddHeader(java.lang.String name, java.lang.String value)Add a headervoidaddIntHeader(java.lang.String name, int i)Add a header as an int valuevoidclearHeaders()Clears the headers datastructurebooleancontainsHeader(byte[] name)Returns true if the header with the supplied name is already presentbooleancontainsHeader(java.lang.String name)Returns true is the header with the supplied name is already presentvoidflushBuffer()voidflushBufferedContent()Flushes the contents to wireintgetBufferSize()javax.servlet.http.Cookie[]getCookies()Get all the cookies for the responsebooleangetFlushMode()Gets the flush mode.java.lang.StringgetHeader(byte[] name)Get a headerjava.lang.StringgetHeader(java.lang.String name)Get a headerjava.util.EnumerationgetHeaderNames()Gets all the header names (keys)java.util.EnumerationgetHeaders(java.lang.String name)Gets all the header values for a particular header namejava.util.Vector[]getHeaderTable()Get the header tablejavax.servlet.ServletOutputStreamgetOutputStream()Get the OutputStreamIRequestgetWCCRequest()Get the webcontainer channel request object for this responsebooleanisAllocateDirect()Get whether to allocate direct or indirect byte buffersbooleanisCommitted()Check if the response is committed yetvoidprepareHeadersForWrite()Prepare to write the headersvoidreleaseChannel()voidremoveCookie(java.lang.String cookieName)voidremoveHeader(byte[] name)Removes the header with the given namevoidremoveHeader(java.lang.String name)Removes the header with the given namevoidresetBuffer()voidsetAllocateDirect(boolean allocateDirect)Set whether to allocate direct or indirect byte buffersvoidsetBufferSize(int bufferSize)voidsetContentLanguage(byte[] value)Set the content language for the responsevoidsetContentLanguage(java.lang.String value)Set the content language for the responsevoidsetContentLength(int length)Set the content length for the responsevoidsetContentType(byte[] value)Set the content type for the responsevoidsetContentType(java.lang.String value)Set the content type for the responsevoidsetDateHeader(java.lang.String name, long t)Set date header as a long valuevoidsetFlushMode(boolean flushToWire)Sets the flush mode.voidsetHeader(byte[] name, byte[] bs)voidsetHeader(java.lang.String name, java.lang.String s)voidsetIntHeader(java.lang.String name, int i)Set a header as an intvoidsetIsClosing(boolean isClosing)voidsetLastBuffer(boolean writeLastBuffer)Set the last buffer modevoidsetReason(byte[] reason)Sets the reason in the response.voidsetReason(java.lang.String reason)Sets the reason in the response.voidsetStatusCode(int code)Sets the HTTP status codevoidwriteHeaders()Write the headers
 
- 
- 
- 
Method Detail- 
setStatusCodevoid setStatusCode(int code) Sets the HTTP status code- Parameters:
- code- the HTTP status code
 
 - 
getOutputStreamjavax.servlet.ServletOutputStream getOutputStream() throws java.io.IOExceptionGet the OutputStream- Returns:
- OutputStream the output stream
- Throws:
- java.io.IOException
 
 - 
isCommittedboolean isCommitted() Check if the response is committed yet- Returns:
- boolean whether or not the response is committed
 
 - 
addHeadervoid addHeader(java.lang.String name, java.lang.String value)Add a header- Parameters:
- name- the name of the header
- name- the value of the header
 
 - 
addHeadervoid addHeader(byte[] name, byte[] value)Add a header- Parameters:
- name- the name of the header
- value- the value of the header
 
 - 
addDateHeadervoid addDateHeader(java.lang.String name, long t)Add a header as a long value- Parameters:
- name- the header name
- t- the header date value
 
 - 
addIntHeadervoid addIntHeader(java.lang.String name, int i)Add a header as an int value- Parameters:
- name- the header name
- i- the header int value
 
 - 
setDateHeadervoid setDateHeader(java.lang.String name, long t)Set date header as a long value- Parameters:
- name- the header name
- t- the header date value
 
 - 
setIntHeadervoid setIntHeader(java.lang.String name, int i)Set a header as an int- Parameters:
- name- the header name
- i- the header int value
 
 - 
getHeaderNamesjava.util.Enumeration getHeaderNames() Gets all the header names (keys)- Returns:
- Collection of header names
 
 - 
getHeadersjava.util.Enumeration getHeaders(java.lang.String name) Gets all the header values for a particular header name- Returns:
- Collection of header v
 
 - 
getHeaderjava.lang.String getHeader(java.lang.String name) Get a header- Parameters:
- name- the header name
- Returns:
- String the header value
 
 - 
getHeaderTablejava.util.Vector[] getHeaderTable() Get the header table- Returns:
- Vector the header names
 
 - 
getHeaderjava.lang.String getHeader(byte[] name) Get a header- Parameters:
- name- the header name
- Returns:
- String the header value
 
 - 
containsHeaderboolean containsHeader(java.lang.String name) Returns true is the header with the supplied name is already present- Parameters:
- name- the header name
- Returns:
- boolean whether the header is present
 
 - 
containsHeaderboolean containsHeader(byte[] name) Returns true if the header with the supplied name is already present- Parameters:
- name- the header name
- Returns:
- boolean whether the header is present
 
 - 
removeHeadervoid removeHeader(java.lang.String name) Removes the header with the given name- Parameters:
- name- the header name
 
 - 
removeHeadervoid removeHeader(byte[] name) Removes the header with the given name- Parameters:
- name- the header name
 
 - 
clearHeadersvoid clearHeaders() Clears the headers datastructure
 - 
getWCCRequestIRequest getWCCRequest() Get the webcontainer channel request object for this response- Returns:
- IWCCRequest the associated request for this response
 
 - 
setFlushModevoid setFlushMode(boolean flushToWire) Sets the flush mode. When set to true, the subsequent flush calls *must* write the contents to the wire. Otherwise, the contents written can be buffered by the underlying layer.- Parameters:
- flushToWire-
 
 - 
setIsClosingvoid setIsClosing(boolean isClosing) 
 - 
getFlushModeboolean getFlushMode() Gets the flush mode.- Returns:
- flushToWire
 
 - 
flushBufferedContentvoid flushBufferedContent() Flushes the contents to wire
 - 
setReasonvoid setReason(java.lang.String reason) Sets the reason in the response.- Parameters:
- reason-
 
 - 
setReasonvoid setReason(byte[] reason) Sets the reason in the response.- Parameters:
- reason-
 
 - 
addCookievoid addCookie(javax.servlet.http.Cookie cookie) Add a cookie to the response.- Parameters:
- cookie-
 
 - 
getCookiesjavax.servlet.http.Cookie[] getCookies() Get all the cookies for the response- Returns:
- Cookie[] containing all the Cookies.
 
 - 
prepareHeadersForWritevoid prepareHeadersForWrite() Prepare to write the headers
 - 
writeHeadersvoid writeHeaders() Write the headers
 - 
setHeadervoid setHeader(java.lang.String name, java.lang.String s)- Parameters:
- name-
- s-
 
 - 
setHeadervoid setHeader(byte[] name, byte[] bs)- Parameters:
- name-
- bs-
 
 - 
setContentTypevoid setContentType(java.lang.String value) Set the content type for the response- Parameters:
- value-
 
 - 
setContentTypevoid setContentType(byte[] value) Set the content type for the response- Parameters:
- value-
 
 - 
setContentLanguagevoid setContentLanguage(java.lang.String value) Set the content language for the response- Parameters:
- value-
 
 - 
setContentLengthvoid setContentLength(int length) Set the content length for the response- Parameters:
- length-
 
 - 
setContentLanguagevoid setContentLanguage(byte[] value) Set the content language for the response- Parameters:
- value-
 
 - 
setAllocateDirectvoid setAllocateDirect(boolean allocateDirect) Set whether to allocate direct or indirect byte buffers- Parameters:
- allocateDirect-
 
 - 
isAllocateDirectboolean isAllocateDirect() Get whether to allocate direct or indirect byte buffers
 - 
setLastBuffervoid setLastBuffer(boolean writeLastBuffer) Set the last buffer mode- Parameters:
- writeLastBuffer-
 
 - 
releaseChannelvoid releaseChannel() 
 - 
removeCookievoid removeCookie(java.lang.String cookieName) 
 - 
resetBuffervoid resetBuffer() 
 - 
getBufferSizeint getBufferSize() 
 - 
setBufferSizevoid setBufferSize(int bufferSize) 
 - 
flushBuffervoid flushBuffer() throws java.io.IOException- Throws:
- java.io.IOException
 
 
- 
 
-