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
Modifier and TypeClassDescriptionprotected static class
The Factory for (extended) results. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
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, response
Methods 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.ProtocolSwitchResult
The name of the protocol to be used for the next request if a protocol switch occured.- Specified by:
newProtocol
in interfaceCodec.ProtocolSwitchResult
- Returns:
- the name or null if no protocol switch occured
-
newDecoder
Description copied from interface:Codec.ProtocolSwitchResult
The decoder to be used for the next message if a protocol switch occured.- Specified by:
newDecoder
in interfaceCodec.ProtocolSwitchResult
- Returns:
- the decoder or null if no protocol switch occurred
-
newEncoder
Description copied from interface:Codec.ProtocolSwitchResult
The encoder to be used for the next message if a protocol switch occured.- Specified by:
newEncoder
in interfaceCodec.ProtocolSwitchResult
- Returns:
- the encoder or null if no protocol switch occurred
-
hashCode
- Overrides:
hashCode
in classDecoder.Result<HttpRequest>
-
equals
- Overrides:
equals
in classDecoder.Result<HttpRequest>
-
toString
- Overrides:
toString
in classDecoder.Result<HttpRequest>
-