public class CompressorHttp2ConnectionEncoder extends DefaultHttp2ConnectionEncoder
content-encoding header for each stream.
The compression provided by this class will be applied to the data for the entire stream.| Modifier and Type | Class and Description |
|---|---|
static class |
CompressorHttp2ConnectionEncoder.Builder
Builder for new instances of
CompressorHttp2ConnectionEncoder |
DefaultHttp2ConnectionEncoder.FlowControlledBaseHttp2FrameWriter.Configuration| Modifier | Constructor and Description |
|---|---|
protected |
CompressorHttp2ConnectionEncoder(CompressorHttp2ConnectionEncoder.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
protected io.netty.handler.codec.AsciiString |
getTargetContentEncoding(io.netty.handler.codec.AsciiString contentEncoding)
Returns the expected content encoding of the decoded content.
|
protected io.netty.channel.embedded.EmbeddedChannel |
newContentCompressor(io.netty.handler.codec.AsciiString contentEncoding)
Returns a new
EmbeddedChannel that encodes the HTTP2 message content encoded in the specified
contentEncoding. |
io.netty.channel.ChannelFuture |
writeData(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.buffer.ByteBuf data,
int padding,
boolean endOfStream,
io.netty.channel.ChannelPromise promise)
Writes a
DATA frame to the remote endpoint. |
io.netty.channel.ChannelFuture |
writeHeaders(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int padding,
boolean endStream,
io.netty.channel.ChannelPromise promise)
Writes a HEADERS frame to the remote endpoint.
|
io.netty.channel.ChannelFuture |
writeHeaders(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int streamDependency,
short weight,
boolean exclusive,
int padding,
boolean endOfStream,
io.netty.channel.ChannelPromise promise)
Writes a HEADERS frame with priority specified to the remote endpoint.
|
close, configuration, connection, flowController, frameWriter, newBuilder, pollSentSettings, remoteSettings, writeFrame, writeGoAway, writePing, writePriority, writePushPromise, writeRstStream, writeRstStream, writeSettings, writeSettingsAck, writeWindowUpdateprotected CompressorHttp2ConnectionEncoder(CompressorHttp2ConnectionEncoder.Builder builder)
public io.netty.channel.ChannelFuture writeData(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.buffer.ByteBuf data,
int padding,
boolean endOfStream,
io.netty.channel.ChannelPromise promise)
Http2DataWriterDATA frame to the remote endpoint.writeData in interface Http2DataWriterwriteData in class DefaultHttp2ConnectionEncoderctx - the context to use for writing.streamId - the stream for which to send the frame.data - the payload of the frame. This will be released by this method.padding - the amount of padding to be added to the end of the frameendOfStream - indicates if this is the last frame to be sent for the stream.promise - the promise for the write.public io.netty.channel.ChannelFuture writeHeaders(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int padding,
boolean endStream,
io.netty.channel.ChannelPromise promise)
Http2FrameWriterwriteHeaders in interface Http2FrameWriterwriteHeaders in class DefaultHttp2ConnectionEncoderctx - the context to use for writing.streamId - the stream for which to send the frame.headers - the headers to be sent.padding - the amount of padding to be added to the end of the frameendStream - indicates if this is the last frame to be sent for the stream.promise - the promise for the write.public io.netty.channel.ChannelFuture writeHeaders(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int streamDependency,
short weight,
boolean exclusive,
int padding,
boolean endOfStream,
io.netty.channel.ChannelPromise promise)
Http2FrameWriterwriteHeaders in interface Http2FrameWriterwriteHeaders in class DefaultHttp2ConnectionEncoderctx - the context to use for writing.streamId - the stream for which to send the frame.headers - the headers to be sent.streamDependency - the stream on which this stream should depend, or 0 if it should
depend on the connection.weight - the weight for this stream.exclusive - whether this stream should be the exclusive dependant of its parent.padding - the amount of padding to be added to the end of the frameendOfStream - indicates if this is the last frame to be sent for the stream.promise - the promise for the write.protected io.netty.channel.embedded.EmbeddedChannel newContentCompressor(io.netty.handler.codec.AsciiString contentEncoding)
throws Http2Exception
EmbeddedChannel that encodes the HTTP2 message content encoded in the specified
contentEncoding.contentEncoding - the value of the content-encoding headerByteToMessageDecoder if the specified encoding is supported. null otherwise
(alternatively, you can throw a Http2Exception to block unknown encoding).Http2Exception - If the specified encoding is not not supported and warrants an exceptionprotected io.netty.handler.codec.AsciiString getTargetContentEncoding(io.netty.handler.codec.AsciiString contentEncoding)
throws Http2Exception
contentEncoding is the default
behavior, which is the case for most compressors.contentEncoding - the value of the content-encoding headerHttp2Exception - if the contentEncoding is not supported and warrants an exceptionCopyright © 2008–2015 The Netty Project. All rights reserved.