|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simpleframework.http.message.ArrayConsumer
org.simpleframework.http.message.SegmentConsumer
org.simpleframework.http.message.HeaderConsumer
org.simpleframework.http.message.RequestConsumer
public class RequestConsumer
The RequestConsumer object is used to parse the HTTP
request line followed by the HTTP message headers. This parses the
request URI such that the query parameters and path are extracted
and normalized. It performs this using external parsers, which
will remove and escaped characters and normalize the path segments.
Finally this exposes the HTTP version used using the major and
minor numbers sent with the HTTP request.
| Field Summary | |
|---|---|
protected int |
major
This is the major version number of the HTTP request header. |
protected String |
method
This is the method token send with the HTTP request header. |
protected int |
minor
This is the minor version number of the HTTP request header. |
protected AddressParser |
parser
This is the address parser used to parse the request URI. |
protected String |
target
This represents the raw request URI in an unparsed form. |
| Fields inherited from class org.simpleframework.http.message.SegmentConsumer |
|---|
cookies, disposition, encoding, expect, header, language, length, limit, name, pos, scan, type, value |
| Fields inherited from class org.simpleframework.http.message.ArrayConsumer |
|---|
array, chunk, count, done |
| Constructor Summary | |
|---|---|
RequestConsumer()
Constructor for the RequestConsumer object. |
|
| Method Summary | |
|---|---|
protected boolean |
digit(byte octet)
This is used to determine if a given ISO-8859-1 byte is a digit character, between an ISO-8859-1 0 and 9. |
Address |
getAddress()
This is used to acquire the address from the request line. |
long |
getDate(String name)
This can be used to get the date of the first message header that has the specified name. |
CharSequence |
getHeader()
This method returns a CharSequence holding the data
consumed for the request. |
int |
getInteger(String name)
This can be used to get the integer of the first message header that has the specified name. |
int |
getMajor()
This can be used to get the major number from a HTTP version. |
String |
getMethod()
This can be used to get the HTTP method for this request. |
int |
getMinor()
This can be used to get the minor number from a HTTP version. |
List<String> |
getNames()
This method is used to get a List of the names
for the headers. |
Path |
getPath()
This is used to acquire the path as extracted from the the HTTP request URI. |
Query |
getQuery()
This method is used to acquire the query part from the HTTP request URI target. |
String |
getTarget()
This can be used to get the target specified for this HTTP request. |
protected void |
process()
This method is invoked after the terminal token has been read. |
String |
toString()
This is used to convert the byte range to a string. |
protected void |
version()
This will parse HTTP version from the first line of the header and store the parsed string internally. |
| Methods inherited from class org.simpleframework.http.message.HeaderConsumer |
|---|
getCookie, getCookies |
| Methods inherited from class org.simpleframework.http.message.SegmentConsumer |
|---|
add, adjust, cookie, disposition, encoding, end, equal, expect, getContentLength, getContentType, getDisposition, getFileName, getLocales, getName, getTransferEncoding, getValue, getValue, getValues, headers, isExpectContinue, isFile, language, length, resize, scan, space, terminal, type, white |
| Methods inherited from class org.simpleframework.http.message.ArrayConsumer |
|---|
consume, isFinished |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.simpleframework.http.message.Header |
|---|
getLocales, isExpectContinue |
| Methods inherited from interface org.simpleframework.http.message.Segment |
|---|
getContentLength, getContentType, getDisposition, getFileName, getName, getTransferEncoding, getValue, getValue, getValues, isFile |
| Field Detail |
|---|
protected AddressParser parser
protected String method
protected String target
protected int major
protected int minor
| Constructor Detail |
|---|
public RequestConsumer()
RequestConsumer object. This
is used to create a consumer which can consume a HTTP request
header and provide the consumed contents via a known interface.
This also further breaks down the request URI for convenience.
| Method Detail |
|---|
public String getTarget()
public Address getAddress()
public Query getQuery()
public Path getPath()
Path object that is
provided by this method is immutable, it represents the
normalized path only part from the request URI.
public String getMethod()
public int getMajor()
public int getMinor()
public long getDate(String name)
getDate in interface HeadergetDate in class HeaderConsumername - the HTTP message header to get the value from
public int getInteger(String name)
getInteger in interface HeadergetInteger in class HeaderConsumername - the HTTP message header to get the value from
public List<String> getNames()
List of the names
for the headers. This will provide the original names for the
HTTP headers for the message. Modifications to the provided
list will not affect the header, the list is a simple copy.
getNames in interface HeadergetNames in class HeaderConsumerprotected void process()
process in class SegmentConsumerprotected void version()
protected boolean digit(byte octet)
octet - this is to be checked to see if it is a digit
public CharSequence getHeader()
CharSequence holding the data
consumed for the request. A character sequence is returned as it
can provide a much more efficient means of representing the header
data by just wrapping the consumed byte array.
public String toString()
toString in interface HeadertoString in class SegmentConsumer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||