com.prolixtech.jaminid
Class Request
java.lang.Object
com.prolixtech.jaminid.Request
public class Request
extends java.lang.Object
The request class encapsulates an HTTP request. It is responsible for
splitting up the query, processing POST forms, splitting to URI and URL, and
once it is created, it is essentially a data struct for all this information.
Request
public Request(Daemon activeDaemon,
Connection connx)
Creates a new request object
activeDaemon
- the daemon that spawned the requestconnx
- the connection that produced this request
addRequestLines
public void addRequestLines(String requestMessage)
Method Adds Request Lines
requestMessage
- the message to add
appendToBody
public void appendToBody(String body)
appends more stuff to body of request
checkParam
public boolean checkParam(String param,
String possvalue)
getBody
public String getBody()
Used in POST to return the body of the request
- the body of the request (useful in POST)
getDaemon
public Daemon getDaemon()
Returns the master daemon
- the master daemon where this request was spawned
getHeader
public Map getHeader()
Returns header
- the header of this request
getIPAddressString
public String getIPAddressString()
- the ip address of the request
getLocation
public String getLocation()
Return the location sought
- the location sought (URL)
getMessage
public String getMessage()
Returns the entire request message
- the entire request message
getParam
public String getParam(String key)
getParamMap
public Map getParamMap()
- a param map of the request (like Perl)
getParamOrNull
public String getParamOrNull(String key)
getParamString
public String getParamString()
getURI
public String getURI()
Returns the Uniform Resource Identifier
- the URI Uniform Resource Identifier
isRequestBad
public boolean isRequestBad()
- if the request was malformed
setMethodLine
public void setMethodLine(String methodLine)
methodLine
- the method line of the request
switchToBody
protected int switchToBody()
switchToCompleted
protected void switchToCompleted()