Package io.netty.handler.codec.http3
Class Http3FrameToHttpObjectCodec
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.http3.Http3RequestStreamInboundHandler
-
- io.netty.handler.codec.http3.Http3FrameToHttpObjectCodec
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
public final class Http3FrameToHttpObjectCodec extends Http3RequestStreamInboundHandler implements io.netty.channel.ChannelOutboundHandler
This handler converts fromHttp3RequestStreamFrametoHttpObject, and back. It can be used as an adapter in conjunction withHttp3ServerConnectionHandlerorHttp3ClientConnectionHandlerto make http/3 connections backward-compatible withChannelHandlers expectingHttpObject.For simplicity, it converts to chunked encoding unless the entire stream is a single header.
-
-
Constructor Summary
Constructors Constructor Description Http3FrameToHttpObjectCodec(boolean isServer)Http3FrameToHttpObjectCodec(boolean isServer, boolean validateHeaders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(io.netty.channel.ChannelHandlerContext ctx, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)protected voidchannelInputClosed(io.netty.channel.ChannelHandlerContext ctx)Called once the input is closed and so no more inbound data is received on it.protected voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Http3DataFrame frame)Called once aHttp3DataFrameis ready for this stream to process.protected voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Http3HeadersFrame frame)Called once aHttp3HeadersFrameis ready for this stream to process.voidclose(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)voidconnect(io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)voidderegister(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)voiddisconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)voidflush(io.netty.channel.ChannelHandlerContext ctx)booleanisSharable()voidread(io.netty.channel.ChannelHandlerContext ctx)voidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)Encode from anHttpObjectto anHttp3RequestStreamFrame.-
Methods inherited from class io.netty.handler.codec.http3.Http3RequestStreamInboundHandler
channelRead, channelRead, controlStream, exceptionCaught, handleHttp3Exception, handleQuicException, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved
-
-
-
-
Method Detail
-
isSharable
public boolean isSharable()
- Overrides:
isSharablein classio.netty.channel.ChannelHandlerAdapter
-
channelRead
protected void channelRead(io.netty.channel.ChannelHandlerContext ctx, Http3HeadersFrame frame) throws ExceptionDescription copied from class:Http3RequestStreamInboundHandlerCalled once aHttp3HeadersFrameis ready for this stream to process.- Specified by:
channelReadin classHttp3RequestStreamInboundHandler- Parameters:
ctx- theChannelHandlerContextof this handler.frame- theHttp3HeadersFramethat was read- Throws:
Exception- thrown if an error happens during processing.
-
channelRead
protected void channelRead(io.netty.channel.ChannelHandlerContext ctx, Http3DataFrame frame) throws ExceptionDescription copied from class:Http3RequestStreamInboundHandlerCalled once aHttp3DataFrameis ready for this stream to process.- Specified by:
channelReadin classHttp3RequestStreamInboundHandler- Parameters:
ctx- theChannelHandlerContextof this handler.frame- theHttp3DataFramethat was read- Throws:
Exception- thrown if an error happens during processing.
-
channelInputClosed
protected void channelInputClosed(io.netty.channel.ChannelHandlerContext ctx) throws ExceptionDescription copied from class:Http3RequestStreamInboundHandlerCalled once the input is closed and so no more inbound data is received on it.- Specified by:
channelInputClosedin classHttp3RequestStreamInboundHandler- Parameters:
ctx- theChannelHandlerContextof this handler.- Throws:
Exception- thrown if an error happens during processing.
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) throws ExceptionEncode from anHttpObjectto anHttp3RequestStreamFrame. 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:
writein interfaceio.netty.channel.ChannelOutboundHandler- Parameters:
ctx- theChannelHandlerContextwhich this handler belongs tomsg- theHttpObjectmessage to encode- Throws:
Exception- is thrown if an error occurs
-
flush
public void flush(io.netty.channel.ChannelHandlerContext ctx)
- Specified by:
flushin interfaceio.netty.channel.ChannelOutboundHandler
-
bind
public void bind(io.netty.channel.ChannelHandlerContext ctx, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)- Specified by:
bindin interfaceio.netty.channel.ChannelOutboundHandler
-
connect
public void connect(io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, io.netty.channel.ChannelPromise promise)- Specified by:
connectin interfaceio.netty.channel.ChannelOutboundHandler
-
disconnect
public void disconnect(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)- Specified by:
disconnectin interfaceio.netty.channel.ChannelOutboundHandler
-
close
public void close(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)- Specified by:
closein interfaceio.netty.channel.ChannelOutboundHandler
-
deregister
public void deregister(io.netty.channel.ChannelHandlerContext ctx, io.netty.channel.ChannelPromise promise)- Specified by:
deregisterin interfaceio.netty.channel.ChannelOutboundHandler
-
-