@Contract(threading=STATELESS) public class HttpServerExpectationFilter extends Object implements HttpFilterHandler
Constructor and Description |
---|
HttpServerExpectationFilter() |
Modifier and Type | Method and Description |
---|---|
protected HttpEntity |
generateResponseContent(HttpResponse expectationFailed)
Generates response content entity for the final HTTP response with an error status
representing the cause of expectation failure.
|
void |
handle(ClassicHttpRequest request,
HttpFilterChain.ResponseTrigger responseTrigger,
HttpContext context,
HttpFilterChain chain)
Processes the incoming HTTP request and if processing has been completed
submits a final response to the client.
|
protected boolean |
verify(ClassicHttpRequest request,
HttpContext context)
Verifies the HTTP request and decides whether it meets server expectations and the request
processing can continue.
|
protected boolean verify(ClassicHttpRequest request, HttpContext context) throws HttpException
request
- the incoming HTTP request.context
- the actual execution context.true
if the request meets expectations or false
otherwise.HttpException
- in case of an HTTP protocol violation.protected HttpEntity generateResponseContent(HttpResponse expectationFailed) throws HttpException
expectationFailed
- the final HTTP response.HttpException
- in case of an HTTP protocol violation.public final void handle(ClassicHttpRequest request, HttpFilterChain.ResponseTrigger responseTrigger, HttpContext context, HttpFilterChain chain) throws HttpException, IOException
HttpFilterHandler
HttpFilterChain.proceed(ClassicHttpRequest, HttpFilterChain.ResponseTrigger, HttpContext)
method.handle
in interface HttpFilterHandler
request
- the actual request.responseTrigger
- the response trigger.context
- the actual execution context.chain
- the next element in the request processing chain.HttpException
- in case of an HTTP protocol violation.IOException
- in case of an I/O error.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.