软件包 | 描述 |
---|---|
io.netty.handler.codec.http2 |
用于发送和接收HTTP / 2帧的处理程序。
|
Modifier and Type | Class and Description |
---|---|
static class |
Http2Exception.ClosedStreamCreationException
当流创建尝试失败时使用,但可能是因为流先前已关闭。
|
static class |
Http2Exception.CompositeStreamException
提供使用一个throw语句处理多个流异常的能力。
|
static class |
Http2Exception.HeaderListSizeException |
static class |
Http2Exception.StreamException
表示可以隔离到单个流的异常(与整个连接相反)。
|
class |
Http2NoMoreStreamIdsException
当当前连接不再有可用的流ID时抛出此异常
|
static class |
StreamBufferingEncoder.Http2ChannelClosedException
如果由于编码器关闭而导致缓冲流终止,则抛出。
|
static class |
StreamBufferingEncoder.Http2GoAwayException
如果缓冲流由于收到 GOAWAY 而终止,则由StreamBufferingEncoder 抛出。
|
Modifier and Type | Method and Description |
---|---|
static Http2Exception |
Http2Exception.closedStreamError(Http2Error error, java.lang.String fmt, java.lang.Object... args)
如果发生的错误不能隔离到单个流中,而是应用于整个连接,请使用此选项。
|
static Http2Exception |
Http2Exception.connectionError(Http2Error error, java.lang.String fmt, java.lang.Object... args)
如果发生的错误不能隔离到单个流中,而是应用于整个连接,请使用此选项。
|
static Http2Exception |
Http2Exception.connectionError(Http2Error error, java.lang.Throwable cause, java.lang.String fmt, java.lang.Object... args)
如果发生的错误不能隔离到单个流中,而是应用于整个连接,请使用此选项。
|
static Http2Exception |
Http2CodecUtil.getEmbeddedHttp2Exception(java.lang.Throwable cause)
迭代地通过因果关系链查找给定的异常,并返回第一个 Http2Exception 或null 如果没有)。
|
static Http2Exception |
Http2Exception.headerListSizeError(int id, Http2Error error, boolean onDecode, java.lang.String fmt, java.lang.Object... args)
由于无法解码超过最大标题大小列表的标题而导致的特定流错误。
|
static Http2Exception |
Http2Exception.streamError(int id, Http2Error error, java.lang.String fmt, java.lang.Object... args)
如果发生可以隔离到单个流的错误,请使用此选项。
|
static Http2Exception |
Http2Exception.streamError(int id, Http2Error error, java.lang.Throwable cause, java.lang.String fmt, java.lang.Object... args)
如果发生可以隔离到单个流的错误,请使用此选项。
|
Modifier and Type | Method and Description |
---|---|
static boolean |
Http2Exception.isStreamError(Http2Exception e)
检查一个异常是否被隔离到单个流或整个连接。
|
protected void |
Http2FrameCodec.onConnectionError(ChannelHandlerContext ctx, boolean outbound, java.lang.Throwable cause, Http2Exception http2Ex) |
protected void |
Http2ConnectionHandler.onConnectionError(ChannelHandlerContext ctx, boolean outbound, java.lang.Throwable cause, Http2Exception http2Ex)
处理程序出现连接错误。
|
static int |
Http2Exception.streamId(Http2Exception e)
获取与异常关联的流ID。
|
Modifier and Type | Method and Description |
---|---|
static void |
HttpConversionUtil.addHttp2ToHttpHeaders(int streamId, Http2Headers sourceHeaders, FullHttpMessage destinationMessage, boolean addToTrailer)
将HTTP / 2标头翻译并添加到HTTP / 1.x标头。
|
static void |
HttpConversionUtil.addHttp2ToHttpHeaders(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders, HttpVersion httpVersion, boolean isTrailer, boolean isRequest)
将HTTP / 2标头翻译并添加到HTTP / 1.x标头。
|
void |
Http2FlowController.channelHandlerContext(ChannelHandlerContext ctx)
设置应用流量控制的 ChannelHandlerContext 。
|
void |
DefaultHttp2RemoteFlowController.channelHandlerContext(ChannelHandlerContext ctx)
设置应用流量控制的 ChannelHandlerContext 。
|
void |
Http2RemoteFlowController.channelWritabilityChanged()
|
void |
DefaultHttp2RemoteFlowController.channelWritabilityChanged() |
boolean |
Http2LocalFlowController.consumeBytes(Http2Stream stream, int numBytes)
表示应用程序已经为给定流消耗了大量字节,因此准备从远程端点接收更多数据。
|
boolean |
DefaultHttp2LocalFlowController.consumeBytes(Http2Stream stream, int numBytes) |
Http2Stream |
Http2Connection.Endpoint.createStream(int streamId, boolean halfClosed)
创建由此端点启动的流。
|
void |
Http2ConnectionDecoder.decodeFrame(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out)
由 Http2ConnectionHandler 调用以解码来自输入缓冲器的下一帧。
|
void |
DefaultHttp2ConnectionDecoder.decodeFrame(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) |
void |
DecoratingHttp2ConnectionDecoder.decodeFrame(ChannelHandlerContext ctx, ByteBuf in, java.util.List<java.lang.Object> out) |
Http2Headers |
Http2HeadersDecoder.decodeHeaders(int streamId, ByteBuf headerBlock)
解码给定的标题块并返回标题。
|
Http2Headers |
DefaultHttp2HeadersDecoder.decodeHeaders(int streamId, ByteBuf headerBlock) |
boolean |
WeightedFairQueueByteDistributor.distribute(int maxBytes, StreamByteDistributor.Writer writer) |
boolean |
UniformStreamByteDistributor.distribute(int maxBytes, StreamByteDistributor.Writer writer) |
boolean |
StreamByteDistributor.distribute(int maxBytes, StreamByteDistributor.Writer writer)
将最多
maxBytes 给那些包含流传输字节的流并遍历这些流以写入适当的字节。
|
void |
Http2HeadersEncoder.encodeHeaders(int streamId, Http2Headers headers, ByteBuf buffer)
编码给定的标题并将输出标题块写入给定的输出缓冲区。
|
void |
DefaultHttp2HeadersEncoder.encodeHeaders(int streamId, Http2Headers headers, ByteBuf buffer) |
protected void |
Http2ChannelDuplexHandler.forEachActiveStream(Http2FrameStreamVisitor streamVisitor)
允许遍历所有当前活动的流。
|
Http2Stream |
Http2Connection.forEachActiveStream(Http2StreamVisitor visitor)
提供一种迭代活动流集合的方法。
|
Http2Stream |
DefaultHttp2Connection.forEachActiveStream(Http2StreamVisitor visitor) |
protected java.lang.CharSequence |
DelegatingDecompressorFrameListener.getTargetContentEncoding(java.lang.CharSequence contentEncoding)
返回解码内容的预期内容编码。
|
protected java.lang.CharSequence |
CompressorHttp2ConnectionEncoder.getTargetContentEncoding(java.lang.CharSequence contentEncoding)
返回解码内容的预期内容编码。
|
static void |
Http2CodecUtil.headerListSizeExceeded(int streamId, long maxHeaderListSize, boolean onDecode)
|
static void |
Http2CodecUtil.headerListSizeExceeded(long maxHeaderListSize)
由于以不可恢复的方式违反
SETTINGS_MAX_HEADER_LIST_SIZE ,因此发送GO_AWAY结果。
|
void |
Http2FlowController.incrementWindowSize(Http2Stream stream, int delta)
按给定的增量增加流的流量控制窗口的大小。
|
void |
DefaultHttp2RemoteFlowController.incrementWindowSize(Http2Stream stream, int delta) |
void |
DefaultHttp2LocalFlowController.incrementWindowSize(Http2Stream stream, int delta) |
void |
Http2FlowController.initialWindowSize(int newWindowSize)
设置连接范围的初始流量控制窗口并按增量更新所有流窗口(但不是连接流窗口)。
|
void |
DefaultHttp2RemoteFlowController.initialWindowSize(int newWindowSize) |
void |
DefaultHttp2LocalFlowController.initialWindowSize(int newWindowSize) |
void |
Http2FrameSizePolicy.maxFrameSize(int max)
设置允许的最大帧大小。
|
void |
DefaultHttp2FrameWriter.maxFrameSize(int max) |
void |
DefaultHttp2FrameReader.maxFrameSize(int max) |
void |
Http2HeadersEncoder.Configuration.maxHeaderListSize(long max)
|
void |
DefaultHttp2HeadersEncoder.maxHeaderListSize(long max) |
void |
Http2HeadersDecoder.Configuration.maxHeaderListSize(long max, long goAwayMax)
配置每组标题的最大允许大小(以字节为单位)。
|
void |
DefaultHttp2HeadersDecoder.maxHeaderListSize(long max, long goAwayMax) |
void |
Http2HeadersEncoder.Configuration.maxHeaderTableSize(long max)
|
void |
Http2HeadersDecoder.Configuration.maxHeaderTableSize(long max)
|
void |
DefaultHttp2HeadersEncoder.maxHeaderTableSize(long max) |
void |
DefaultHttp2HeadersDecoder.maxHeaderTableSize(long max) |
protected EmbeddedChannel |
CompressorHttp2ConnectionEncoder.newContentCompressor(ChannelHandlerContext ctx, java.lang.CharSequence contentEncoding)
返回一个新 EmbeddedChannel 编码指定编码的HTTP2消息内容contentEncoding 。
|
protected EmbeddedChannel |
DelegatingDecompressorFrameListener.newContentDecompressor(ChannelHandlerContext ctx, java.lang.CharSequence contentEncoding)
返回一个新的 EmbeddedChannel ,它解码在指定的contentEncoding 编码的contentEncoding 消息内容。
|
protected FullHttpMessage |
InboundHttp2ToHttpAdapter.newMessage(Http2Stream stream, Http2Headers headers, boolean validateHttpHeaders, ByteBufAllocator alloc)
根据当前连接参数创建一个新的 FullHttpMessage
|
int |
InboundHttp2ToHttpAdapter.onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) |
int |
Http2FrameListenerDecorator.onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) |
int |
Http2FrameListener.onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream)
处理入站
DATA 帧。
|
int |
Http2FrameAdapter.onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) |
int |
Http2EventAdapter.onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) |
int |
DelegatingDecompressorFrameListener.onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream) |
void |
Http2FrameListenerDecorator.onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData) |
void |
Http2FrameListener.onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData)
处理入站
GO_AWAY 帧。
|
void |
Http2FrameAdapter.onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData) |
void |
Http2EventAdapter.onGoAwayRead(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData) |
void |
InboundHttp2ToHttpAdapter.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endOfStream) |
void |
Http2FrameListenerDecorator.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream) |
void |
Http2FrameListener.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endOfStream)
处理入站
HEADERS 框架。
|
void |
Http2FrameAdapter.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream) |
void |
Http2EventAdapter.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream) |
void |
DelegatingDecompressorFrameListener.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream) |
void |
InboundHttp2ToHttpAdapter.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endOfStream) |
void |
Http2FrameListenerDecorator.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream) |
void |
Http2FrameListener.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endOfStream)
处理具有指定优先级信息的入站
HEADERS 帧。
|
void |
Http2FrameAdapter.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream) |
void |
Http2EventAdapter.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream) |
void |
DelegatingDecompressorFrameListener.onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream) |
void |
Http2ConnectionHandler.onHttpClientUpgrade()
将客户端(明文)从HTTP升级到HTTP / 2。
|
void |
Http2ConnectionHandler.onHttpServerUpgrade(Http2Settings settings)
将服务器端(明文)从HTTP升级到HTTP / 2。
|
void |
Http2FrameListenerDecorator.onPingAckRead(ChannelHandlerContext ctx, long data) |
void |
Http2FrameListener.onPingAckRead(ChannelHandlerContext ctx, long data)
处理入站
PING 确认。
|
void |
Http2FrameAdapter.onPingAckRead(ChannelHandlerContext ctx, long data) |
void |
Http2EventAdapter.onPingAckRead(ChannelHandlerContext ctx, long data) |
void |
Http2FrameListenerDecorator.onPingRead(ChannelHandlerContext ctx, long data) |
void |
Http2FrameListener.onPingRead(ChannelHandlerContext ctx, long data)
处理入站
PING 框架。
|
void |
Http2FrameAdapter.onPingRead(ChannelHandlerContext ctx, long data) |
void |
Http2EventAdapter.onPingRead(ChannelHandlerContext ctx, long data) |
void |
Http2FrameListenerDecorator.onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive) |
void |
Http2FrameListener.onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive)
处理入站
PRIORITY 框架。
|
void |
Http2FrameAdapter.onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive) |
void |
Http2EventAdapter.onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive) |
void |
InboundHttp2ToHttpAdapter.onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) |
void |
Http2FrameListenerDecorator.onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) |
void |
Http2FrameListener.onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding)
处理入站
PUSH_PROMISE 帧。
|
void |
Http2FrameAdapter.onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) |
void |
Http2EventAdapter.onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) |
void |
InboundHttp2ToHttpAdapter.onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) |
void |
Http2FrameListenerDecorator.onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) |
void |
Http2FrameListener.onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode)
处理入站
RST_STREAM 框架。
|
void |
Http2FrameAdapter.onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) |
void |
Http2EventAdapter.onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) |
void |
Http2FrameListenerDecorator.onSettingsAckRead(ChannelHandlerContext ctx) |
void |
Http2FrameListener.onSettingsAckRead(ChannelHandlerContext ctx)
处理入站
SETTINGS 确认帧。
|
void |
Http2FrameAdapter.onSettingsAckRead(ChannelHandlerContext ctx) |
void |
Http2EventAdapter.onSettingsAckRead(ChannelHandlerContext ctx) |
void |
InboundHttp2ToHttpAdapter.onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) |
void |
Http2FrameListenerDecorator.onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) |
void |
Http2FrameListener.onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings)
处理入站
SETTINGS 帧。
|
void |
Http2FrameAdapter.onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) |
void |
Http2EventAdapter.onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) |
void |
Http2FrameListenerDecorator.onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) |
void |
Http2FrameListener.onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload)
处理程序不是由HTTP / 2规范定义的。
|
void |
Http2EventAdapter.onUnknownFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload) |
void |
Http2FrameListenerDecorator.onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement) |
void |
Http2FrameListener.onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement)
处理入站
WINDOW_UPDATE 帧。
|
void |
Http2FrameAdapter.onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement) |
void |
Http2EventAdapter.onWindowUpdateRead(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement) |
Http2Stream |
Http2Stream.open(boolean halfClosed)
打开此流,使其可通过
Http2Connection.forEachActiveStream(Http2StreamVisitor) 和过渡状态可用:
Http2Stream.State.OPEN 如果
Http2Stream.state() 是
Http2Stream.State.IDLE 和
halfClosed 是
false 。
|
static HttpResponseStatus |
HttpConversionUtil.parseStatus(java.lang.CharSequence status)
在将状态代码翻译为 HttpResponseStatus 的同时应用HTTP / 2规则
|
protected FullHttpMessage |
InboundHttp2ToHttpAdapter.processHeadersBegin(ChannelHandlerContext ctx, Http2Stream stream, Http2Headers headers, boolean endOfStream, boolean allowAppend, boolean appendToTrailer)
提供HTTP / 2和HTTP头对象之间的转换,同时确保流处于额外头的有效状态。
|
void |
Http2InboundFrameLogger.readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener) |
void |
Http2FrameReader.readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener)
尝试从输入缓冲区读取下一帧。
|
void |
DefaultHttp2FrameReader.readFrame(ChannelHandlerContext ctx, ByteBuf input, Http2FrameListener listener) |
void |
Http2LocalFlowController.receiveFlowControlledFrame(Http2Stream stream, ByteBuf data, int padding, boolean endOfStream)
从远程端点
DATA 站
DATA 帧,并为
stream 以及连接应用流量控制策略。
|
void |
DefaultHttp2LocalFlowController.receiveFlowControlledFrame(Http2Stream stream, ByteBuf data, int padding, boolean endOfStream) |
void |
StreamBufferingEncoder.remoteSettings(Http2Settings settings) |
void |
Http2ConnectionEncoder.remoteSettings(Http2Settings settings)
设置HTTP / 2连接的远程端点的设置。
|
void |
DefaultHttp2ConnectionEncoder.remoteSettings(Http2Settings settings) |
void |
DecoratingHttp2ConnectionEncoder.remoteSettings(Http2Settings settings) |
Http2Stream |
Http2Connection.Endpoint.reservePushStream(int streamId, Http2Stream parent)
在此端点的保留状态中创建推送流并通知所有监听者。
|
static FullHttpRequest |
HttpConversionUtil.toFullHttpRequest(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc, boolean validateHttpHeaders)
创建一个新的对象来包含请求数据
|
static FullHttpResponse |
HttpConversionUtil.toFullHttpResponse(int streamId, Http2Headers http2Headers, ByteBufAllocator alloc, boolean validateHttpHeaders)
创建一个新的对象来包含响应数据
|
static HttpRequest |
HttpConversionUtil.toHttpRequest(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
创建一个新的对象来包含请求数据。
|
static HttpResponse |
HttpConversionUtil.toHttpResponse(int streamId, Http2Headers http2Headers, boolean validateHttpHeaders)
创建一个新的对象来包含响应数据。
|
boolean |
Http2StreamVisitor.visit(Http2Stream stream) |
float |
DefaultHttp2LocalFlowController.windowUpdateRatio(Http2Stream stream)
窗口更新比率用于确定何时必须发送窗口更新。
|
void |
DefaultHttp2LocalFlowController.windowUpdateRatio(Http2Stream stream, float ratio)
窗口更新比率用于确定何时必须发送窗口更新。
|
void |
Http2RemoteFlowController.writePendingBytes()
Write all data pending in the flow controller up to the flow-control limits.
|
void |
DefaultHttp2RemoteFlowController.writePendingBytes() |
Copyright © 2008–2018 The Netty Project. All rights reserved.