public class FastCgiRequest extends AbstractHttpRequest implements ProtocolConnection
_headerCodes, JSP_EXCEPTION, SHUTDOWN, TOKEN
Constructor and Description |
---|
FastCgiRequest(ServletService server,
SocketLink conn)
Creates a new HttpRequest.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkLogin() |
FastCgiResponse |
createResponse() |
protected java.lang.String |
dbgId() |
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
|
java.lang.String |
getMethod()
Returns the header.
|
CharSegment |
getMethodBuffer()
Returns a buffer containing the request method.
|
java.lang.String |
getProtocol()
Returns 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
|
int |
getVersion() |
boolean |
handleRequest()
Handles a new HTTP request.
|
boolean |
hasRequest()
Returns true if the request exists
|
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 |
setHeader(java.lang.String key,
java.lang.String value)
Adds a new header.
|
protected void |
startRequest()
Clear the request variables in preparation for a new request.
|
java.lang.String |
toString() |
addHeaderInt, allocateHttpBufferStore, buildInvocation, cleanup, clearRequest, clientDisconnect, findSessionIdFromConnection, finishInvocation, finishRequest, getAbstractHttpResponse, getAvailable, getBufferAvailable, getCharacterEncoding, getCharBuffer, getConnection, getConnectionId, getContentLength, getContentType, getContentTypeBuffer, getCookies, getDateHeader, getErrorManager, getForm, getFormParser, getForwardedHostHeader, getHost, getHostHeader, getHttpBufferStore, getInputStream, getIntHeader, getInvocation, getInvocationServer, getLocale, getLocales, getLocalHost, getLocalPort, getLongContentLength, getProtocolRequestURL, getRawRead, getRawReadBuffer, getRawWrite, getReader, getReadStream, getRemoteAddr, getRemoteHost, getRemotePort, getRequestFacade, getRequestURI, getRequestURL, getResponse, getResponseFacade, getScheme, getServer, getServerName, getServerPort, getSmallHeaderBuffer, getSmallHeaderKeys, getSmallHeaderValues, getSmallUriBuffer, getStartTime, getStream, getStream, getTcpSocketLink, getUserPrincipal, getWebApp, handleConnectionClose, handleResume, init, initAttributes, isCometActive, isConnectionClosed, isDuplex, isIgnoreClientDisconnect, isKeepalive, isSuspend, isTransportSecure, isUserInRole, killKeepalive, onAttachThread, onCloseConnection, onDetachThread, onStartConnection, printRemoteAddr, restartServer, runAs, sendRequestError, setCharacterEncoding, setContentLength, shutdown, skip, startDuplex, startInvocation
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getProtocolRequestURL, handleResume, init, onAttachThread, onCloseConnection, onDetachThread, onStartConnection
public FastCgiRequest(ServletService server, SocketLink conn)
server
- the owning server.public FastCgiResponse createResponse()
createResponse
in class AbstractHttpRequest
public final boolean isWaitForRead()
isWaitForRead
in interface ProtocolConnection
public boolean hasRequest()
hasRequest
in class AbstractHttpRequest
public boolean handleRequest() throws java.io.IOException
Note: ClientDisconnectException must be rethrown to the caller.
handleRequest
in interface ProtocolConnection
handleRequest
in class AbstractProtocolConnection
java.io.IOException
public int getVersion()
public byte[] getUriBuffer()
getUriBuffer
in class AbstractHttpRequest
public int getUriLength()
getUriLength
in class AbstractHttpRequest
public java.lang.String getMethod()
getMethod
in class AbstractHttpRequest
public java.lang.String getProtocol()
getProtocol
in class AbstractHttpRequest
public CharSegment getMethodBuffer()
public void setHeader(java.lang.String key, java.lang.String value)
setHeader
in class AbstractHttpRequest
key
- the key of the new headervalue
- the value for the new headerpublic int getHeaderSize()
getHeaderSize
in class AbstractHttpRequest
public CharSegment getHeaderKey(int index)
getHeaderKey
in class AbstractHttpRequest
public CharSegment getHeaderValue(int index)
getHeaderValue
in class AbstractHttpRequest
public java.lang.String getHeader(java.lang.String key)
getHeader
in class AbstractHttpRequest
key
- the header keypublic CharSegment getHeaderBuffer(char[] testBuf, int length)
testBuf
- header keylength
- length of the key.public CharSegment getHeaderBuffer(java.lang.String key)
getHeaderBuffer
in class AbstractHttpRequest
key
- the header namepublic void getHeaderBuffers(java.lang.String key, java.util.ArrayList<CharSegment> values)
getHeaderBuffers
in class AbstractHttpRequest
values
- ArrayList which will contain the maching values.key
- the header key to select.public java.util.Enumeration getHeaders(java.lang.String key)
getHeaders
in class AbstractHttpRequest
key
- the header key to match.public java.util.Enumeration getHeaderNames()
getHeaderNames
in class AbstractHttpRequest
public boolean initStream(ReadStream readStream, ReadStream rawRead) throws java.io.IOException
initStream
in class AbstractHttpRequest
java.io.IOException
public boolean isTop()
protected boolean checkLogin()
protected void startRequest() throws java.io.IOException
startRequest
in class AbstractHttpRequest
s
- the read stream for the requestjava.io.IOException
public boolean isSecure()
isSecure
in class AbstractHttpRequest
public ReadStream getRawInput()
getRawInput
in class AbstractHttpRequest
protected java.lang.String dbgId()
dbgId
in class AbstractHttpRequest
public java.lang.String toString()
toString
in class java.lang.Object