|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.ak.AgentMessage
com.cometway.ak.AgentRequest
com.cometway.httpd.HTTPAgentRequest
public class HTTPAgentRequest
This file is an extension of the com.cometway.ak.AgentRequest class. This class prints an HTTP response in the case that an agent which was requested by a browser does not return a proper HTTP/1.1 response header.public class HTTPAgentRequest extends AgentRequest.
| Field Summary | |
|---|---|
protected java.io.InputStream |
browserIn
|
boolean |
bufferOutput
This flag tells the HTTPAgentRequest whether or not to buffer all the output that is to be sent to the browser. |
boolean |
byteWiseWriting
For some slower internet connections or under heavy traffic, this flag set to true will help ensure the TCP connection doesn't get cut off. |
protected Props |
clientCookies
|
protected java.util.Vector |
cookies
|
protected java.lang.StringBuffer |
dataBuffer
|
java.lang.String |
defaultResponse
|
boolean |
headerSending
|
boolean |
headerSent
|
protected boolean |
headRequest
|
protected java.lang.String |
returnVal
|
protected java.lang.String |
sessionID
|
| Fields inherited from class com.cometway.ak.AgentRequest |
|---|
err, out, writer |
| Fields inherited from class com.cometway.ak.AgentMessage |
|---|
props |
| Constructor Summary | |
|---|---|
HTTPAgentRequest(Props p,
java.io.OutputStream out,
java.io.OutputStream err)
|
|
HTTPAgentRequest(Props p,
java.io.OutputStream out,
java.io.OutputStream err,
java.io.InputStream in)
|
|
HTTPAgentRequest(Props p,
java.io.OutputStream out,
java.io.OutputStream err,
java.io.Reader in)
|
|
| Method Summary | |
|---|---|
void |
addCookie(java.lang.String cookieData)
This method adds a Cookie to the portion of the HTTP response header, when the header is sent. |
void |
close()
|
void |
detectBrowsers()
Tests the User-Agent value and stores the results as properties of this request. |
java.io.InputStream |
getClientInputStream()
If an input stream to the client was provided, this method will return that stream. |
int |
getContentLength()
Returns a content length of the request if one exists. |
Props |
getCookies()
This method will return a Props of the cookie name=value pairs from the client's request. |
java.util.Date |
getIfModifiedSince()
This method returns a Date Object that corresponds to the request's If-Modifed-Since field. |
java.lang.String |
getRequestBody()
This method returns the body of the client's request |
java.lang.String |
getRequestHeaders()
This method returns the headers of the client's request |
java.lang.String |
getSessionID()
This method will automatically fetch the session ID of the requesting client's cookies. |
java.lang.String |
getSessionID(java.lang.String cookieName)
This method will automatically fetch the session ID of the requesting client's cookies. |
java.lang.String |
getUserAgent()
Returns the value of the "User-Agent" header parameter. |
static java.lang.String |
getUserAgent(AgentRequest request)
Returns the User-Agent header parameter value from the specified AgentRequest. |
protected static java.lang.String |
getUserAgent(java.lang.String s)
Returns the User-Agent header parameter value from the specified String. |
protected void |
handleResponseHeader(java.lang.String s)
deals with checking for header and sending it if needed |
boolean |
isHeadRequest()
Returns true if the request is a headers only request |
void |
print(java.lang.String s)
Prints String input and header information (content-type, etc.). |
void |
println()
Prints a newline to the agent's standard OutputStream using a PrintWriter. |
void |
println(java.lang.String s)
Prints String and header information to HTML output. |
boolean |
setSessionCookie(SessionManagerInterface sessionManager)
This method will automatically set a cookie to be written to the client when the response header is to be written. |
boolean |
setSessionCookie(SessionManagerInterface sessionManager,
java.lang.String cookieName)
This method will automatically set a cookie to be written to the client when the response header is to be written. |
protected void |
updateFlags(java.lang.String s)
Updates the state flags after a print() or println() |
| Methods inherited from class com.cometway.ak.AgentRequest |
|---|
getErrorStream, getOutputStream, getRequestType, getWriter, isRequestType, setContentType |
| Methods inherited from class com.cometway.ak.AgentMessage |
|---|
getProps |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public boolean byteWiseWriting
public boolean bufferOutput
protected java.lang.StringBuffer dataBuffer
public java.lang.String defaultResponse
public boolean headerSending
public boolean headerSent
protected java.io.InputStream browserIn
protected java.util.Vector cookies
protected Props clientCookies
protected java.lang.String sessionID
protected boolean headRequest
protected java.lang.String returnVal
| Constructor Detail |
|---|
public HTTPAgentRequest(Props p,
java.io.OutputStream out,
java.io.OutputStream err)
public HTTPAgentRequest(Props p,
java.io.OutputStream out,
java.io.OutputStream err,
java.io.Reader in)
public HTTPAgentRequest(Props p,
java.io.OutputStream out,
java.io.OutputStream err,
java.io.InputStream in)
| Method Detail |
|---|
public boolean isHeadRequest()
public java.lang.String getUserAgent()
public static java.lang.String getUserAgent(AgentRequest request)
protected static java.lang.String getUserAgent(java.lang.String s)
public java.io.InputStream getClientInputStream()
public java.lang.String getRequestBody()
public java.lang.String getRequestHeaders()
public int getContentLength()
public void detectBrowsers()
protected void handleResponseHeader(java.lang.String s)
protected void updateFlags(java.lang.String s)
public void print(java.lang.String s)
print in class AgentRequestpublic void println(java.lang.String s)
println in class AgentRequestpublic void println()
AgentRequest
println in class AgentRequestpublic Props getCookies()
public void addCookie(java.lang.String cookieData)
public java.lang.String getSessionID()
public java.lang.String getSessionID(java.lang.String cookieName)
public boolean setSessionCookie(SessionManagerInterface sessionManager)
public boolean setSessionCookie(SessionManagerInterface sessionManager,
java.lang.String cookieName)
public java.util.Date getIfModifiedSince()
public void close()
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||