Class HttpResponseDecoder.Result
java.lang.Object
org.jdrupes.httpcodec.Codec.Result
org.jdrupes.httpcodec.Decoder.Result<R>
org.jdrupes.httpcodec.protocols.http.HttpDecoder.Result<HttpRequest>
org.jdrupes.httpcodec.protocols.http.client.HttpResponseDecoder.Result
- All Implemented Interfaces:
Codec.ProtocolSwitchResult
- Enclosing class:
- HttpResponseDecoder
public abstract static class HttpResponseDecoder.Result
extends HttpDecoder.Result<HttpRequest>
implements Codec.ProtocolSwitchResult
The result from encoding a response.
In addition to the usual codec result, a result decoder may signal to the invoker that the connection to the responder must be closed.
The class is declared abstract to promote the usage of the factory method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classThe Factory for (extended) results. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()Decoder<?,?> The decoder to be used for the next message if a protocol switch occured.Encoder<?,?> The encoder to be used for the next message if a protocol switch occured.The name of the protocol to be used for the next request if a protocol switch occured.toString()Methods inherited from class org.jdrupes.httpcodec.Decoder.Result
isHeaderCompleted, isResponseOnly, responseMethods inherited from class org.jdrupes.httpcodec.Codec.Result
closeConnection, isOverflow, isUnderflow
-
Constructor Details
-
Result
protected Result(boolean overflow, boolean underflow, boolean closeConnection, boolean headerCompleted, String newProtocol, Encoder<?, ?> newEncoder, Decoder<?, ?> newDecoder) Returns a new result.- Parameters:
overflow- true if the data didn’t fit in the out bufferunderflow- true if more data is expectedcloseConnection- true if the connection should be closedheaderCompleted- indicates that the message header has been completed and the message (without body) is availablenewProtocol- the name of the new protocol if a switch occurrednewEncoder- the new decoder if a switch occurrednewDecoder- the new decoder if a switch occurred
-
-
Method Details
-
newProtocol
Description copied from interface:Codec.ProtocolSwitchResultThe name of the protocol to be used for the next request if a protocol switch occured.- Specified by:
newProtocolin interfaceCodec.ProtocolSwitchResult- Returns:
- the name or null if no protocol switch occured
-
newDecoder
Description copied from interface:Codec.ProtocolSwitchResultThe decoder to be used for the next message if a protocol switch occured.- Specified by:
newDecoderin interfaceCodec.ProtocolSwitchResult- Returns:
- the decoder or null if no protocol switch occurred
-
newEncoder
Description copied from interface:Codec.ProtocolSwitchResultThe encoder to be used for the next message if a protocol switch occured.- Specified by:
newEncoderin interfaceCodec.ProtocolSwitchResult- Returns:
- the encoder or null if no protocol switch occurred
-
hashCode
- Overrides:
hashCodein classDecoder.Result<HttpRequest>
-
equals
- Overrides:
equalsin classDecoder.Result<HttpRequest>
-
toString
- Overrides:
toStringin classDecoder.Result<HttpRequest>
-