@UnstableApi public class Http2ServerDowngrader extends MessageToMessageCodec<Http2StreamFrame,HttpObject>
Http2StreamFrame
to HttpObject
, and back. For simplicity, it converts to chunked encoding
unless the entire stream is a single header.ChannelHandler.Sharable
Modifier and Type | Field and Description |
---|---|
private boolean |
validateHeaders |
Constructor and Description |
---|
Http2ServerDowngrader() |
Http2ServerDowngrader(boolean validateHeaders) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptInboundMessage(java.lang.Object msg)
Returns
true if and only if the specified message can be decoded by this codec. |
protected void |
decode(ChannelHandlerContext ctx,
Http2StreamFrame frame,
java.util.List<java.lang.Object> out) |
protected void |
encode(ChannelHandlerContext ctx,
HttpObject obj,
java.util.List<java.lang.Object> out) |
private void |
encodeLastContent(LastHttpContent last,
java.util.List<java.lang.Object> out) |
acceptOutboundMessage, channelRead, write
bind, close, connect, deregister, disconnect, flush, read
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public Http2ServerDowngrader(boolean validateHeaders)
public Http2ServerDowngrader()
public boolean acceptInboundMessage(java.lang.Object msg) throws java.lang.Exception
MessageToMessageCodec
true
if and only if the specified message can be decoded by this codec.acceptInboundMessage
in class MessageToMessageCodec<Http2StreamFrame,HttpObject>
msg
- the messagejava.lang.Exception
protected void decode(ChannelHandlerContext ctx, Http2StreamFrame frame, java.util.List<java.lang.Object> out) throws java.lang.Exception
decode
in class MessageToMessageCodec<Http2StreamFrame,HttpObject>
java.lang.Exception
MessageToMessageDecoder.decode(ChannelHandlerContext, Object, List)
private void encodeLastContent(LastHttpContent last, java.util.List<java.lang.Object> out)
protected void encode(ChannelHandlerContext ctx, HttpObject obj, java.util.List<java.lang.Object> out) throws java.lang.Exception
encode
in class MessageToMessageCodec<Http2StreamFrame,HttpObject>
java.lang.Exception
MessageToMessageEncoder.encode(ChannelHandlerContext, Object, List)