Package com.linkedin.alpini.netty4.http2
Class AbstractHttp2StreamFrameCodec
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,io.netty.handler.codec.http.HttpObject>
com.linkedin.alpini.netty4.http2.AbstractHttp2StreamFrameCodec
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
- Direct Known Subclasses:
Http2StreamFrameServerCodec
public abstract class AbstractHttp2StreamFrameCodec
extends io.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,io.netty.handler.codec.http.HttpObject>
A copy of the netty Http2StreamFrameToHttpObjectCodec except with the
methods which actually return the converted objects have been made abstract.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final List<io.netty.util.AsciiString>The set of headers that should not be directly copied when converting headers from HTTP to HTTP/2. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected static io.netty.channel.ChannelconnectionChannel(io.netty.channel.ChannelHandlerContext ctx) protected static io.netty.handler.codec.http.HttpSchemeconnectionScheme(io.netty.channel.ChannelHandlerContext ctx) protected static io.netty.util.Attribute<io.netty.handler.codec.http.HttpScheme>connectionSchemeAttribute(io.netty.channel.ChannelHandlerContext ctx) protected voiddecode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http2.Http2StreamFrame frame, List<Object> out) protected voidencode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject obj, List<Object> out) Encode from anHttpObjectto anHttp2StreamFrame.voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) protected booleanisSsl(io.netty.channel.ChannelHandlerContext ctx) protected abstract io.netty.handler.codec.http.FullHttpMessagenewFullMessage(int id, io.netty.handler.codec.http2.Http2Headers headers, boolean validateHeaders, io.netty.buffer.ByteBufAllocator alloc) protected abstract io.netty.handler.codec.http.HttpMessagenewMessage(int id, io.netty.handler.codec.http2.Http2Headers headers, boolean validateHeaders) protected abstract io.netty.handler.codec.http2.Http2HeaderstoHttp2Headers(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage msg, boolean validateHeaders) Methods inherited from class io.netty.handler.codec.MessageToMessageCodec
acceptOutboundMessage, channelRead, writeMethods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Field Details
-
HTTP_TO_HTTP2_HEADER_DENY_LIST
The set of headers that should not be directly copied when converting headers from HTTP to HTTP/2.
-
-
Constructor Details
-
AbstractHttp2StreamFrameCodec
protected AbstractHttp2StreamFrameCodec(boolean validateHeaders)
-
-
Method Details
-
acceptInboundMessage
- Overrides:
acceptInboundMessagein classio.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,io.netty.handler.codec.http.HttpObject> - Throws:
Exception
-
decode
protected void decode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http2.Http2StreamFrame frame, List<Object> out) throws Exception - Specified by:
decodein classio.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,io.netty.handler.codec.http.HttpObject> - Throws:
Exception
-
encode
protected void encode(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject obj, List<Object> out) throws Exception Encode from anHttpObjectto anHttp2StreamFrame. This method will be called for each written message that can be handled by this encoder. NOTE: 100-Continue responses that are NOTFullHttpResponsewill be rejected.- Specified by:
encodein classio.netty.handler.codec.MessageToMessageCodec<io.netty.handler.codec.http2.Http2StreamFrame,io.netty.handler.codec.http.HttpObject> - Parameters:
ctx- theChannelHandlerContextwhich this handler belongs toobj- theHttpObjectmessage to encodeout- theListinto which the encoded msg should be added needs to do some kind of aggregation- Throws:
Exception- is thrown if an error occurs
-
toHttp2Headers
protected abstract io.netty.handler.codec.http2.Http2Headers toHttp2Headers(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpMessage msg, boolean validateHeaders) throws io.netty.handler.codec.http2.Http2Exception - Throws:
io.netty.handler.codec.http2.Http2Exception
-
newMessage
protected abstract io.netty.handler.codec.http.HttpMessage newMessage(int id, io.netty.handler.codec.http2.Http2Headers headers, boolean validateHeaders) throws io.netty.handler.codec.http2.Http2Exception - Throws:
io.netty.handler.codec.http2.Http2Exception
-
newFullMessage
protected abstract io.netty.handler.codec.http.FullHttpMessage newFullMessage(int id, io.netty.handler.codec.http2.Http2Headers headers, boolean validateHeaders, io.netty.buffer.ByteBufAllocator alloc) throws io.netty.handler.codec.http2.Http2Exception - Throws:
io.netty.handler.codec.http2.Http2Exception
-
handlerAdded
- Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-
isSsl
protected boolean isSsl(io.netty.channel.ChannelHandlerContext ctx) -
connectionScheme
protected static io.netty.handler.codec.http.HttpScheme connectionScheme(io.netty.channel.ChannelHandlerContext ctx) -
connectionSchemeAttribute
protected static io.netty.util.Attribute<io.netty.handler.codec.http.HttpScheme> connectionSchemeAttribute(io.netty.channel.ChannelHandlerContext ctx) -
connectionChannel
protected static io.netty.channel.Channel connectionChannel(io.netty.channel.ChannelHandlerContext ctx)
-