[#5088] Add annotation which marks packages/interfaces/classes as unstable
Motivation: Some codecs should be considered unstable as these are relative new. For this purpose we should introduce an annotation which these codecs should us to be marked as unstable in terms of API. Modifications: - Add UnstableApi annotation and use it on codecs that are not stable - Move http2.hpack to http2.internal.hpack as it is internal. Result: Better document unstable APIs.
This commit is contained in:
parent
b39c53ce17
commit
9229ed98e2
@ -21,6 +21,7 @@ import io.netty.util.ReferenceCounted;
|
||||
import io.netty.util.ResourceLeak;
|
||||
import io.netty.util.ResourceLeakDetector;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -30,6 +31,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
/**
|
||||
* A skeletal implementation of {@link DnsMessage}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public abstract class AbstractDnsMessage extends AbstractReferenceCounted implements DnsMessage {
|
||||
|
||||
private static final ResourceLeakDetector<DnsMessage> leakDetector =
|
||||
|
@ -16,6 +16,7 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.IDN;
|
||||
|
||||
@ -24,6 +25,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
/**
|
||||
* A skeletal implementation of {@link DnsRecord}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public abstract class AbstractDnsRecord implements DnsRecord {
|
||||
|
||||
private final String name;
|
||||
|
@ -16,6 +16,7 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.channel.AddressedEnvelope;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
@ -23,6 +24,7 @@ import java.net.SocketAddress;
|
||||
/**
|
||||
* A {@link DnsQuery} implementation for UDP/IP.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DatagramDnsQuery extends DefaultDnsQuery
|
||||
implements AddressedEnvelope<DatagramDnsQuery, InetSocketAddress> {
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.socket.DatagramPacket;
|
||||
import io.netty.handler.codec.CorruptedFrameException;
|
||||
import io.netty.handler.codec.MessageToMessageDecoder;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.List;
|
||||
@ -30,6 +31,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
/**
|
||||
* Decodes a {@link DatagramPacket} into a {@link DatagramDnsQuery}.
|
||||
*/
|
||||
@UnstableApi
|
||||
@ChannelHandler.Sharable
|
||||
public class DatagramDnsQueryDecoder extends MessageToMessageDecoder<DatagramPacket> {
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.socket.DatagramPacket;
|
||||
import io.netty.handler.codec.MessageToMessageEncoder;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.List;
|
||||
@ -31,6 +32,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
* Encodes a {@link DatagramDnsQuery} (or an {@link AddressedEnvelope} of {@link DnsQuery}} into a
|
||||
* {@link DatagramPacket}.
|
||||
*/
|
||||
@UnstableApi
|
||||
@ChannelHandler.Sharable
|
||||
public class DatagramDnsQueryEncoder extends MessageToMessageEncoder<AddressedEnvelope<DnsQuery, InetSocketAddress>> {
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.channel.AddressedEnvelope;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
@ -23,6 +24,7 @@ import java.net.SocketAddress;
|
||||
/**
|
||||
* A {@link DnsResponse} implementation for UDP/IP.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DatagramDnsResponse extends DefaultDnsResponse
|
||||
implements AddressedEnvelope<DatagramDnsResponse, InetSocketAddress> {
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.socket.DatagramPacket;
|
||||
import io.netty.handler.codec.CorruptedFrameException;
|
||||
import io.netty.handler.codec.MessageToMessageDecoder;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.List;
|
||||
@ -30,6 +31,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
/**
|
||||
* Decodes a {@link DatagramPacket} into a {@link DatagramDnsResponse}.
|
||||
*/
|
||||
@UnstableApi
|
||||
@ChannelHandler.Sharable
|
||||
public class DatagramDnsResponseDecoder extends MessageToMessageDecoder<DatagramPacket> {
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.socket.DatagramPacket;
|
||||
import io.netty.handler.codec.MessageToMessageEncoder;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.List;
|
||||
@ -31,6 +32,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
* Encodes a {@link DatagramDnsResponse} (or an {@link AddressedEnvelope} of {@link DnsResponse}} into a
|
||||
* {@link DatagramPacket}.
|
||||
*/
|
||||
@UnstableApi
|
||||
@ChannelHandler.Sharable
|
||||
public class DatagramDnsResponseEncoder
|
||||
extends MessageToMessageEncoder<AddressedEnvelope<DnsResponse, InetSocketAddress>> {
|
||||
|
@ -18,7 +18,9 @@ package io.netty.handler.codec.dns;
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
@UnstableApi
|
||||
public class DefaultDnsPtrRecord extends AbstractDnsRecord implements DnsPtrRecord {
|
||||
|
||||
private final String hostname;
|
||||
@ -27,7 +29,6 @@ public class DefaultDnsPtrRecord extends AbstractDnsRecord implements DnsPtrReco
|
||||
* Creates a new PTR record.
|
||||
*
|
||||
* @param name the domain name
|
||||
* @param type the type of the record
|
||||
* @param dnsClass the class of the record, usually one of the following:
|
||||
* <ul>
|
||||
* <li>{@link #CLASS_IN}</li>
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* The default {@link DnsQuery} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultDnsQuery extends AbstractDnsMessage implements DnsQuery {
|
||||
|
||||
/**
|
||||
|
@ -16,10 +16,12 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* The default {@link DnsQuestion} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultDnsQuestion extends AbstractDnsRecord implements DnsQuestion {
|
||||
|
||||
/**
|
||||
|
@ -17,12 +17,14 @@ package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* The default {@code DnsRawRecord} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultDnsRawRecord extends AbstractDnsRecord implements DnsRawRecord {
|
||||
|
||||
private final ByteBuf content;
|
||||
|
@ -18,12 +18,14 @@ package io.netty.handler.codec.dns;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.handler.codec.CorruptedFrameException;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* The default {@link DnsRecordDecoder} implementation.
|
||||
*
|
||||
* @see DefaultDnsRecordEncoder
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultDnsRecordDecoder implements DnsRecordDecoder {
|
||||
|
||||
static final String ROOT = ".";
|
||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.handler.codec.UnsupportedMessageTypeException;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.handler.codec.dns.DefaultDnsRecordDecoder.ROOT;
|
||||
|
||||
@ -27,6 +28,7 @@ import static io.netty.handler.codec.dns.DefaultDnsRecordDecoder.ROOT;
|
||||
*
|
||||
* @see DefaultDnsRecordDecoder
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultDnsRecordEncoder implements DnsRecordEncoder {
|
||||
|
||||
/**
|
||||
|
@ -15,11 +15,14 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* The default {@link DnsResponse} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultDnsResponse extends AbstractDnsMessage implements DnsResponse {
|
||||
|
||||
private boolean authoritativeAnswer;
|
||||
|
@ -16,10 +16,12 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.ReferenceCounted;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* The superclass which contains core information concerning a {@link DnsQuery} and a {@link DnsResponse}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsMessage extends ReferenceCounted {
|
||||
|
||||
/**
|
||||
|
@ -15,11 +15,14 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* The DNS {@code OpCode} as defined in <a href="https://tools.ietf.org/html/rfc2929">RFC2929</a>.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DnsOpCode implements Comparable<DnsOpCode> {
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,9 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
@UnstableApi
|
||||
public interface DnsPtrRecord extends DnsRecord {
|
||||
|
||||
/**
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A DNS query message.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsQuery extends DnsMessage {
|
||||
@Override
|
||||
DnsQuery setId(int id);
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A DNS question.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsQuestion extends DnsRecord {
|
||||
/**
|
||||
* An unused property. This method will always return {@code 0}.
|
||||
|
@ -16,10 +16,12 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.buffer.ByteBufHolder;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A generic {@link DnsRecord} that contains an undecoded {@code RDATA}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsRawRecord extends DnsRecord, ByteBufHolder {
|
||||
@Override
|
||||
DnsRawRecord copy();
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A DNS resource record.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsRecord {
|
||||
|
||||
/**
|
||||
|
@ -16,12 +16,14 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Decodes a DNS record into its object representation.
|
||||
*
|
||||
* @see DatagramDnsResponseDecoder
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsRecordDecoder {
|
||||
|
||||
DnsRecordDecoder DEFAULT = new DefaultDnsRecordDecoder();
|
||||
|
@ -16,12 +16,14 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Encodes a {@link DnsRecord} into binary representation.
|
||||
*
|
||||
* @see DatagramDnsQueryEncoder
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsRecordEncoder {
|
||||
|
||||
DnsRecordEncoder DEFAULT = new DefaultDnsRecordEncoder();
|
||||
|
@ -16,6 +16,7 @@
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.collection.IntObjectHashMap;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@ -23,6 +24,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Represents a DNS record type.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DnsRecordType implements Comparable<DnsRecordType> {
|
||||
|
||||
/**
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A DNS response message.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface DnsResponse extends DnsMessage {
|
||||
|
||||
/**
|
||||
|
@ -15,11 +15,14 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* The DNS {@code RCODE}, as defined in <a href="https://tools.ietf.org/html/rfc2929">RFC2929</a>.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DnsResponseCode implements Comparable<DnsResponseCode> {
|
||||
|
||||
/**
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Represents a section of a {@link DnsMessage}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public enum DnsSection {
|
||||
/**
|
||||
* The section that contains {@link DnsQuestion}s.
|
||||
|
@ -17,4 +17,7 @@
|
||||
/**
|
||||
* DNS codec.
|
||||
*/
|
||||
@UnstableApi
|
||||
package io.netty.handler.codec.dns;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
@ -17,6 +17,7 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.handler.codec.http2.Http2HeadersEncoder.SensitivityDetector;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
@ -66,6 +67,7 @@ import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
* @param <T> The type of handler created by this builder.
|
||||
* @param <B> The concrete type of this builder.
|
||||
*/
|
||||
@UnstableApi
|
||||
public abstract class AbstractHttp2ConnectionHandlerBuilder<T extends Http2ConnectionHandler,
|
||||
B extends AbstractHttp2ConnectionHandlerBuilder<T, B>> {
|
||||
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Abstract implementation of {@link Http2StreamFrame}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public abstract class AbstractHttp2StreamFrame implements Http2StreamFrame {
|
||||
private Object stream;
|
||||
|
||||
|
@ -15,12 +15,14 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.handler.codec.TooLongFrameException;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* A skeletal builder implementation of {@link InboundHttp2ToHttpAdapter} and its subtypes.
|
||||
*/
|
||||
@UnstableApi
|
||||
public abstract class AbstractInboundHttp2ToHttpAdapterBuilder<
|
||||
T extends InboundHttp2ToHttpAdapter, B extends AbstractInboundHttp2ToHttpAdapterBuilder<T, B>> {
|
||||
|
||||
|
@ -24,6 +24,7 @@ import io.netty.handler.codec.ByteToMessageDecoder;
|
||||
import io.netty.handler.codec.compression.ZlibCodecFactory;
|
||||
import io.netty.handler.codec.compression.ZlibWrapper;
|
||||
import io.netty.util.concurrent.PromiseCombiner;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_ENCODING;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
|
||||
@ -37,6 +38,7 @@ import static io.netty.handler.codec.http.HttpHeaderValues.X_GZIP;
|
||||
* A decorating HTTP2 encoder that will compress data frames according to the {@code content-encoding} header for each
|
||||
* stream. The compression provided by this class will be applied to the data for the entire stream.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class CompressorHttp2ConnectionEncoder extends DecoratingHttp2ConnectionEncoder {
|
||||
public static final int DEFAULT_COMPRESSION_LEVEL = 6;
|
||||
public static final int DEFAULT_WINDOW_BITS = 15;
|
||||
|
@ -18,12 +18,14 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Decorator around another {@link Http2ConnectionDecoder} instance.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DecoratingHttp2ConnectionDecoder implements Http2ConnectionDecoder {
|
||||
private final Http2ConnectionDecoder delegate;
|
||||
|
||||
|
@ -14,11 +14,14 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* A decorator around another {@link Http2ConnectionEncoder} instance.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DecoratingHttp2ConnectionEncoder extends DecoratingHttp2FrameWriter implements Http2ConnectionEncoder {
|
||||
private final Http2ConnectionEncoder delegate;
|
||||
|
||||
|
@ -20,10 +20,12 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Decorator around another {@link Http2FrameWriter} instance.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DecoratingHttp2FrameWriter implements Http2FrameWriter {
|
||||
private final Http2FrameWriter delegate;
|
||||
|
||||
|
@ -28,6 +28,7 @@ import io.netty.util.concurrent.UnaryPromiseNotifier;
|
||||
import io.netty.util.internal.EmptyArrays;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import io.netty.util.internal.SystemPropertyUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
|
||||
@ -63,6 +64,7 @@ import static java.lang.Math.max;
|
||||
/**
|
||||
* Simple implementation of {@link Http2Connection}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultHttp2Connection implements Http2Connection {
|
||||
private static final InternalLogger logger = InternalLoggerFactory.getInstance(DefaultHttp2Connection.class);
|
||||
// Fields accessed by inner classes
|
||||
|
@ -17,6 +17,7 @@ package io.netty.handler.codec.http2;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.http2.Http2Exception.ClosedStreamCreationException;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
|
||||
@ -41,6 +42,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
* This interface enforces inbound flow control functionality through
|
||||
* {@link Http2LocalFlowController}
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultHttp2ConnectionDecoder implements Http2ConnectionDecoder {
|
||||
private static final InternalLogger logger = InternalLoggerFactory.getInstance(DefaultHttp2ConnectionDecoder.class);
|
||||
private Http2FrameListener internalFrameListener = new PrefaceFrameListener();
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.channel.CoalescingBufferQueue;
|
||||
import io.netty.handler.codec.http2.Http2Exception.ClosedStreamCreationException;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
|
||||
@ -33,6 +34,7 @@ import static java.lang.Math.min;
|
||||
/**
|
||||
* Default implementation of {@link Http2ConnectionEncoder}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultHttp2ConnectionEncoder implements Http2ConnectionEncoder {
|
||||
private final Http2FrameWriter frameWriter;
|
||||
private final Http2Connection connection;
|
||||
|
@ -20,10 +20,12 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.util.IllegalReferenceCountException;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* The default {@link Http2DataFrame} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class DefaultHttp2DataFrame extends AbstractHttp2StreamFrame implements Http2DataFrame {
|
||||
private final ByteBuf content;
|
||||
private final boolean endStream;
|
||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBufAllocator;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.http2.Http2FrameReader.Configuration;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.handler.codec.http2.Http2CodecUtil.DEFAULT_MAX_FRAME_SIZE;
|
||||
import static io.netty.handler.codec.http2.Http2CodecUtil.FRAME_HEADER_LENGTH;
|
||||
@ -50,6 +51,7 @@ import static io.netty.handler.codec.http2.Http2FrameTypes.WINDOW_UPDATE;
|
||||
/**
|
||||
* A {@link Http2FrameReader} that supports all frame types defined by the HTTP/2 specification.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultHttp2FrameReader implements Http2FrameReader, Http2FrameSizePolicy, Configuration {
|
||||
private final Http2HeadersDecoder headersDecoder;
|
||||
|
||||
|
@ -61,10 +61,12 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.handler.codec.http2.Http2CodecUtil.SimpleChannelPromiseAggregator;
|
||||
import io.netty.handler.codec.http2.Http2FrameWriter.Configuration;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A {@link Http2FrameWriter} that supports all frame types defined by the HTTP/2 specification.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultHttp2FrameWriter implements Http2FrameWriter, Http2FrameSizePolicy, Configuration {
|
||||
private static final String STREAM_ID = "Stream ID";
|
||||
private static final String STREAM_DEPENDENCY = "Stream Dependency";
|
||||
|
@ -18,11 +18,12 @@ package io.netty.handler.codec.http2;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.DefaultByteBufHolder;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import io.netty.util.IllegalReferenceCountException;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* The default {@link Http2GoAwayFrame} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class DefaultHttp2GoAwayFrame extends DefaultByteBufHolder implements Http2GoAwayFrame {
|
||||
private final long errorCode;
|
||||
private int extraStreamIds;
|
||||
@ -39,7 +40,7 @@ public final class DefaultHttp2GoAwayFrame extends DefaultByteBufHolder implemen
|
||||
/**
|
||||
* Equivalent to {@code new DefaultHttp2GoAwayFrame(content, Unpooled.EMPTY_BUFFER)}.
|
||||
*
|
||||
* @param error reason for the go away
|
||||
* @param errorCode reason for the go away
|
||||
*/
|
||||
public DefaultHttp2GoAwayFrame(long errorCode) {
|
||||
this(errorCode, Unpooled.EMPTY_BUFFER);
|
||||
@ -58,7 +59,7 @@ public final class DefaultHttp2GoAwayFrame extends DefaultByteBufHolder implemen
|
||||
/**
|
||||
* Construct a new GOAWAY message.
|
||||
*
|
||||
* @param error reason for the go away
|
||||
* @param errorCode reason for the go away
|
||||
* @param content non-{@code null} debug data
|
||||
*/
|
||||
public DefaultHttp2GoAwayFrame(long errorCode, ByteBuf content) {
|
||||
|
@ -23,7 +23,9 @@ import io.netty.handler.codec.DefaultHeaders;
|
||||
import io.netty.util.AsciiString;
|
||||
import io.netty.util.ByteProcessor;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
@UnstableApi
|
||||
public class DefaultHttp2Headers
|
||||
extends DefaultHeaders<CharSequence, CharSequence, Http2Headers> implements Http2Headers {
|
||||
private static final ByteProcessor HTTP2_NAME_VALIDATOR_PROCESSOR = new ByteProcessor() {
|
||||
|
@ -17,9 +17,10 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufInputStream;
|
||||
import io.netty.handler.codec.http2.hpack.Decoder;
|
||||
import io.netty.handler.codec.http2.hpack.HeaderListener;
|
||||
import io.netty.handler.codec.http2.internal.hpack.Decoder;
|
||||
import io.netty.handler.codec.http2.internal.hpack.HeaderListener;
|
||||
import io.netty.util.AsciiString;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
@ -32,6 +33,7 @@ import static io.netty.handler.codec.http2.Http2Error.INTERNAL_ERROR;
|
||||
import static io.netty.handler.codec.http2.Http2Error.PROTOCOL_ERROR;
|
||||
import static io.netty.handler.codec.http2.Http2Exception.connectionError;
|
||||
|
||||
@UnstableApi
|
||||
public class DefaultHttp2HeadersDecoder implements Http2HeadersDecoder, Http2HeadersDecoder.Configuration {
|
||||
private static final float HEADERS_COUNT_WEIGHT_NEW = 1 / 5f;
|
||||
private static final float HEADERS_COUNT_WEIGHT_HISTORICAL = 1 - HEADERS_COUNT_WEIGHT_NEW;
|
||||
|
@ -17,8 +17,9 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufOutputStream;
|
||||
import io.netty.handler.codec.http2.hpack.Encoder;
|
||||
import io.netty.handler.codec.http2.internal.hpack.Encoder;
|
||||
import io.netty.util.AsciiString;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
@ -32,6 +33,7 @@ import static io.netty.handler.codec.http2.Http2Error.PROTOCOL_ERROR;
|
||||
import static io.netty.handler.codec.http2.Http2Exception.connectionError;
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
@UnstableApi
|
||||
public class DefaultHttp2HeadersEncoder implements Http2HeadersEncoder, Http2HeadersEncoder.Configuration {
|
||||
private final Encoder encoder;
|
||||
private final ByteArrayOutputStream tableSizeChangeOutput = new ByteArrayOutputStream();
|
||||
|
@ -15,11 +15,14 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* The default {@link Http2HeadersFrame} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class DefaultHttp2HeadersFrame extends AbstractHttp2StreamFrame implements Http2HeadersFrame {
|
||||
private final Http2Headers headers;
|
||||
private final boolean endStream;
|
||||
|
@ -31,6 +31,7 @@ import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.http2.Http2Exception.CompositeStreamException;
|
||||
import io.netty.handler.codec.http2.Http2Exception.StreamException;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Basic implementation of {@link Http2LocalFlowController}.
|
||||
@ -38,6 +39,7 @@ import io.netty.util.internal.PlatformDependent;
|
||||
* This class is <strong>NOT</strong> thread safe. The assumption is all methods must be invoked from a single thread.
|
||||
* Typically this thread is the event loop thread for the {@link ChannelHandlerContext} managed by this class.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DefaultHttp2LocalFlowController implements Http2LocalFlowController {
|
||||
/**
|
||||
* The default ratio of window size to initial window size below which a {@code WINDOW_UPDATE}
|
||||
|
@ -26,6 +26,7 @@ import static java.lang.Math.min;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.http2.StreamByteDistributor.Writer;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
|
||||
@ -38,6 +39,8 @@ import java.util.Deque;
|
||||
* This class is <strong>NOT</strong> thread safe. The assumption is all methods must be invoked from a single thread.
|
||||
* Typically this thread is the event loop thread for the {@link ChannelHandlerContext} managed by this class.
|
||||
*/
|
||||
@UnstableApi
|
||||
|
||||
public class DefaultHttp2RemoteFlowController implements Http2RemoteFlowController {
|
||||
private static final InternalLogger logger =
|
||||
InternalLoggerFactory.getInstance(DefaultHttp2RemoteFlowController.class);
|
||||
|
@ -15,11 +15,14 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
/**
|
||||
* The default {@link Http2ResetFrame} implementation.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class DefaultHttp2ResetFrame extends AbstractHttp2StreamFrame implements Http2ResetFrame {
|
||||
private final long errorCode;
|
||||
|
||||
|
@ -21,6 +21,7 @@ import io.netty.channel.embedded.EmbeddedChannel;
|
||||
import io.netty.handler.codec.ByteToMessageDecoder;
|
||||
import io.netty.handler.codec.compression.ZlibCodecFactory;
|
||||
import io.netty.handler.codec.compression.ZlibWrapper;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_ENCODING;
|
||||
import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH;
|
||||
@ -37,6 +38,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
* A HTTP2 frame listener that will decompress data frames according to the {@code content-encoding} header for each
|
||||
* stream. The decompression provided by this class will be applied to the data for the entire stream.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class DelegatingDecompressorFrameListener extends Http2FrameListenerDecorator {
|
||||
|
||||
private final Http2Connection connection;
|
||||
|
@ -16,7 +16,9 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.handler.codec.EmptyHeaders;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
@UnstableApi
|
||||
public final class EmptyHttp2Headers
|
||||
extends EmptyHeaders<CharSequence, CharSequence, Http2Headers> implements Http2Headers {
|
||||
public static final EmptyHttp2Headers INSTANCE = new EmptyHttp2Headers();
|
||||
|
@ -31,6 +31,7 @@ import io.netty.handler.codec.http.FullHttpResponse;
|
||||
import io.netty.handler.codec.http.HttpClientUpgradeHandler;
|
||||
import io.netty.handler.codec.http.HttpRequest;
|
||||
import io.netty.util.collection.CharObjectMap;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -39,6 +40,7 @@ import java.util.List;
|
||||
/**
|
||||
* Client-side cleartext upgrade codec from HTTP to HTTP/2.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2ClientUpgradeCodec implements HttpClientUpgradeHandler.UpgradeCodec {
|
||||
|
||||
private static final List<CharSequence> UPGRADE_HEADERS = Collections.singletonList(HTTP_UPGRADE_SETTINGS_HEADER);
|
||||
|
@ -25,6 +25,7 @@ import io.netty.channel.DefaultChannelPromise;
|
||||
import io.netty.handler.ssl.ApplicationProtocolNames;
|
||||
import io.netty.util.AsciiString;
|
||||
import io.netty.util.concurrent.EventExecutor;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.buffer.Unpooled.directBuffer;
|
||||
import static io.netty.buffer.Unpooled.unreleasableBuffer;
|
||||
@ -35,6 +36,7 @@ import static java.lang.Math.min;
|
||||
/**
|
||||
* Constants and utility method used for encoding/decoding HTTP2 frames.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class Http2CodecUtil {
|
||||
public static final int CONNECTION_STREAM_ID = 0;
|
||||
public static final int HTTP_UPGRADE_STREAM_ID = 1;
|
||||
|
@ -18,10 +18,12 @@ package io.netty.handler.codec.http2;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.concurrent.Future;
|
||||
import io.netty.util.concurrent.Promise;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Manager for the state of an HTTP/2 connection with the remote end-point.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2Connection {
|
||||
/**
|
||||
* Listener for life-cycle events for streams in this connection.
|
||||
|
@ -15,10 +15,12 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Provides empty implementations of all {@link Http2Connection.Listener} methods.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2ConnectionAdapter implements Http2Connection.Listener {
|
||||
|
||||
@Override
|
||||
|
@ -16,6 +16,7 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.util.List;
|
||||
@ -26,6 +27,7 @@ import java.util.List;
|
||||
* application-specific processing. Note that frames of an unknown type (i.e. HTTP/2 extensions)
|
||||
* will skip all protocol checks and be given directly to the listener for processing.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2ConnectionDecoder extends Closeable {
|
||||
|
||||
/**
|
||||
|
@ -18,11 +18,13 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
|
||||
/**
|
||||
* Handler for outbound HTTP/2 traffic.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2ConnectionEncoder extends Http2FrameWriter {
|
||||
|
||||
/**
|
||||
|
@ -26,6 +26,7 @@ import io.netty.handler.codec.http2.Http2Exception.CompositeStreamException;
|
||||
import io.netty.handler.codec.http2.Http2Exception.StreamException;
|
||||
import io.netty.util.concurrent.ScheduledFuture;
|
||||
import io.netty.util.internal.OneTimeTask;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
|
||||
@ -58,6 +59,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
* This interface enforces inbound flow control functionality through
|
||||
* {@link Http2LocalFlowController}
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2ConnectionHandler extends ByteToMessageDecoder implements Http2LifecycleManager,
|
||||
ChannelOutboundHandler {
|
||||
|
||||
|
@ -17,10 +17,12 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.handler.codec.http2.Http2HeadersEncoder.SensitivityDetector;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Builder which builds {@link Http2ConnectionHandler} objects.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class Http2ConnectionHandlerBuilder
|
||||
extends AbstractHttp2ConnectionHandlerBuilder<Http2ConnectionHandler, Http2ConnectionHandlerBuilder> {
|
||||
|
||||
|
@ -17,10 +17,12 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufHolder;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* HTTP/2 DATA frame.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2DataFrame extends Http2StreamFrame, ByteBufHolder {
|
||||
@Override
|
||||
Http2DataFrame setStream(Object stream);
|
||||
|
@ -18,10 +18,12 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Interface that defines an object capable of producing HTTP/2 data frames.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2DataWriter {
|
||||
/**
|
||||
* Writes a {@code DATA} frame to the remote endpoint. This will result in one or more
|
||||
|
@ -15,9 +15,12 @@
|
||||
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* All error codes identified by the HTTP/2 spec.
|
||||
*/
|
||||
@UnstableApi
|
||||
public enum Http2Error {
|
||||
NO_ERROR(0x0),
|
||||
PROTOCOL_ERROR(0x1),
|
||||
|
@ -16,11 +16,13 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* This class brings {@link Http2Connection.Listener} and {@link Http2FrameListener} together to provide
|
||||
* NOOP implementation so inheriting classes can selectively choose which methods to override.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2EventAdapter implements Http2Connection.Listener, Http2FrameListener {
|
||||
@Override
|
||||
public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream)
|
||||
|
@ -15,6 +15,8 @@
|
||||
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
@ -25,6 +27,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
/**
|
||||
* Exception thrown when an HTTP/2 error was encountered.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2Exception extends Exception {
|
||||
private static final long serialVersionUID = -6941186345430164209L;
|
||||
private final Http2Error error;
|
||||
|
@ -15,9 +15,12 @@
|
||||
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Provides utility methods for accessing specific flags as defined by the HTTP/2 spec.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class Http2Flags {
|
||||
public static final short END_STREAM = 0x1;
|
||||
public static final short END_HEADERS = 0x4;
|
||||
|
@ -15,10 +15,12 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Base interface for all HTTP/2 flow controllers.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2FlowController {
|
||||
/**
|
||||
* Set the {@link ChannelHandlerContext} for which to apply flow control on.
|
||||
|
@ -15,5 +15,8 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/** An HTTP/2 frame. */
|
||||
@UnstableApi
|
||||
public interface Http2Frame { }
|
||||
|
@ -16,10 +16,12 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Convenience class that provides no-op implementations for all methods of {@link Http2FrameListener}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2FrameAdapter implements Http2FrameListener {
|
||||
|
||||
@Override
|
||||
|
@ -17,10 +17,12 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* An listener of HTTP/2 frames.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2FrameListener {
|
||||
/**
|
||||
* Handles an inbound {@code DATA} frame.
|
||||
|
@ -17,10 +17,12 @@ package io.netty.handler.codec.http2;
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Provides a decorator around a {@link Http2FrameListener} and delegates all method calls
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2FrameListenerDecorator implements Http2FrameListener {
|
||||
protected final Http2FrameListener listener;
|
||||
|
||||
|
@ -22,6 +22,7 @@ import io.netty.buffer.ByteBufUtil;
|
||||
import io.netty.channel.ChannelHandlerAdapter;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.logging.LogLevel;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
import io.netty.util.internal.logging.InternalLogLevel;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
@ -29,6 +30,7 @@ import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
/**
|
||||
* Logs HTTP2 frames for debugging purposes.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2FrameLogger extends ChannelHandlerAdapter {
|
||||
|
||||
public enum Direction {
|
||||
|
@ -17,6 +17,7 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
@ -24,6 +25,7 @@ import java.io.Closeable;
|
||||
* Reads HTTP/2 frames from an input {@link ByteBuf} and notifies the specified
|
||||
* {@link Http2FrameListener} when frames are complete.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2FrameReader extends Closeable {
|
||||
/**
|
||||
* Configuration specific to {@link Http2FrameReader}
|
||||
|
@ -14,6 +14,9 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
@UnstableApi
|
||||
public interface Http2FrameSizePolicy {
|
||||
/**
|
||||
* Sets the maximum allowed frame size. Attempts to write frames longer than this maximum will fail.
|
||||
|
@ -15,9 +15,12 @@
|
||||
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Registry of all standard frame types defined by the HTTP/2 specification.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class Http2FrameTypes {
|
||||
public static final byte DATA = 0x0;
|
||||
public static final byte HEADERS = 0x1;
|
||||
|
@ -19,6 +19,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
@ -27,6 +28,7 @@ import java.io.Closeable;
|
||||
* this interface write to the context, but DO NOT FLUSH. To perform a flush, you must separately
|
||||
* call {@link ChannelHandlerContext#flush()}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2FrameWriter extends Http2DataWriter, Closeable {
|
||||
/**
|
||||
* Configuration specific to {@link Http2FrameWriter}
|
||||
|
@ -17,11 +17,13 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufHolder;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* HTTP/2 GOAWAY frame. Last-Stream-Id is not exposed directly, but instead via the relative {@link
|
||||
* #extraStreamIds()}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2GoAwayFrame extends Http2Frame, ByteBufHolder {
|
||||
/**
|
||||
* The reason for beginning closure of the connection. Represented as an HTTP/2 error code.
|
||||
|
@ -14,9 +14,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Extracts a common interface for encoding and processing HPACK header constraints
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2HeaderTable {
|
||||
/**
|
||||
* Sets the maximum size of the HPACK header table used for decoding HTTP/2 headers.
|
||||
|
@ -17,6 +17,7 @@ package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.handler.codec.Headers;
|
||||
import io.netty.util.AsciiString;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
@ -24,6 +25,7 @@ import java.util.Map.Entry;
|
||||
/**
|
||||
* A collection of headers sent or received via HTTP/2.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2Headers extends Headers<CharSequence, CharSequence, Http2Headers> {
|
||||
|
||||
/**
|
||||
|
@ -16,10 +16,12 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Decodes HPACK-encoded headers blocks into {@link Http2Headers}.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2HeadersDecoder {
|
||||
/**
|
||||
* Configuration related elements for the {@link Http2HeadersDecoder} interface
|
||||
|
@ -16,10 +16,12 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Encodes {@link Http2Headers} into HPACK-encoded headers blocks.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2HeadersEncoder {
|
||||
/**
|
||||
* Configuration related elements for the {@link Http2HeadersEncoder} interface
|
||||
|
@ -15,9 +15,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* HTTP/2 HEADERS frame.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2HeadersFrame extends Http2StreamFrame {
|
||||
@Override
|
||||
Http2HeadersFrame setStream(Object stream);
|
||||
|
@ -19,11 +19,13 @@ import static io.netty.handler.codec.http2.Http2FrameLogger.Direction.INBOUND;
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Decorator around a {@link Http2FrameReader} that logs all inbound frames before calling
|
||||
* back the listener.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2InboundFrameLogger implements Http2FrameReader {
|
||||
private final Http2FrameReader reader;
|
||||
private final Http2FrameLogger logger;
|
||||
|
@ -18,11 +18,13 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Manager for the life cycle of the HTTP/2 connection. Handles graceful shutdown of the channel,
|
||||
* closing only after all of the streams have closed.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2LifecycleManager {
|
||||
|
||||
/**
|
||||
|
@ -15,10 +15,12 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A {@link Http2FlowController} for controlling the inbound flow of {@code DATA} frames from the remote endpoint.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2LocalFlowController extends Http2FlowController {
|
||||
/**
|
||||
* Sets the writer to be use for sending {@code WINDOW_UPDATE} frames. This must be called before any flow
|
||||
|
@ -34,6 +34,7 @@ import io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeEvent;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
import io.netty.util.concurrent.EventExecutor;
|
||||
import io.netty.util.internal.OneTimeTask;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -71,6 +72,7 @@ import java.util.List;
|
||||
* <p>{@link ChannelConfig#setMaxMessagesPerRead(int)} and {@link
|
||||
* ChannelConfig#setAutoRead(boolean)} are supported.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class Http2MultiplexCodec extends ChannelDuplexHandler {
|
||||
private static final Http2FrameLogger HTTP2_FRAME_LOGGER = new Http2FrameLogger(INFO, Http2MultiplexCodec.class);
|
||||
|
||||
|
@ -14,11 +14,14 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import static io.netty.handler.codec.http2.Http2Error.PROTOCOL_ERROR;
|
||||
|
||||
/**
|
||||
* This exception is thrown when there are no more stream IDs available for the current connection
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2NoMoreStreamIdsException extends Http2Exception {
|
||||
private static final long serialVersionUID = -7756236161274851110L;
|
||||
private static final String ERROR_MESSAGE = "No more streams can be created on this connection";
|
||||
|
@ -21,11 +21,13 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelFuture;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.channel.ChannelPromise;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Decorator around a {@link Http2FrameWriter} that logs all outbound frames before calling the
|
||||
* writer.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2OutboundFrameLogger implements Http2FrameWriter {
|
||||
private final Http2FrameWriter writer;
|
||||
private final Http2FrameLogger logger;
|
||||
|
@ -15,11 +15,13 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Provides an extensibility point for users to define the validity of push requests.
|
||||
* @see <a href="https://tools.ietf.org/html/draft-ietf-httpbis-http2-17#section-8.2">[RFC http2], Section 8.2</a>.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2PromisedRequestVerifier {
|
||||
/**
|
||||
* Determine if a {@link Http2Headers} are authoritative for a particular {@link ChannelHandlerContext}.
|
||||
|
@ -15,11 +15,13 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A {@link Http2FlowController} for controlling the flow of outbound {@code DATA} frames to the remote
|
||||
* endpoint.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2RemoteFlowController extends Http2FlowController {
|
||||
/**
|
||||
* Get the {@link ChannelHandlerContext} for which to apply flow control on.
|
||||
|
@ -15,7 +15,10 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/** HTTP/2 RST_STREAM frame. */
|
||||
@UnstableApi
|
||||
public interface Http2ResetFrame extends Http2StreamFrame {
|
||||
@Override
|
||||
Http2ResetFrame setStream(Object stream);
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -23,6 +25,7 @@ import java.util.List;
|
||||
/**
|
||||
* Provides utilities related to security requirements specific to HTTP/2.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class Http2SecurityUtil {
|
||||
/**
|
||||
* The following list is derived from <a
|
||||
|
@ -24,6 +24,7 @@ import io.netty.handler.codec.http.FullHttpResponse;
|
||||
import io.netty.handler.codec.http.HttpHeaders;
|
||||
import io.netty.handler.codec.http.HttpServerUpgradeHandler;
|
||||
import io.netty.util.CharsetUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
import io.netty.util.internal.logging.InternalLogger;
|
||||
import io.netty.util.internal.logging.InternalLoggerFactory;
|
||||
|
||||
@ -42,6 +43,7 @@ import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
/**
|
||||
* Server-side codec for performing a cleartext upgrade from HTTP/1.x to HTTP/2.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class Http2ServerUpgradeCodec implements HttpServerUpgradeHandler.UpgradeCodec {
|
||||
|
||||
private static final InternalLogger logger = InternalLoggerFactory.getInstance(Http2ServerUpgradeCodec.class);
|
||||
|
@ -34,12 +34,14 @@ import static io.netty.handler.codec.http2.Http2CodecUtil.isMaxFrameSizeValid;
|
||||
import static io.netty.util.internal.ObjectUtil.checkNotNull;
|
||||
|
||||
import io.netty.util.collection.CharObjectHashMap;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Settings for one endpoint in an HTTP/2 connection. Each of the values are optional as defined in
|
||||
* the spec for the SETTINGS frame. Permits storage of arbitrary key/value pairs but provides helper
|
||||
* methods for standard settings.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class Http2Settings extends CharObjectHashMap<Long> {
|
||||
/**
|
||||
* Default capacity based on the number of standard settings from the HTTP/2 spec, adjusted so that adding all of
|
||||
|
@ -15,9 +15,12 @@
|
||||
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A single stream within an HTTP2 connection. Streams are compared to each other by priority.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2Stream {
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A frame whose meaning <em>may</em> apply to a particular stream, instead of the entire
|
||||
* connection. It is still possibly for this frame type to apply to the entire connection. In such
|
||||
@ -24,6 +26,7 @@ package io.netty.handler.codec.http2;
|
||||
* <p>The meaning of {@code stream} is context-dependent and may change as a frame is processed in
|
||||
* the pipeline.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2StreamFrame extends Http2Frame {
|
||||
/**
|
||||
* Set the stream identifier for this message.
|
||||
|
@ -14,9 +14,12 @@
|
||||
*/
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* A visitor that allows iteration over a collection of streams.
|
||||
*/
|
||||
@UnstableApi
|
||||
public interface Http2StreamVisitor {
|
||||
/**
|
||||
* @return <ul>
|
||||
|
@ -31,6 +31,7 @@ import io.netty.handler.codec.http.HttpResponseStatus;
|
||||
import io.netty.handler.codec.http.HttpUtil;
|
||||
import io.netty.handler.codec.http.HttpVersion;
|
||||
import io.netty.util.AsciiString;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Iterator;
|
||||
@ -52,6 +53,7 @@ import static io.netty.util.internal.StringUtil.length;
|
||||
/**
|
||||
* Provides utility methods and constants for the HTTP/2 to HTTP conversion
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class HttpConversionUtil {
|
||||
/**
|
||||
* The set of headers that should not be directly copied when converting headers from HTTP to HTTP/2.
|
||||
|
@ -25,12 +25,14 @@ import io.netty.handler.codec.http.HttpMessage;
|
||||
import io.netty.handler.codec.http.LastHttpContent;
|
||||
import io.netty.handler.codec.http2.Http2CodecUtil.SimpleChannelPromiseAggregator;
|
||||
import io.netty.util.ReferenceCountUtil;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Translates HTTP/1.x object writes into HTTP/2 frames.
|
||||
* <p>
|
||||
* See {@link InboundHttp2ToHttpAdapter} to get translation from HTTP/2 frames to HTTP/1.x objects.
|
||||
*/
|
||||
@UnstableApi
|
||||
public class HttpToHttp2ConnectionHandler extends Http2ConnectionHandler {
|
||||
|
||||
private final boolean validateHeaders;
|
||||
|
@ -17,10 +17,12 @@
|
||||
package io.netty.handler.codec.http2;
|
||||
|
||||
import io.netty.handler.codec.http2.Http2HeadersEncoder.SensitivityDetector;
|
||||
import io.netty.util.internal.UnstableApi;
|
||||
|
||||
/**
|
||||
* Builder which builds {@link HttpToHttp2ConnectionHandler} objects.
|
||||
*/
|
||||
@UnstableApi
|
||||
public final class HttpToHttp2ConnectionHandlerBuilder extends
|
||||
AbstractHttp2ConnectionHandlerBuilder<HttpToHttp2ConnectionHandler, HttpToHttp2ConnectionHandlerBuilder> {
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user