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.FlowControlledBase
Http2FrameWriter.Configuration
Modifier | Constructor and Description |
---|---|
protected |
CompressorHttp2ConnectionEncoder(CompressorHttp2ConnectionEncoder.Builder builder) |
Modifier and Type | Method and Description |
---|---|
protected AsciiString |
getTargetContentEncoding(AsciiString contentEncoding)
Returns the expected content encoding of the decoded content.
|
protected EmbeddedChannel |
newContentCompressor(AsciiString contentEncoding)
Returns a new
EmbeddedChannel that encodes the HTTP2 message content encoded in the specified
contentEncoding . |
ChannelFuture |
writeData(ChannelHandlerContext ctx,
int streamId,
ByteBuf data,
int padding,
boolean endOfStream,
ChannelPromise promise)
Writes a
DATA frame to the remote endpoint. |
ChannelFuture |
writeHeaders(ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int padding,
boolean endStream,
ChannelPromise promise)
Writes a HEADERS frame to the remote endpoint.
|
ChannelFuture |
writeHeaders(ChannelHandlerContext ctx,
int streamId,
Http2Headers headers,
int streamDependency,
short weight,
boolean exclusive,
int padding,
boolean endOfStream,
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, writeWindowUpdate
protected CompressorHttp2ConnectionEncoder(CompressorHttp2ConnectionEncoder.Builder builder)
public ChannelFuture writeData(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream, ChannelPromise promise)
Http2DataWriter
DATA
frame to the remote endpoint.writeData
in interface Http2DataWriter
writeData
in class DefaultHttp2ConnectionEncoder
ctx
- 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 ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise)
Http2FrameWriter
writeHeaders
in interface Http2FrameWriter
writeHeaders
in class DefaultHttp2ConnectionEncoder
ctx
- 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 ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endOfStream, ChannelPromise promise)
Http2FrameWriter
writeHeaders
in interface Http2FrameWriter
writeHeaders
in class DefaultHttp2ConnectionEncoder
ctx
- 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 EmbeddedChannel newContentCompressor(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 AsciiString getTargetContentEncoding(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.