apollo
Class HTTPResponse

java.lang.Object
  |
  +--apollo.HTTPResponse
All Implemented Interfaces:
java.io.Serializable

public class HTTPResponse
extends java.lang.Object
implements java.io.Serializable

This is the HTTPResponse object. Copyright Joe Kislo, All Rights Reserved.

See Also:
Serialized Form

Constructor Summary
HTTPResponse(ManagerTracker MT)
           
HTTPResponse(ManagerTracker MT, HTTPResponse HTTPRes)
           
HTTPResponse(ManagerTracker MT, java.lang.String s)
           
 
Method Summary
 void append(byte[] b)
          Appends to the HTTPResponse
 void append(HTTPResponse res)
          Appends the HTTPResponse supplied to the current HTTPResponse
 void append(java.lang.String s)
          Appends to the HTTPResponse
 void clear()
          Clears the response contents (but nothing else) of this HTTPResponse
 byte[] getContents()
          Returns a string representing the contents of this Response
 boolean getGZIPEncoding()
          Returns true if GZIP encoding is activated (This does not guarantee it will be used)
 java.util.Hashtable getManualHeaders()
          Returns the Hashtable representing the manual headers
 WebSession getReturnSession()
          Not for general use.
 boolean getUseManualHeaders()
          Returns true if manual headers are in use
 void render(javax.servlet.http.HttpServletResponse res)
          Render the contents of the response.
 void render(javax.servlet.http.HttpServletResponse res, javax.servlet.http.HttpServletRequest req)
          Renders this HTTPResponse to a JSDK HttpServletResponse object.
 void setGZIPEncoding(boolean b)
          Activate or deactive GZIP encoding
 void setManualHeaders(java.lang.String key, java.lang.String value)
          Set headers manually.
 void setMT(ManagerTracker MT)
           
 void setReturnSession(WebSession session)
          NOT for general use.
 void setUseManualHeaders(boolean b)
          Activate or deactivate the manual headers
 java.lang.String toString()
          Represents this HTTPResponse as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTTPResponse

public HTTPResponse(ManagerTracker MT,
                    java.lang.String s)

HTTPResponse

public HTTPResponse(ManagerTracker MT,
                    HTTPResponse HTTPRes)

HTTPResponse

public HTTPResponse(ManagerTracker MT)
Method Detail

setMT

public void setMT(ManagerTracker MT)

setReturnSession

public void setReturnSession(WebSession session)
NOT for general use. For use by NodeManager only!

getReturnSession

public WebSession getReturnSession()
Not for general use. For use by NodeManager only!

toString

public java.lang.String toString()
Represents this HTTPResponse as a string
Overrides:
toString in class java.lang.Object

append

public void append(java.lang.String s)
Appends to the HTTPResponse

append

public void append(byte[] b)
Appends to the HTTPResponse

append

public void append(HTTPResponse res)
Appends the HTTPResponse supplied to the current HTTPResponse

clear

public void clear()
Clears the response contents (but nothing else) of this HTTPResponse

getGZIPEncoding

public boolean getGZIPEncoding()
Returns true if GZIP encoding is activated (This does not guarantee it will be used)

setGZIPEncoding

public void setGZIPEncoding(boolean b)
Activate or deactive GZIP encoding

setManualHeaders

public void setManualHeaders(java.lang.String key,
                             java.lang.String value)
Set headers manually. Generally used if you are returning a different mime-type

getManualHeaders

public java.util.Hashtable getManualHeaders()
Returns the Hashtable representing the manual headers

setUseManualHeaders

public void setUseManualHeaders(boolean b)
Activate or deactivate the manual headers

getUseManualHeaders

public boolean getUseManualHeaders()
Returns true if manual headers are in use

render

public void render(javax.servlet.http.HttpServletResponse res,
                   javax.servlet.http.HttpServletRequest req)
            throws java.io.IOException
Renders this HTTPResponse to a JSDK HttpServletResponse object. GZIP content encoding is used if available.

render

public void render(javax.servlet.http.HttpServletResponse res)
            throws java.io.IOException
Render the contents of the response. GZIP encoding will not be enabled becuase the HttpServletRequest was not supplied, the browser's capabilities could not be assertained.
Parameters:
res - The HttpServletResponse

getContents

public byte[] getContents()
Returns a string representing the contents of this Response