|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.http.HttpMessage | +--org.mortbay.http.HttpRequest
HTTP Request. This class manages the headers, trailers and content streams of a HTTP request. It can be used for receiving or generating requests.
This class is not synchronized. It should be explicitly synchronized if it is used by multiple threads.
HttpResponse
Nested Class Summary |
Nested classes inherited from class org.mortbay.http.HttpMessage |
HttpMessage.HeaderWriter |
Field Summary | |
static java.lang.String |
__CONNECT
Request METHODS. |
static java.lang.String |
__DELETE
Request METHODS. |
static java.lang.String |
__GET
Request METHODS. |
static java.lang.String |
__HEAD
Request METHODS. |
static int |
__maxFormContentSize
Max size of the form content. |
static int |
__maxLineLength
Maximum header line length. |
static StringMap |
__methodCache
|
static java.lang.String |
__MOVE
Request METHODS. |
static java.lang.String |
__OPTIONS
Request METHODS. |
static java.lang.String |
__POST
Request METHODS. |
static java.lang.String |
__PUT
Request METHODS. |
static java.lang.String |
__TRACE
Request METHODS. |
static StringMap |
__versionCache
|
Fields inherited from class org.mortbay.http.HttpMessage |
__HTTP_0_9, __HTTP_1_0, __HTTP_1_1, __HTTP_1_X, __MSG_BAD, __MSG_EDITABLE, __MSG_RECEIVED, __MSG_SENDING, __MSG_SENT, __SCHEME, __SSL_SCHEME, __state |
Constructor Summary | |
HttpRequest()
Constructor. |
|
HttpRequest(HttpConnection connection)
Constructor. |
Method Summary | |
void |
destroy()
Destroy the request. |
java.util.List |
getAcceptableTransferCodings()
Get the acceptable transfer encodings. |
java.lang.String |
getAuthType()
|
java.lang.String |
getAuthUser()
|
Cookie[] |
getCookies()
Extract received cookies from a header. |
java.lang.String |
getEncodedPath()
Get the encoded request path. |
java.lang.String |
getHost()
Get the request host. |
HttpResponse |
getHttpResponse()
Get the HTTP Response. |
java.lang.String |
getMethod()
Get the HTTP method for this request. |
java.lang.String |
getParameter(java.lang.String name)
Get a parameter value. |
java.util.Set |
getParameterNames()
Get the set of parameter names. |
MultiMap |
getParameters()
|
java.util.Map |
getParameterStringArrayMap()
|
java.util.List |
getParameterValues(java.lang.String name)
Get multi valued paramater. |
java.lang.String |
getPath()
Get the request path. |
int |
getPort()
Get the request port. |
java.lang.String |
getQuery()
Get the request query. |
java.lang.String |
getRemoteAddr()
|
java.lang.String |
getRemoteHost()
|
java.lang.String |
getRequestLine()
Return the HTTP request line as it was received. |
java.lang.StringBuffer |
getRequestURL()
Reconstructs the URL the client used to make the request. |
HttpResponse |
getResponse()
Deprecated. use getHttpResponse() |
java.lang.StringBuffer |
getRootURL()
Reconstructs the URL the client used to make the request. |
java.lang.String |
getScheme()
Get the request Scheme. |
long |
getTimeStamp()
Get Request TimeStamp |
java.lang.String |
getTimeStampStr()
Get Request TimeStamp |
URI |
getURI()
Get the full URI. |
UserPrincipal |
getUserPrincipal()
|
java.lang.String |
getVersion()
Get the protocol version. |
boolean |
isConfidential()
|
boolean |
isHandled()
Is the request handled. |
boolean |
isIntegral()
|
boolean |
isUserInRole(java.lang.String role)
|
void |
readHeader(LineInput in)
Read the request line and header. |
void |
setAuthType(java.lang.String a)
|
void |
setAuthUser(java.lang.String user)
|
void |
setHandled(boolean handled)
Set the handled status. |
void |
setMethod(java.lang.String method)
|
void |
setPath(java.lang.String path)
|
void |
setQuery(java.lang.String q)
|
void |
setTimeStamp(long ts)
|
void |
setUserPrincipal(UserPrincipal principal)
|
void |
writeHeader(java.io.Writer writer)
Write the request header. |
void |
writeRequestLine(java.io.Writer writer)
Write the HTTP request line as it was received. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String __GET
public static final java.lang.String __POST
public static final java.lang.String __HEAD
public static final java.lang.String __PUT
public static final java.lang.String __OPTIONS
public static final java.lang.String __DELETE
public static final java.lang.String __TRACE
public static final java.lang.String __CONNECT
public static final java.lang.String __MOVE
public static int __maxFormContentSize
public static int __maxLineLength
public static final StringMap __methodCache
public static final StringMap __versionCache
Constructor Detail |
public HttpRequest()
public HttpRequest(HttpConnection connection)
connection
- Method Detail |
public java.lang.String getTimeStampStr()
public long getTimeStamp()
public void setTimeStamp(long ts)
public HttpResponse getResponse()
public HttpResponse getHttpResponse()
public boolean isHandled()
public void setHandled(boolean handled)
handled
- true or falsepublic void readHeader(LineInput in) throws java.io.IOException
in
-
java.io.IOException
public void writeRequestLine(java.io.Writer writer) throws java.io.IOException
java.io.IOException
public void writeHeader(java.io.Writer writer) throws java.io.IOException
writeHeader
in class HttpMessage
writer
- Http output stream
java.io.IOException
- IO problempublic java.lang.String getRequestLine()
public java.lang.String getMethod()
public void setMethod(java.lang.String method)
public java.lang.String getVersion()
HttpMessage
getVersion
in class HttpMessage
public java.lang.StringBuffer getRootURL()
Because this method returns a StringBuffer
,
not a string, you can modify the URL easily, for example,
to append path and query parameters.
This method is useful for creating redirect messages
and for reporting errors.
public java.lang.StringBuffer getRequestURL()
Because this method returns a StringBuffer
,
not a string, you can modify the URL easily, for example,
to append query parameters.
This method is useful for creating redirect messages and for reporting errors.
StringBuffer
object containing
the reconstructed URLpublic URI getURI()
public java.lang.String getScheme()
public boolean isIntegral()
public boolean isConfidential()
public java.lang.String getHost()
public int getPort()
public java.lang.String getPath()
public void setPath(java.lang.String path)
public java.lang.String getEncodedPath()
public java.lang.String getQuery()
public void setQuery(java.lang.String q)
public java.lang.String getRemoteAddr()
public java.lang.String getRemoteHost()
public java.util.List getAcceptableTransferCodings()
public MultiMap getParameters()
public java.util.Set getParameterNames()
public java.lang.String getParameter(java.lang.String name)
name
- Parameter name
public java.util.List getParameterValues(java.lang.String name)
name
- Parameter name
public java.util.Map getParameterStringArrayMap()
public Cookie[] getCookies()
public boolean isUserInRole(java.lang.String role)
public java.lang.String getAuthType()
public void setAuthType(java.lang.String a)
public java.lang.String getAuthUser()
public void setAuthUser(java.lang.String user)
public UserPrincipal getUserPrincipal()
public void setUserPrincipal(UserPrincipal principal)
public void destroy()
destroy
in class HttpMessage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |