Package org.infinispan.rest
Class Http11To2UpgradeHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.ssl.ApplicationProtocolNegotiationHandler
-
- org.infinispan.rest.Http11To2UpgradeHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
@Sharable public class Http11To2UpgradeHandler extends io.netty.handler.ssl.ApplicationProtocolNegotiationHandler
Handler responsible for TLS/ALPN negotiation as well as HTTP/1.1 Upgrade header handling- Author:
- Sebastian Ćaskawiec
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
MAX_HEADER_SIZE
protected static int
MAX_INITIAL_LINE_SIZE
protected RestServer
restServer
-
Constructor Summary
Constructors Constructor Description Http11To2UpgradeHandler(RestServer restServer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureHttp1(io.netty.channel.ChannelPipeline pipeline)
protected void
configureHttp2(io.netty.channel.ChannelPipeline pipeline)
void
configurePipeline(io.netty.channel.ChannelHandlerContext ctx, String protocol)
void
configurePipeline(io.netty.channel.ChannelPipeline pipeline, String protocol)
io.netty.handler.ssl.ApplicationProtocolConfig
getAlpnConfiguration()
protected io.netty.handler.codec.http2.HttpToHttp2ConnectionHandler
getHttp11To2ConnectionHandler()
Creates a handler for HTTP/1.1 -> HTTP/2 upgradeio.netty.channel.ChannelHandler
getHttp1Handler()
Gets HTTP/1.1 handler.io.netty.channel.ChannelHandler
getHttp2Handler()
Gets HTTP/2 handler.protected int
maxContentLength()
-
Methods inherited from class io.netty.handler.ssl.ApplicationProtocolNegotiationHandler
exceptionCaught, handshakeFailure, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
MAX_INITIAL_LINE_SIZE
protected static final int MAX_INITIAL_LINE_SIZE
- See Also:
- Constant Field Values
-
MAX_HEADER_SIZE
protected static final int MAX_HEADER_SIZE
- See Also:
- Constant Field Values
-
restServer
protected final RestServer restServer
-
-
Constructor Detail
-
Http11To2UpgradeHandler
public Http11To2UpgradeHandler(RestServer restServer)
-
-
Method Detail
-
configurePipeline
public void configurePipeline(io.netty.channel.ChannelHandlerContext ctx, String protocol) throws Exception
- Specified by:
configurePipeline
in classio.netty.handler.ssl.ApplicationProtocolNegotiationHandler
- Throws:
Exception
-
configurePipeline
public void configurePipeline(io.netty.channel.ChannelPipeline pipeline, String protocol)
-
configureHttp2
protected void configureHttp2(io.netty.channel.ChannelPipeline pipeline)
-
configureHttp1
protected void configureHttp1(io.netty.channel.ChannelPipeline pipeline)
-
maxContentLength
protected int maxContentLength()
-
getHttp11To2ConnectionHandler
protected io.netty.handler.codec.http2.HttpToHttp2ConnectionHandler getHttp11To2ConnectionHandler()
Creates a handler for HTTP/1.1 -> HTTP/2 upgrade- Returns:
- new instance of
HttpToHttp2ConnectionHandler
.
-
getHttp1Handler
public io.netty.channel.ChannelHandler getHttp1Handler()
Gets HTTP/1.1 handler.- Returns:
- HTTP/1.1 handler.
-
getHttp2Handler
public io.netty.channel.ChannelHandler getHttp2Handler()
Gets HTTP/2 handler.- Returns:
- HTTP/2 handler.
-
getAlpnConfiguration
public io.netty.handler.ssl.ApplicationProtocolConfig getAlpnConfiguration()
-
-