|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.faunos.util.net.http.RequestStage
public class RequestStage
The first stage in the implementation of HTTP. This class reads the HTTP request headers, and dispatches the processing to the next stage.
ResponseFactory| Constructor Summary | |
|---|---|
RequestStage(StageletStack stack,
ResponseFactory responseFactory)
|
|
RequestStage(StageletStack stack,
ResponseFactory responseFactory,
long maxHeaderSize)
|
|
| Method Summary | |
|---|---|
void |
discard()
Discards the instance. |
Map<String,String> |
getProperties()
Returns a name/value map encapsulating the HTTP request headers received. |
String |
getUri()
Returns the URI referenced in the first line of the HTTP request. |
Verb |
getVerb()
Returns the HTTP verb. |
String |
getVersion()
Returns the HTTP version string in the first line of the HTTP request. |
IoState |
init(HandletContext context)
Initializes the handlet. |
boolean |
isPersistentConnection()
Determines whether this will be a persistent connection. |
IoState |
read(ScatteringByteChannel in)
Reads from the specified channel and returns the possibly new state of the instance. |
void |
setCloseConnection()
|
IoState |
state()
Returns the state of the handlet. |
IoState |
unwind(IoState preState)
Callback method invoked when the previous stage[let] returned DONE. |
IoState |
write(GatheringByteChannel out)
Writes to the specified channel and returns the possibly new state of the instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequestStage(StageletStack stack,
ResponseFactory responseFactory)
public RequestStage(StageletStack stack,
ResponseFactory responseFactory,
long maxHeaderSize)
| Method Detail |
|---|
public Verb getVerb()
RequestHeader
getVerb in interface RequestHeaderpublic String getUri()
RequestHeader
getUri in interface RequestHeaderpublic String getVersion()
RequestHeader
getVersion in interface RequestHeaderpublic Map<String,String> getProperties()
RequestHeader
${name}: ${value} CRLF
getProperties in interface RequestHeaderpublic boolean isPersistentConnection()
RequestHeader
isPersistentConnection in interface RequestHeaderpublic void setCloseConnection()
public void discard()
Handlet
discard in interface Handletpublic IoState init(HandletContext context)
Handlet
init in interface Handletcontext - the context supplied by the instance's container (e.g.
server
public IoState read(ScatteringByteChannel in)
throws IOException
HandletHandlet.state() may
return a value other than PROCESSING, if the asynchronous
task completes before the call to state().
The implementation must read from the channel in non-blocking manner.
The behavior of this method is undefined if the state of the instance is not IoState.READING.
read in interface HandletIOExceptionpublic IoState state()
Handlet
state in interface Handletpublic IoState unwind(IoState preState)
StageletHandlet.discard() method on the super
interface.
unwind in interface StageletpreState - the state of the previous stage prior to its flipping to
DONE
Stagelet on the execution
stack, then that stage's unwind() method will also
be invoked with the same preState argument.
public IoState write(GatheringByteChannel out)
throws IOException,
UnsupportedOperationException
HandletHandlet.state() may
return a value other than PROCESSING, if the asynchronous
task completes before the call to state().
The implementation must write to the channel in non-blocking manner.
The behavior of this method is undefined if the state of the instance is not IoState.WRITING.
write in interface HandletIOException
UnsupportedOperationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||