Class BasicHttpServerExpectationDecorator
- java.lang.Object
-
- org.apache.hc.core5.http.io.support.BasicHttpServerExpectationDecorator
-
- All Implemented Interfaces:
HttpServerRequestHandler
public class BasicHttpServerExpectationDecorator extends java.lang.Object implements HttpServerRequestHandler
HttpServerRequestHandlerimplementation that adds support for the Expect-Continue handshake to an existingHttpServerRequestHandler.- Since:
- 5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.hc.core5.http.io.HttpServerRequestHandler
HttpServerRequestHandler.ResponseTrigger
-
-
Field Summary
Fields Modifier and Type Field Description private HttpServerRequestHandlerrequestHandler
-
Constructor Summary
Constructors Constructor Description BasicHttpServerExpectationDecorator(HttpServerRequestHandler requestHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandle(ClassicHttpRequest request, HttpServerRequestHandler.ResponseTrigger responseTrigger, HttpContext context)Handles the request and submits a final response to be sent back to the client.protected ClassicHttpResponseverify(ClassicHttpRequest request, HttpContext context)Verifies the HTTP request and decides whether it meets server expectations and the request processing can continue.
-
-
-
Field Detail
-
requestHandler
private final HttpServerRequestHandler requestHandler
-
-
Constructor Detail
-
BasicHttpServerExpectationDecorator
public BasicHttpServerExpectationDecorator(HttpServerRequestHandler requestHandler)
-
-
Method Detail
-
verify
protected ClassicHttpResponse verify(ClassicHttpRequest request, HttpContext context)
Verifies the HTTP request and decides whether it meets server expectations and the request processing can continue.- Parameters:
request- the incoming HTTP request.context- the actual execution context.- Returns:
nullif the request meets expectations or a final HTTP response with an error status representing the cause of expectation failure.
-
handle
public final void handle(ClassicHttpRequest request, HttpServerRequestHandler.ResponseTrigger responseTrigger, HttpContext context) throws HttpException, java.io.IOException
Description copied from interface:HttpServerRequestHandlerHandles the request and submits a final response to be sent back to the client.- Specified by:
handlein interfaceHttpServerRequestHandler- Parameters:
request- the actual request.responseTrigger- the response trigger.context- the actual execution context.- Throws:
HttpExceptionjava.io.IOException
-
-