Class HttpRequestDecoder.Result.Factory
java.lang.Object
org.jdrupes.httpcodec.Codec.Result.Factory
org.jdrupes.httpcodec.Decoder.Result.Factory<R>
org.jdrupes.httpcodec.protocols.http.HttpDecoder.Result.Factory<HttpResponse>
org.jdrupes.httpcodec.protocols.http.server.HttpRequestDecoder.Result.Factory
- Enclosing class:
- HttpRequestDecoder.Result
protected static class HttpRequestDecoder.Result.Factory
extends HttpDecoder.Result.Factory<HttpResponse>
-
Constructor Summary
ModifierConstructorDescriptionprotected
Factory
(HttpRequestDecoder decoder) Creates a new factory for the given decoder. -
Method Summary
Modifier and TypeMethodDescriptionprotected HttpRequestDecoder.Result
newResult
(boolean overflow, boolean underflow) Overrides the base interface’s factory method in order to make it return the extended return type.newResult
(boolean overflow, boolean underflow, boolean headerCompleted, HttpResponse response, boolean responseOnly) Create a new result.
-
Constructor Details
-
Factory
Creates a new factory for the given decoder.- Parameters:
decoder
- the decoder
-
-
Method Details
-
newResult
public HttpRequestDecoder.Result newResult(boolean overflow, boolean underflow, boolean headerCompleted, HttpResponse response, boolean responseOnly) Create a new result.- Parameters:
overflow
- true if the data didn’t fit in the out bufferunderflow
- true if more data is expectedheaderCompleted
- true if the header has completely been decodedresponse
- a response to send due to an errorresponseOnly
- if the result includes a response this flag indicates that no further processing besides sending the response is required- Returns:
- the result
-
newResult
Overrides the base interface’s factory method in order to make it return the extended return type.As the
HttpRequestDecoder
does not know about a response, this implementation always returns a result without one. This may be a preliminary result and replaced inHttpRequestDecoder.decode(ByteBuffer, Buffer, boolean)
.- Specified by:
newResult
in classHttpDecoder.Result.Factory<HttpResponse>
- Parameters:
overflow
- true if the data didn’t fit in the out bufferunderflow
- true if more data is expected- Returns:
- the result
-