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

pack-priv abstract Class Http2ConnectionBase

extends ConnectionBase
implements Http2FrameListener, HttpConnection
Class Inheritance
All Implemented Interfaces
io.vertx.core.http.HttpConnection, io.netty.handler.codec.http2.Http2FrameListener
Known Direct Subclasses
io.vertx.core.http.impl.Http2ServerConnection, io.vertx.core.http.impl.Http2ClientConnection
Imports
io.netty.buffer.*, io.netty.channel.ChannelFuture, .ChannelFutureListener, .ChannelHandlerContext, .ChannelPromise, io.netty.handler.codec.http2.Http2Connection, .Http2Exception, .Http2Flags, .Http2FrameListener, .Http2Headers, .Http2Settings, .Http2Stream, io.netty.handler.timeout.IdleStateEvent, io.vertx.codegen.annotations.Nullable, io.vertx.core.AsyncResult, .Future, .Handler, .Promise, .VertxException, io.vertx.core.buffer.Buffer, io.vertx.core.buffer.impl.VertxByteBufAllocator, io.vertx.core.http.GoAway, .HttpClosedException, .HttpConnection, .StreamPriority, io.vertx.core.impl.ContextInternal, .VertxInternal, io.vertx.core.impl.future.PromiseInternal, io.vertx.core.impl.logging.Logger, .LoggerFactory, io.vertx.core.net.impl.ConnectionBase, java.util.ArrayDeque, .ArrayList, .Map, .Objects, java.util.concurrent.TimeUnit

Author
Julien Viet

Field Summary

Modifier and TypeField and Description
private Handler<GoAway>
private GoAway
protected final VertxHttp2ConnectionHandler<C extends Http2ConnectionBase>
protected final ChannelHandlerContext
private Http2Settings
private static final Logger
private long
private Handler<Buffer>
private final ArrayDeque<Promise<Buffer>>
private Http2Settings
private Handler<Http2Settings>
private boolean
private Handler<Void>
protected final Http2Connection.PropertyKey
private final ArrayDeque<Handler<Void>>
private int
Inherited from io.vertx.core.net.impl.ConnectionBase:
chctxCLOSED_EXCEPTIONcontextLOCAL_ADDRESS_OVERRIDEREMOTE_ADDRESS_OVERRIDEvertxvoidPromise

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public Future<Void>
close()

Overrides io.vertx.core.net.impl.ConnectionBase.close.

Implements io.vertx.core.http.HttpConnection.close.

Like close(Handler) but returns a Future of the asynchronous result

public Http2ConnectionBase
closeHandler(Handler<Void>
the handler to be notified
handler
)

Overrides io.vertx.core.net.impl.ConnectionBase.closeHandler.

Implements io.vertx.core.http.HttpConnection.closeHandler.

Set a close handler.

protected void
concurrencyChanged(long concurrency)

pack-priv void
consumeCredits(Http2Stream stream, int numBytes)

protected void
doShutdown(Handler<Void> shutdownHandler)

public Http2ConnectionBase
exceptionHandler(Handler<Throwable>
the handler
handler
)

Overrides io.vertx.core.net.impl.ConnectionBase.exceptionHandler.

Implements io.vertx.core.http.HttpConnection.exceptionHandler.

Set an handler called when a connection error happens

public int
public HttpConnection
goAway(long
the GOAWAY error code
errorCode
,
int
the last stream id
lastStreamId
,
Buffer
additional debug data sent to the remote endpoint
debugData
)

Implements io.vertx.core.http.HttpConnection.goAway.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Send a go away frame to the remote endpoint of the connection.

public synchronized HttpConnection
public void
protected void
handleIdle(IdleStateEvent event)

Overrides io.vertx.core.net.impl.ConnectionBase.handleIdle.

Called by the Netty handler when the connection becomes idle.

protected void
pack-priv synchronized void
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.

pack-priv boolean
pack-priv boolean
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
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.

protected abstract void
onHeadersRead(int streamId, Http2Headers headers, StreamPriority streamPriority, boolean endOfStream)

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.

pack-priv void
pack-priv void
onStreamError(int streamId, Throwable cause)

pack-priv void
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 Future<Buffer>
ping(Buffer data)

Implements io.vertx.core.http.HttpConnection.ping.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as ping(Buffer, Handler) but returns a Future of the asynchronous result

public HttpConnection
ping(Buffer
the 8 bytes data of the frame
data
,
Handler<AsyncResult<Buffer>>
an async result handler notified with pong reply or the failure
pongHandler
)

Implements io.vertx.core.http.HttpConnection.ping.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Send a PING frame to the remote endpoint.

public synchronized HttpConnection
public synchronized Http2Settings
public synchronized HttpConnection
remoteSettingsHandler(Handler<Http2Settings>
the handler for remote endpoint settings
handler
)

Implements io.vertx.core.http.HttpConnection.remoteSettingsHandler.

Set an handler that is called when remote endpoint Http2Settings are updated.

private static ByteBuf
public synchronized Http2Settings
public HttpConnection
setWindowSize(int
the new window size
windowSize
)

Overrides default io.vertx.core.http.HttpConnection.setWindowSize.

Update the current connection wide window size to a new size.

public Future<Void>
shutdown(long timeout, TimeUnit unit)

Implements io.vertx.core.http.HttpConnection.shutdown.

Like shutdown(long, TimeUnit, Handler) but returns a Future of the asynchronous result

private void
shutdown(long timeout, PromiseInternal<Void> promise)

public synchronized HttpConnection
pack-priv VertxHttp2Stream<?>
stream(int id)

public Future<Void>
updateSettings(Http2Settings
the new settings
settings
)

Implements io.vertx.core.http.HttpConnection.updateSettings.

Send to the remote endpoint an update of the server settings.

public HttpConnection
updateSettings(Http2Settings
the new settings
settings
,
@Nullable Handler<AsyncResult<Void>>
the handler notified when the settings have been acknowledged by the remote endpoint
completionHandler
)

Implements io.vertx.core.http.HttpConnection.updateSettings.

Send to the remote endpoint an update of this endpoint settings

The completionHandler will be notified when the remote endpoint has acknowledged the settings.

protected void
updateSettings(Http2Settings settingsUpdate, Handler<AsyncResult<Void>> completionHandler)

pack-priv VertxInternal
Inherited from io.vertx.core.net.impl.ConnectionBase:
channelchannelFuturechannelHandlerContextclosecloseFuturedoPausedoResumedoSetWriteQueueMaxSizeexceptionHandlerfailflushflushflushBytesReadflushBytesWrittengetContexthandleEventhandleExceptionhandleMessageindicatedServerNameisNotWritableisSslisTrafficShapedlocalAddresslocalAddressmetricmetricmetricspeerCertificateChainpeerCertificatesremoteAddressremoteAddressremoteNamereportBytesReadreportBytesReadreportBytesWrittenreportsBytesWrittensendFilesizeofsslSessionsupportsFileRegionwriteToChannelwriteToChannelwriteToChannelwriteToChannel