|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.ibm.wbi.Meg
|
+--com.ibm.wbi.Generator
|
+--com.ibm.wbi.protocol.http.HttpGenerator
The abstract base class for Generators producing HTTP responses. This class simply contains an HttpResponse object and provides methods for manipulating that object. The object is not automatically used for producing an HTTP response, but is available for use by subclasses when they need to produce a response.
HttpResponse| Field Summary | |
static java.lang.String |
COPYRIGHT
|
protected HttpResponse |
http
An object for manipulating the response that will ultimately be sent back to the browser. |
| Fields inherited from class com.ibm.wbi.Meg |
EDITOR, GENERATOR, MONITOR, REQUEST_EDITOR, UNDEFINED |
| Constructor Summary | |
HttpGenerator()
Construct a default HTTP Generator. |
|
| Method Summary | |
void |
add(java.lang.String key,
java.lang.String value)
Add an arbitrary key/value pair of the HTTP Response object. |
void |
addCookie(java.lang.String name,
java.lang.String value,
java.util.Date expires,
java.lang.String domain,
java.lang.String path,
boolean secure)
Add a cookie to the HTTP Response object. |
java.lang.String |
getContentType()
Get the ContentType property of the HTTP Response object. |
HttpResponse |
getHttpResponse()
Access the HTTP Response object. |
java.lang.String |
getHttpResponseString()
Convert the HTTP Response object into an HTTP response string. |
int |
getResponseCode()
Get the ResponseCode property of the HTTP Response object. |
java.lang.String |
getResponseText()
Get the ResponseText property of the HTTP Response object. |
abstract void |
handleRequest(RequestEvent e)
The method used by Proxy to generate the document. |
boolean |
isCache()
Access the Cache property of the HTTP Response object. |
java.lang.String |
produceHeader()
Synonymous to getHTTPResponseString(). |
void |
set(java.lang.String key,
java.lang.String value)
Set an arbitrary key/value pair of the HTTP Response object. |
void |
setCache(boolean c)
Set the Cache property of the HTTP Response object. |
void |
setContentLength(long cl)
Set the ContentLength property of the HTTP Response object. |
void |
setContentType(java.lang.String ct)
Set the ContentType property of the HTTP Response object. |
void |
setResponseCode(int c)
Set the ResponseCode property of the HTTP Response object. |
void |
setResponseText(java.lang.String t)
Set the ResponseText property of the HTTP Response object. |
void |
setServer(java.lang.String s)
Set the Server property of the HTTP Response object. |
void |
writeHeader(RequestEvent e)
Write the HTTP Response to the given RequestEvent's output stream. |
| Methods inherited from class com.ibm.wbi.Generator |
getType |
| Methods inherited from class com.ibm.wbi.Meg |
forwardRequest, getCondition, getEnabled, getMegProperty, getMegProperty, getMegPropertyKeys, getName, getPlugin, getPriority, getSystemContext, initialize, initialize, isEnabled, isMegApplicable, loadMegResources, run, setCondition, setEnabled, setMegProperty, setName, setPriority, setSystemContext, setup, setup, setup, setup |
| Field Detail |
public static final java.lang.String COPYRIGHT
protected HttpResponse http
| Constructor Detail |
public HttpGenerator()
| Method Detail |
public HttpResponse getHttpResponse()
public java.lang.String getHttpResponseString()
public void setContentType(java.lang.String ct)
ct - The ContentType.HttpBase.setContentType(java.lang.String)public java.lang.String getContentType()
HttpBase.getContentType()public void setContentLength(long cl)
cl - The ContentLength.HttpBase.setContentLength(long)
public void set(java.lang.String key,
java.lang.String value)
key - The key.value - The value.HttpBase.set(java.lang.String, java.lang.String)
public void add(java.lang.String key,
java.lang.String value)
key - The key.value - The value.HttpBase.add(java.lang.String, java.lang.String)
public void addCookie(java.lang.String name,
java.lang.String value,
java.util.Date expires,
java.lang.String domain,
java.lang.String path,
boolean secure)
name - The name of the cookie.value - The value.expires - The date it expires.domain - The domain.path - The path.secure - Is secure?HttpResponse.addCookie(java.lang.String, java.lang.String, java.util.Date, java.lang.String, java.lang.String, boolean)public int getResponseCode()
HttpResponse.getResponseCode()public void setResponseCode(int c)
c - The ResponseCode.HttpResponse.setResponseCode(int)public java.lang.String getResponseText()
HttpResponse.getResponseText()public void setResponseText(java.lang.String t)
t - The ResponseText.HttpResponse.setResponseText(java.lang.String)public java.lang.String produceHeader()
getHTTPResponseStringpublic void writeHeader(RequestEvent e)
e - Request event.public void setServer(java.lang.String s)
s - Server.HttpResponse.setServer(java.lang.String)public void setCache(boolean c)
c - Cache property.HttpResponse.setCache(boolean)public boolean isCache()
HttpResponse.isCache()
public abstract void handleRequest(RequestEvent e)
throws RequestRejectedException,
java.io.IOException
handleRequest in class Generatore - The RequestEvent.RequestRejectedException - If rejecting request, this
must be thrown before the first write() is
made to the output stream.java.io.Exception - can be thrown if an exception was generated
by the Meg while processing the MegInput/OutputStreams.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||