|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.connection.AbstractHttpRequest
com.caucho.server.http.HttpRequest
public class HttpRequest
Handles a new request from an HTTP connection.
| Field Summary |
|---|
| Fields inherited from class com.caucho.server.connection.AbstractHttpRequest |
|---|
_calendar, _cb, _conn, _expect100Continue, _hasReadStream, _headerCodes, _hostHeader, _invocation, _rawRead, _readStream, _response, _server, _sessionGroup, _tcpConn, CONTEXT_PATH, ERROR_URI, EXCEPTION, EXCEPTION_TYPE, JSP_EXCEPTION, MESSAGE, PATH_INFO, QUERY_STRING, REQUEST_URI, SERVLET_NAME, SERVLET_PATH, SHUTDOWN, STATUS_CODE |
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
|---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
|---|---|
HttpRequest(DispatchServer server,
Connection conn)
Creates a new HttpRequest. |
|
| Method Summary | |
|---|---|
protected boolean |
checkLogin()
|
protected java.lang.String |
dbgId()
|
java.lang.String |
findSessionIdFromConnection()
For SSL connections, use the SSL identifier. |
void |
finish()
Cleans up at the end of the request |
java.lang.Object |
getAttribute(java.lang.String name)
Returns the named attribute. |
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Returns an enumeration of the attribute names. |
java.lang.String |
getHeader(java.lang.String key)
Returns the header. |
CharSegment |
getHeaderBuffer(char[] testBuf,
int length)
Returns the matching header. |
CharSegment |
getHeaderBuffer(java.lang.String key)
Returns the header value for the key, returned as a CharSegment. |
void |
getHeaderBuffers(java.lang.String key,
java.util.ArrayList<CharSegment> values)
Fills an ArrayList with the header values matching the key. |
CharSegment |
getHeaderKey(int index)
Returns the header key |
java.util.Enumeration |
getHeaderNames()
Returns an enumeration of all the header keys. |
java.util.Enumeration |
getHeaders(java.lang.String key)
Return an enumeration of headers matching a key. |
int |
getHeaderSize()
Returns the number of headers. |
CharSegment |
getHeaderValue(int index)
Returns the header value |
protected java.lang.CharSequence |
getHost()
Returns the virtual host of the request |
java.lang.String |
getMethod()
Returns the header. |
CharSegment |
getMethodBuffer()
Returns a buffer containing the request method. |
java.lang.String |
getProtocol()
Returns the protocol. |
CharSegment |
getProtocolBuffer()
Returns a char segment containing the protocol. |
ReadStream |
getRawInput()
Returns the raw input stream. |
byte[] |
getUriBuffer()
Returns the byte buffer containing the request URI |
int |
getUriLength()
Returns the length of the request URI |
boolean |
handleRequest()
Handles a new HTTP request. |
boolean |
handleResume()
Handles a comet-style resume. |
boolean |
initStream(ReadStream readStream,
ReadStream rawRead)
Returns a stream for reading POST data. |
boolean |
isSecure()
Returns true for a secure connection. |
boolean |
isTop()
Returns true for the top-level request, but false for any include() or forward() |
boolean |
isWaitForRead()
Return true if the request waits for a read before beginning. |
void |
protocolCloseEvent()
Handles a close event when the connection is closed. |
void |
setHeader(java.lang.String key,
java.lang.String value)
Adds a new header. |
protected void |
skip()
|
protected void |
start()
Clear the request variables in preparation for a new request. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.caucho.server.port.TcpServerRequest |
|---|
getConnection |
| Methods inherited from interface com.caucho.server.port.ServerRequest |
|---|
init, startConnection |
| Constructor Detail |
|---|
public HttpRequest(DispatchServer server,
Connection conn)
server - the owning server.| Method Detail |
|---|
public final boolean isWaitForRead()
isWaitForRead in interface ServerRequest
public boolean handleRequest()
throws java.io.IOException
Note: ClientDisconnectException must be rethrown to the caller.
handleRequest in interface ServerRequestjava.io.IOException
public boolean handleResume()
throws java.io.IOException
handleResume in interface ServerRequesthandleResume in class AbstractHttpRequestjava.io.IOExceptionpublic boolean isTop()
isTop in interface CauchoRequestisTop in class AbstractHttpRequestprotected boolean checkLogin()
protected void start()
throws java.io.IOException
start in class AbstractHttpRequests - the read stream for the request
java.io.IOExceptionpublic boolean isSecure()
isSecure in interface ServletRequestisSecure in class AbstractHttpRequestpublic java.lang.String getMethod()
getMethod in interface HttpServletRequestgetMethod in class AbstractHttpRequestpublic CharSegment getMethodBuffer()
protected java.lang.CharSequence getHost()
getHost in class AbstractHttpRequestpublic byte[] getUriBuffer()
getUriBuffer in class AbstractHttpRequestpublic int getUriLength()
getUriLength in class AbstractHttpRequestpublic java.lang.String getProtocol()
getProtocol in interface ServletRequestgetProtocol in class AbstractHttpRequestpublic CharSegment getProtocolBuffer()
public void setHeader(java.lang.String key,
java.lang.String value)
setHeader in interface CauchoRequestsetHeader in class AbstractHttpRequestkey - the key of the new headervalue - the value for the new headerpublic int getHeaderSize()
getHeaderSize in class AbstractHttpRequestpublic CharSegment getHeaderKey(int index)
getHeaderKey in class AbstractHttpRequestpublic CharSegment getHeaderValue(int index)
getHeaderValue in class AbstractHttpRequestpublic java.lang.String getHeader(java.lang.String key)
getHeader in interface HttpServletRequestgetHeader in class AbstractHttpRequestkey - the header key
public CharSegment getHeaderBuffer(char[] testBuf,
int length)
testBuf - header keylength - length of the key.public CharSegment getHeaderBuffer(java.lang.String key)
getHeaderBuffer in class AbstractHttpRequestkey - the header name
public void getHeaderBuffers(java.lang.String key,
java.util.ArrayList<CharSegment> values)
getHeaderBuffers in class AbstractHttpRequestvalues - ArrayList which will contain the maching values.key - the header key to select.public java.util.Enumeration getHeaders(java.lang.String key)
getHeaders in interface HttpServletRequestgetHeaders in class AbstractHttpRequestkey - the header key to match.
public java.util.Enumeration getHeaderNames()
getHeaderNames in interface HttpServletRequestgetHeaderNames in class AbstractHttpRequest
public boolean initStream(ReadStream readStream,
ReadStream rawRead)
throws java.io.IOException
initStream in class AbstractHttpRequestjava.io.IOException
protected void skip()
throws java.io.IOException
skip in class AbstractHttpRequestjava.io.IOExceptionpublic java.lang.Object getAttribute(java.lang.String name)
getAttribute in interface ServletRequestgetAttribute in class AbstractHttpRequestname - the attribute name.
public java.util.Enumeration<java.lang.String> getAttributeNames()
getAttributeNames in interface ServletRequestgetAttributeNames in class AbstractHttpRequestpublic java.lang.String findSessionIdFromConnection()
findSessionIdFromConnection in class AbstractHttpRequestpublic ReadStream getRawInput()
getRawInput in class AbstractHttpRequestpublic final void protocolCloseEvent()
ServerRequest
protocolCloseEvent in interface ServerRequest
public void finish()
throws java.io.IOException
finish in class AbstractHttpRequestjava.io.IOExceptionprotected java.lang.String dbgId()
dbgId in class AbstractHttpRequestpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||