Class HttpResponseEncoder.Result
java.lang.Object
org.jdrupes.httpcodec.Codec.Result
org.jdrupes.httpcodec.protocols.http.HttpEncoder.Result
org.jdrupes.httpcodec.protocols.http.server.HttpResponseEncoder.Result
- All Implemented Interfaces:
Codec.ProtocolSwitchResult
- Enclosing class:
- HttpResponseEncoder
public abstract static class HttpResponseEncoder.Result
extends HttpEncoder.Result
implements Codec.ProtocolSwitchResult
The result from encoding a response.
In addition to the usual codec result, a response encoder may signal to the invoker that the connection to the requester must be closed and that the protocol has been switched.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
A factory for creating new 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.Codec.Result
closeConnection, isOverflow, isUnderflow
-
Constructor Details
-
Result
protected Result(boolean overflow, boolean underflow, boolean closeConnection, String newProtocol, Decoder<?, ?> newDecoder, Encoder<?, ?> newEncoder) 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 closednewProtocol
- the name of the new protocol if a switch occurrednewDecoder
- the new decoder if a switch occurrednewEncoder
- 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
-
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
-
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
-
hashCode
- Overrides:
hashCode
in classCodec.Result
-
equals
- Overrides:
equals
in classCodec.Result
-
toString
- Overrides:
toString
in classCodec.Result
-