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
Nested ClassesModifier and TypeClassDescriptionprotected static classA factory for creating new 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.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.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
-
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
-
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
-
hashCode
- Overrides:
hashCodein classCodec.Result
-
equals
- Overrides:
equalsin classCodec.Result
-
toString
- Overrides:
toStringin classCodec.Result
-