Top Fields Constructors Methods
io.vertx.core.http.impl

pack-priv Class VertxHttp2ConnectionHandler<C extends Http2ConnectionBase>

extends Http2ConnectionHandler
implements Http2FrameListener
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http2.Http2FrameListener
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelFuture, .ChannelHandlerContext, .ChannelPromise, io.netty.handler.codec.http2.*, io.netty.handler.timeout.IdleStateEvent, io.netty.util.concurrent.DefaultPromise, .EventExecutor, .Future, .FutureListener, .Promise, io.vertx.core.Handler, io.vertx.core.buffer.Buffer, io.vertx.core.http.GoAway, io.vertx.core.net.impl.ConnectionBase, java.util.function.Function

Author
Julien Viet

Field Summary

Modifier and TypeField and Description
private Handler<C>
private ChannelHandlerContext
private Promise<C>
private C
private final Function<VertxHttp2ConnectionHandler<C>, C>
private final Http2Settings
private boolean
private Handler<C>
private boolean
public boolean
private final boolean

Constructor Summary

AccessConstructor and Description
public
VertxHttp2ConnectionHandler(Function<VertxHttp2ConnectionHandler<C>, C> connectionFactory, boolean useDecompressor, Http2ConnectionDecoder decoder, Http2ConnectionEncoder encoder, Http2Settings initialSettings)

Method Summary

Modifier and TypeMethod and Description
private void
_writeGoAway(long errorCode, int lastStreamId, ByteBuf debugData)

private void
_writePing(long data, ChannelPromise promise)

private void
_writePriority(Http2Stream stream, int streamDependency, short weight, boolean exclusive)

private void
_writePushPromise(int streamId, int promisedStreamId, Http2Headers headers, ChannelPromise promise)

private void
_writeSettings(Http2Settings settingsUpdate, ChannelPromise promise)

public VertxHttp2ConnectionHandler<C>

Returns:

this
addHandler
(Handler<C>
the handler to be notified
handler
)

Set an handler to be called when the connection is set on this handler.

public void
public void
public void
private void
public void
public Future<C>
pack-priv void
consume(Http2Stream stream, int numBytes)

Consume numBytes for stream in the flow controller, this must be called from event loop.

public ChannelHandlerContext
public void
public void
handlerAdded(ChannelHandlerContext ctx)

Overrides io.netty.handler.codec.http2.Http2ConnectionHandler.handlerAdded.

Implements io.netty.channel.ChannelHandler.handlerAdded.

Gets called after the ChannelHandler was added to the actual context and it's ready to handle events.

public Http2Settings
pack-priv int
protected void
onConnectionError(ChannelHandlerContext
the channel context
ctx
,
boolean
true if the error was caused by an outbound operation.
outbound
,
Throwable
the exception that was caught
cause
,
Http2Exception
the Http2Exception that is embedded in the causality chain. This may be null if it's an unknown exception.
http2Ex
)

Overrides io.netty.handler.codec.http2.Http2ConnectionHandler.onConnectionError.

Handler for a connection error.

public int
onDataRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
ByteBuf
payload buffer for the frame. This buffer will be released by the codec.
data
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
Indicates whether this is the last frame to be sent from the remote endpoint for this stream.
endOfStream
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onDataRead.

Handles an inbound DATA frame.

public void
onGoAwayRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the last known stream of the remote endpoint.
lastStreamId
,
long
the error code, if abnormal closure.
errorCode
,
ByteBuf
application-defined debug data. If this buffer needs to be retained by the listener they must make a copy.
debugData
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onGoAwayRead.

Handles an inbound GO_AWAY frame.

public void
onHeadersRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
Http2Headers
the received headers.
headers
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
,
boolean
Indicates whether this is the last frame to be sent from the remote endpoint for this stream.
endOfStream
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Handles an inbound HEADERS frame.

public void
onHeadersRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
Http2Headers
the received headers.
headers
,
int
the stream on which this stream depends, or 0 if dependent on the connection.
streamDependency
,
short
the new weight for the stream.
weight
,
boolean
whether or not the stream should be the exclusive dependent 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 whether this is the last frame to be sent from the remote endpoint for this stream.
endOfStream
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onHeadersRead.

Handles an inbound HEADERS frame with priority information specified.

public void
onPingAckRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
long
the payload of the frame.
data
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onPingAckRead.

Handles an inbound PING acknowledgment.

public void
onPingRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
long
the payload of the frame.
data
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onPingRead.

Handles an inbound PING frame.

public void
onPriorityRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the subject stream for the frame.
streamId
,
int
the stream on which this stream depends, or 0 if dependent on the connection.
streamDependency
,
short
the new weight for the stream.
weight
,
boolean
whether or not the stream should be the exclusive dependent of its parent.
exclusive
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onPriorityRead.

Handles an inbound PRIORITY frame.

public void
onPushPromiseRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the stream the frame was sent on.
streamId
,
int
the ID of the promised stream.
promisedStreamId
,
Http2Headers
the received headers.
headers
,
int
additional bytes that should be added to obscure the true content size. Must be between 0 and 256 (inclusive).
padding
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onPushPromiseRead.

Handles an inbound PUSH_PROMISE frame.

public void
onRstStreamRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the stream that is terminating.
streamId
,
long
the error code identifying the type of failure.
errorCode
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onRstStreamRead.

Handles an inbound RST_STREAM frame.

public void
onSettingsAckRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onSettingsAckRead.

Handles an inbound SETTINGS acknowledgment frame.

public void
onSettingsRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
Http2Settings
the settings received from the remote endpoint.
settings
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onSettingsRead.

Handles an inbound SETTINGS frame.

protected void
onStreamError(ChannelHandlerContext
the channel context
ctx
,
boolean
true if the error was caused by an outbound operation.
outbound
,
Throwable
the exception that was caught
cause
,
Http2Exception.StreamException
the StreamException that is embedded in the causality chain.
http2Ex
)

Overrides io.netty.handler.codec.http2.Http2ConnectionHandler.onStreamError.

Handler for a stream error.

public void
onUnknownFrame(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
byte
the frame type from the HTTP/2 header.
frameType
,
int
the stream the frame was sent on.
streamId
,
Http2Flags
the flags in the frame header.
flags
,
ByteBuf
the payload of the frame.
payload
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onUnknownFrame.

Handler for a frame not defined by the HTTP/2 spec.

public void
onWindowUpdateRead(ChannelHandlerContext
the context from the handler where the frame was read.
ctx
,
int
the stream the frame was sent on.
streamId
,
int
the increased number of bytes of the remote endpoint's flow control window.
windowSizeIncrement
)

Implements io.netty.handler.codec.http2.Http2FrameListener.onWindowUpdateRead.

Handles an inbound WINDOW_UPDATE frame.

public VertxHttp2ConnectionHandler<C>

Returns:

this
removeHandler
(Handler<C>
the handler to be notified
handler
)

Set an handler to be called when the connection is unset from this handler.

public void
public void
pack-priv void
writeData(Http2Stream stream, ByteBuf chunk, boolean end, FutureListener<Void> listener)

pack-priv void
writeFrame(Http2Stream stream, byte type, short flags, ByteBuf payload)

pack-priv void
writeGoAway(long errorCode, int lastStreamId, ByteBuf debugData)

pack-priv void
writeHeaders(Http2Stream stream, Http2Headers headers, boolean end, int streamDependency, short weight, boolean exclusive, boolean checkFlush, FutureListener<Void> listener)

pack-priv ChannelFuture
writePing(long data)

pack-priv void
writePriority(Http2Stream stream, int streamDependency, short weight, boolean exclusive)

pack-priv Future<Integer>
writePushPromise(int streamId, Http2Headers headers)

pack-priv void
writeReset(int streamId, long code)

pack-priv ChannelFuture
writeSettings(Http2Settings settingsUpdate)

Inherited from io.netty.handler.codec.http2.Http2ConnectionHandler:
bindchannelActivechannelWritabilityChangedclosecloseStreamcloseStreamLocalcloseStreamRemoteconnectconnectiondecodedecoderderegisterdisconnectencoderflushframeWritergoAwaygracefulShutdownTimeoutMillisgracefulShutdownTimeoutMillishandlerRemoved0handleServerHeaderDecodeSizeErrorisGracefulShutdownCompleteonErroronHttpClientUpgradeonHttpServerUpgradereadresetStreamwrite