com.zeus.ZXTMServlet
Interface ZXTMServletResponse

All Superinterfaces:
ServletResponse
All Known Subinterfaces:
ZXTMHttpServletResponse

public interface ZXTMServletResponse
extends ServletResponse

The ZXTMServletResponse interface extends the base ServletResponse to give access to ZXTM functionality. In particular, this interface allows a Servlet to modify a response that has already been generated by a server, instead of the Servlet being responsible for the original reply.


Method Summary
 void dropConnection()
          Tell ZXTM to completely drop this connection, without replying to the user
 int getContentLength()
          Read the content length of the response.
 String getContentType()
          Returns the Content-Type of the response.
 ServletInputStream getInputStream()
          Retrieves the body of the response as binary data using a ServletInputStream.
 BufferedReader getReader()
          Retrieves the body of the response as character data using a BufferedReader.
 boolean isResponseRule()
          Is the Servlet running as a response rule?
 void retryConnection()
          Tell ZXTM to retry this request.
 void setCharacterEncoding(String enc)
          Overrides the name of the character encoding used in the body of this response.
 
Methods inherited from interface javax.servlet.ServletResponse
flushBuffer, getBufferSize, getCharacterEncoding, getLocale, getOutputStream, getWriter, isCommitted, reset, resetBuffer, setBufferSize, setContentLength, setContentType, setLocale
 

Method Detail

dropConnection

void dropConnection()
                    throws IOException
Tell ZXTM to completely drop this connection, without replying to the user

Throws:
IOException - if an error occurs when communicating with ZXTM

getContentLength

int getContentLength()
Read the content length of the response.

Returns:
the content length, or -1 if unknown.

getContentType

String getContentType()
Returns the Content-Type of the response.

Returns:
The Content-Type. Can be null if the Servlet is running as a request rule, or if the content-type is not known, or is unspecified.

getInputStream

ServletInputStream getInputStream()
                                  throws IOException
Retrieves the body of the response as binary data using a ServletInputStream.

Returns:
a ServletInputStream suitable to reading the response body data, or null if the Servlet is running as a request rule.
Throws:
IOException - if an error occurs when communicating with ZXTM

getReader

BufferedReader getReader()
                         throws IOException
Retrieves the body of the response as character data using a BufferedReader. Returns null if the Servlet is running as a request rule.

Throws:
IOException - if an error occurs when communicating with ZXTM

isResponseRule

boolean isResponseRule()
Is the Servlet running as a response rule?

Returns:
true if the Servlet is running as a response rule

retryConnection

void retryConnection()
                     throws IOException
Tell ZXTM to retry this request. The connection to the backend server will be dropped (if it hasn't already finished), and ZXTM will re-pick a node to use for the request. The response rules will then be run again.

Throws:
IOException - if an error occurs when communicating with ZXTM

setCharacterEncoding

void setCharacterEncoding(String enc)
Overrides the name of the character encoding used in the body of this response. This method must be called prior to reading response parameters or reading the response via getReader()

Parameters:
enc - A String containing the name of the character encoding