Top Description Fields Constructors Methods
io.netty.handler.codec.http2

public Class DecoratingHttp2FrameWriter

extends Object
implements Http2FrameWriter
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http2.Http2FrameWriter, java.io.Closeable, java.lang.AutoCloseable, io.netty.handler.codec.http2.Http2DataWriter
Known Direct Subclasses
io.netty.handler.codec.http2.DecoratingHttp2ConnectionEncoder
Annotations
@UnstableApi
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelFuture, .ChannelHandlerContext, .ChannelPromise, io.netty.util.internal.UnstableApi

Decorator around another Http2FrameWriter instance.

Field Summary

Modifier and TypeField and Description
private final Http2FrameWriter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements io.netty.handler.codec.http2.Http2FrameWriter.close.

Closes this writer and frees any allocated resources.
public Http2FrameWriter.Configuration
configuration()

Implements io.netty.handler.codec.http2.Http2FrameWriter.configuration.

Get the configuration related elements for this Http2FrameWriter
public ChannelFuture
writeData(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
ByteBuf
the payload of the frame. This will be released by this method.
data
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive). A 1 byte padding is encoded as just the pad length field with value 0. A 256 byte padding is encoded as the pad length field with value 255 and 255 padding bytes appended to the end of the frame.
padding
,
boolean
indicates if this is the last frame to be sent for the stream.
endStream
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2DataWriter.writeData.

Writes a DATA frame to the remote endpoint.
public ChannelFuture
writeFrame(ChannelHandlerContext
the context to use for writing.
ctx
,
byte
the frame type identifier.
frameType
,
int
the stream for which to send the frame.
streamId
,
Http2Flags
the flags to write for this frame.
flags
,
ByteBuf
the payload to write for this frame. This will be released by this method.
payload
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeFrame.

Generic write method for any HTTP/2 frame.
public ChannelFuture
writeGoAway(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the last known stream of this endpoint.
lastStreamId
,
long
the error code, if the connection was abnormally terminated.
errorCode
,
ByteBuf
application-defined debug data. This will be released by this method.
debugData
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeGoAway.

Writes a GO_AWAY frame to the remote endpoint.
public ChannelFuture
writeHeaders(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
Http2Headers
the headers to be sent.
headers
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
indicates if this is the last frame to be sent for the stream.
endStream
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeHeaders.

Writes a HEADERS frame to the remote endpoint.
public ChannelFuture
writeHeaders(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
Http2Headers
the headers to be sent.
headers
,
int
the stream on which this stream should depend, or 0 if it should depend on the connection.
streamDependency
,
short
the weight for this stream.
weight
,
boolean
whether this stream should be the exclusive dependant of its parent.
exclusive
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
indicates if this is the last frame to be sent for the stream.
endStream
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeHeaders.

Writes a HEADERS frame with priority specified to the remote endpoint.
public ChannelFuture
writePing(ChannelHandlerContext
the context to use for writing.
ctx
,
boolean
indicates whether this is an ack of a PING frame previously received from the remote endpoint.
ack
,
long
the payload of the frame.
data
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writePing.

Writes a PING frame to the remote endpoint.
public ChannelFuture
writePriority(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
int
the stream on which this stream should depend, or 0 if it should depend on the connection.
streamDependency
,
short
the weight for this stream.
weight
,
boolean
whether this stream should be the exclusive dependant of its parent.
exclusive
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writePriority.

Writes a PRIORITY frame to the remote endpoint.
public ChannelFuture
writePushPromise(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
int
the ID of the promised stream.
promisedStreamId
,
Http2Headers
the headers to be sent.
headers
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writePushPromise.

Writes a PUSH_PROMISE frame to the remote endpoint.
public ChannelFuture
writeRstStream(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
long
the error code indicating the nature of the failure.
errorCode
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeRstStream.

Writes a RST_STREAM frame to the remote endpoint.
public ChannelFuture
writeSettings(ChannelHandlerContext
the context to use for writing.
ctx
,
Http2Settings
the settings to be sent.
settings
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeSettings.

Writes a SETTINGS frame to the remote endpoint.
public ChannelFuture
writeSettingsAck(ChannelHandlerContext
the context to use for writing.
ctx
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeSettingsAck.

Writes a SETTINGS acknowledgment to the remote endpoint.
public ChannelFuture
writeWindowUpdate(ChannelHandlerContext
the context to use for writing.
ctx
,
int
the stream for which to send the frame.
streamId
,
int
the number of bytes by which the local inbound flow control window is increasing.
windowSizeIncrement
,
ChannelPromise
the promise for the write.
promise
)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeWindowUpdate.

Writes a WINDOW_UPDATE frame to the remote endpoint.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final Http2FrameWriter delegate

Constructor Detail

DecoratingHttp2FrameWriterback to summary
public DecoratingHttp2FrameWriter(Http2FrameWriter delegate)

Method Detail

closeback to summary
public void close()

Implements io.netty.handler.codec.http2.Http2FrameWriter.close.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.close.

Closes this writer and frees any allocated resources.

Annotations
@Override
configurationback to summary
public Http2FrameWriter.Configuration configuration()

Implements io.netty.handler.codec.http2.Http2FrameWriter.configuration.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.configuration.

Get the configuration related elements for this Http2FrameWriter

Annotations
@Override
writeDataback to summary
public ChannelFuture writeData(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endStream, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2DataWriter.writeData.

Doc from io.netty.handler.codec.http2.Http2DataWriter.writeData.

Writes a DATA frame to the remote endpoint. This will result in one or more frames being written to the context.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

data:ByteBuf

the payload of the frame. This will be released by this method.

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive). A 1 byte padding is encoded as just the pad length field with value 0. A 256 byte padding is encoded as the pad length field with value 255 and 255 padding bytes appended to the end of the frame.

endStream:boolean

indicates if this is the last frame to be sent for the stream.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeFrameback to summary
public ChannelFuture writeFrame(ChannelHandlerContext ctx, byte frameType, int streamId, Http2Flags flags, ByteBuf payload, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeFrame.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeFrame.

Generic write method for any HTTP/2 frame. This allows writing of non-standard frames.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

frameType:byte

the frame type identifier.

streamId:int

the stream for which to send the frame.

flags:Http2Flags

the flags to write for this frame.

payload:ByteBuf

the payload to write for this frame. This will be released by this method.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeGoAwayback to summary
public ChannelFuture writeGoAway(ChannelHandlerContext ctx, int lastStreamId, long errorCode, ByteBuf debugData, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeGoAway.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeGoAway.

Writes a GO_AWAY frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

lastStreamId:int

the last known stream of this endpoint.

errorCode:long

the error code, if the connection was abnormally terminated.

debugData:ByteBuf

application-defined debug data. This will be released by this method.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeHeadersback to summary
public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding, boolean endStream, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeHeaders.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeHeaders.

Writes a HEADERS frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

headers:Http2Headers

the headers to be sent.

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).

endStream:boolean

indicates if this is the last frame to be sent for the stream.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write. Section 10.5.1 states the following:

The header block MUST be processed to ensure a consistent connection state, unless the connection is closed.
If this call has modified the HPACK header state you MUST throw a connection error.

If this call has NOT modified the HPACK header state you are free to throw a stream error.

Annotations
@Override
writeHeadersback to summary
public ChannelFuture writeHeaders(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency, short weight, boolean exclusive, int padding, boolean endStream, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeHeaders.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeHeaders.

Writes a HEADERS frame with priority specified to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

headers:Http2Headers

the headers to be sent.

streamDependency:int

the stream on which this stream should depend, or 0 if it should depend on the connection.

weight:short

the weight for this stream.

exclusive:boolean

whether this stream should be the exclusive dependant of its parent.

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).

endStream:boolean

indicates if this is the last frame to be sent for the stream.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write. Section 10.5.1 states the following:

The header block MUST be processed to ensure a consistent connection state, unless the connection is closed.
If this call has modified the HPACK header state you MUST throw a connection error.

If this call has NOT modified the HPACK header state you are free to throw a stream error.

Annotations
@Override
writePingback to summary
public ChannelFuture writePing(ChannelHandlerContext ctx, boolean ack, long data, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writePing.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writePing.

Writes a PING frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

ack:boolean

indicates whether this is an ack of a PING frame previously received from the remote endpoint.

data:long

the payload of the frame.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writePriorityback to summary
public ChannelFuture writePriority(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight, boolean exclusive, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writePriority.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writePriority.

Writes a PRIORITY frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

streamDependency:int

the stream on which this stream should depend, or 0 if it should depend on the connection.

weight:short

the weight for this stream.

exclusive:boolean

whether this stream should be the exclusive dependant of its parent.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writePushPromiseback to summary
public ChannelFuture writePushPromise(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writePushPromise.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writePushPromise.

Writes a PUSH_PROMISE frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

promisedStreamId:int

the ID of the promised stream.

headers:Http2Headers

the headers to be sent.

padding:int

additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write. Section 10.5.1 states the following:

The header block MUST be processed to ensure a consistent connection state, unless the connection is closed.
If this call has modified the HPACK header state you MUST throw a connection error.

If this call has NOT modified the HPACK header state you are free to throw a stream error.

Annotations
@Override
writeRstStreamback to summary
public ChannelFuture writeRstStream(ChannelHandlerContext ctx, int streamId, long errorCode, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeRstStream.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeRstStream.

Writes a RST_STREAM frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

errorCode:long

the error code indicating the nature of the failure.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeSettingsback to summary
public ChannelFuture writeSettings(ChannelHandlerContext ctx, Http2Settings settings, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeSettings.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeSettings.

Writes a SETTINGS frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

settings:Http2Settings

the settings to be sent.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeSettingsAckback to summary
public ChannelFuture writeSettingsAck(ChannelHandlerContext ctx, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeSettingsAck.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeSettingsAck.

Writes a SETTINGS acknowledgment to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override
writeWindowUpdateback to summary
public ChannelFuture writeWindowUpdate(ChannelHandlerContext ctx, int streamId, int windowSizeIncrement, ChannelPromise promise)

Implements io.netty.handler.codec.http2.Http2FrameWriter.writeWindowUpdate.

Doc from io.netty.handler.codec.http2.Http2FrameWriter.writeWindowUpdate.

Writes a WINDOW_UPDATE frame to the remote endpoint.

Parameters
ctx:ChannelHandlerContext

the context to use for writing.

streamId:int

the stream for which to send the frame.

windowSizeIncrement:int

the number of bytes by which the local inbound flow control window is increasing.

promise:ChannelPromise

the promise for the write.

Returns:ChannelFuture

the future for the write.

Annotations
@Override