com.faunos.util.net.http
Class UnimplementedVerbResponseFactory
java.lang.Object
com.faunos.util.net.http.UnimplementedVerbResponseFactory
- All Implemented Interfaces:
- ResponseFactory
public class UnimplementedVerbResponseFactory
- extends Object
- implements ResponseFactory
Stop-gap interface wrapper for currently unimplemented HTTP verbs. The only
implemented verbs are Verb.GET and
Verb.HEAD.
TODO: Add a human readable entity in the response per the protocol.
- Author:
- Babak Farhang
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnimplementedVerbResponseFactory
public UnimplementedVerbResponseFactory(ResponseFactory inner)
- Creates an instance that wraps the given inner
instance.
getResponse
public Stagelet getResponse(RequestHeader request,
StageletStack stack,
boolean asynchHint)
- Allows only the implemented HTTP verbs to reach the contained
ResponseFactory instance. Otherwise, a stagelet
encapsulating the 501 (Unimplemented) HTTP response status is
returned.
- Specified by:
getResponse
in interface ResponseFactory
stack
- if the returned stagelet is itself stack-aware,
then it will push additional stagelets (e.g. the header response
stage) onto the given stack. The rules for when and how
stagelets can be pushed on the stack are described in the
Stagelet interface.asynchHint
- if true, then the response stagelet should try to process
non-network I/O based tasks asynchronously.- See Also:
Stagelet
,
HandletContext.processAsynch()