Class HttpConnection
- All Implemented Interfaces:
MutinyDelegate
- Direct Known Subclasses:
HttpClientConnection
close()closeHandler(java.lang.Runnable)exceptionHandler(java.util.function.Consumer<java.lang.Throwable>)
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Julien Viet
- See Also:
-
HttpConnection
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHttpConnection(io.vertx.core.http.HttpConnection delegate) Create a new instance ofHttpConnectiondelegating to the given (non-null) instance ofHttpConnection.HttpConnection(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>close()Close immediately (shutdown(0, TimeUnit.SECONDS).voidClose immediately (shutdown(0, TimeUnit.SECONDS).Close immediately (shutdown(0, TimeUnit.SECONDS).closeHandler(Runnable handler) Set a close handler.booleanexceptionHandler(Consumer<Throwable> handler) Set an handler called when a connection error happensio.vertx.core.http.HttpConnectionGet the delegate instance.intgoAway(long errorCode) Deprecated.goAway(long errorCode, int lastStreamId) Deprecated.instead useshutdown()goAway(long errorCode, int lastStreamId, io.vertx.core.buffer.Buffer debugData) Deprecated.instead useshutdown()goAwayHandler(Consumer<io.vertx.core.http.GoAway> handler) Set an handler called when a GOAWAY frame is received.inthashCode()Returns the SNI server name presented during the SSL handshake by the client.booleanisSsl()io.vertx.core.net.SocketAddressio.vertx.core.net.SocketAddresslocalAddress(boolean real) static HttpConnectionnewInstance(io.vertx.core.http.HttpConnection delegate) Creates a new instance of theHttpConnection.io.smallrye.mutiny.Uni<io.vertx.core.buffer.Buffer>ping(io.vertx.core.buffer.Buffer data) Send a PING frame to the remote endpoint.io.vertx.core.buffer.BufferpingAndAwait(io.vertx.core.buffer.Buffer data) Send a PING frame to the remote endpoint.pingAndForget(io.vertx.core.buffer.Buffer data) Send a PING frame to the remote endpoint.pingHandler(Consumer<io.vertx.core.buffer.Buffer> handler) Set an handler notified when a PING frame is received from the remote endpoint.io.vertx.core.http.HttpVersionio.vertx.core.net.SocketAddressio.vertx.core.net.SocketAddressremoteAddress(boolean real) io.vertx.core.http.HttpSettingsremoteSettingsHandler(Consumer<io.vertx.core.http.HttpSettings> handler) Set an handler that is called when remote endpointHttpSettingsare updated.io.vertx.core.http.HttpSettingssettings()setWindowSize(int windowSize) Update the current connection wide window size to a new size.io.smallrye.mutiny.Uni<Void>shutdown()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).io.smallrye.mutiny.Uni<Void>Callsshutdown(Duration)io.smallrye.mutiny.Uni<Void>Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed.voidShutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).voidshutdownAndAwait(long timeout, TimeUnit unit) Callsshutdown(Duration)voidshutdownAndAwait(Duration timeout) Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed.Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).shutdownAndForget(long timeout, TimeUnit unit) Callsshutdown(Duration)shutdownAndForget(Duration timeout) Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed.shutdownHandler(Runnable handler) Set ahandlernotified when the HTTP connection is shutdown: the client or server will close the connection within a certain amount of time.toString()io.smallrye.mutiny.Uni<Void>updateSettings(io.vertx.core.http.HttpSettings settings) Send to the remote endpoint an update of this endpoint settingsvoidupdateSettingsAndAwait(io.vertx.core.http.HttpSettings settings) Send to the remote endpoint an update of this endpoint settingsupdateSettingsAndForget(io.vertx.core.http.HttpSettings settings) Send to the remote endpoint an update of this endpoint settings
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HttpConnection
public HttpConnection(io.vertx.core.http.HttpConnection delegate) Create a new instance ofHttpConnectiondelegating to the given (non-null) instance ofHttpConnection. -
HttpConnection
-
-
Method Details
-
getDelegate
public io.vertx.core.http.HttpConnection getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
shutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpConnection.shutdown()
-
shutdownAndAwait
public void shutdownAndAwait()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
HttpConnection.shutdown()
-
shutdownAndForget
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpConnection.shutdown()
-
shutdown
Callsshutdown(Duration)Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpConnection.shutdown(long, TimeUnit)
-
shutdownAndAwait
Callsshutdown(Duration)Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
HttpConnection.shutdown(long, TimeUnit)
-
shutdownAndForget
Callsshutdown(Duration)Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpConnection.shutdown(long, TimeUnit)
-
shutdown
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed. Client connection are immediately removed from the pool.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
- HTTP/1.x connection will be closed.
Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpConnection.shutdown(Duration)
-
shutdownAndAwait
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed. Client connection are immediately removed from the pool.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
- HTTP/1.x connection will be closed.
Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
timeout- the amount of time after which all resources are forcibly closed- See Also:
-
HttpConnection.shutdown(Duration)
-
shutdownAndForget
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed. Client connection are immediately removed from the pool.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
- HTTP/1.x connection will be closed.
Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpConnection.shutdown(Duration)
-
close
Close immediately (shutdown(0, TimeUnit.SECONDS).Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpConnection.close()
-
closeAndAwait
public void closeAndAwait()Close immediately (shutdown(0, TimeUnit.SECONDS).Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- See Also:
-
HttpConnection.close()
-
closeAndForget
Close immediately (shutdown(0, TimeUnit.SECONDS).Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpConnection.close()
-
updateSettings
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> updateSettings(io.vertx.core.http.HttpSettings settings) Send to the remote endpoint an update of this endpoint settings ThecompletionHandlerwill be notified when the remote endpoint has acknowledged the settings. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
settings- the new settings- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpConnection.updateSettings(HttpSettings)
-
updateSettingsAndAwait
public void updateSettingsAndAwait(io.vertx.core.http.HttpSettings settings) Send to the remote endpoint an update of this endpoint settings ThecompletionHandlerwill be notified when the remote endpoint has acknowledged the settings. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
settings- the new settings- See Also:
-
HttpConnection.updateSettings(HttpSettings)
-
updateSettingsAndForget
Send to the remote endpoint an update of this endpoint settings ThecompletionHandlerwill be notified when the remote endpoint has acknowledged the settings. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
settings- the new settings- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpConnection.updateSettings(HttpSettings)
-
ping
@CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.buffer.Buffer> ping(io.vertx.core.buffer.Buffer data) Send a PING frame to the remote endpoint. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
data- the 8 bytes data of the frame- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
HttpConnection.ping(Buffer)
-
pingAndAwait
public io.vertx.core.buffer.Buffer pingAndAwait(io.vertx.core.buffer.Buffer data) Send a PING frame to the remote endpoint. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method returns a
Buffer. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in aRuntimeException).- Parameters:
data- the 8 bytes data of the frame- Returns:
- The operation result
- See Also:
-
HttpConnection.ping(Buffer)
-
pingAndForget
Send a PING frame to the remote endpoint. This is not implemented for HTTP/1.x.Unlike the bare Vert.x variant, this method ignores the
Bufferresult or any failure.- Parameters:
data- the 8 bytes data of the frame- Returns:
- The current instance to chain operations if needed.
- See Also:
-
HttpConnection.ping(Buffer)
-
protocolVersion
public io.vertx.core.http.HttpVersion protocolVersion()- Returns:
- the version of the protocol of this connection
-
getWindowSize
public int getWindowSize()- Returns:
- the current connection window size or
-1for HTTP/1.x
-
setWindowSize
Update the current connection wide window size to a new size. Increasing this value, gives better performance when several data streams are multiplexed This is not implemented for HTTP/1.x.- Parameters:
windowSize- the new window size- Returns:
- a reference to this, so the API can be used fluently
-
goAway
Deprecated.instead useshutdown()LikegoAway(long, int)with a last stream id-1which means to disallow any new stream creation. -
goAway
Deprecated.instead useshutdown()LikegoAway(long, int, Buffer)with no buffer. -
goAway
@Deprecated public HttpConnection goAway(long errorCode, int lastStreamId, io.vertx.core.buffer.Buffer debugData) Deprecated.instead useshutdown()Send a go away frame to the remote endpoint of the connection.- a GOAWAY frame is sent to the to the remote endpoint with the
errorCodeanddebugData - any stream created after the stream identified by
lastStreamIdwill be closed - for an errorCode is different than
0when all the remaining streams are closed this connection will be closed automatically
- Parameters:
errorCode- the GOAWAY error codelastStreamId- the last stream iddebugData- additional debug data sent to the remote endpoint- Returns:
- a reference to this, so the API can be used fluently
- a GOAWAY frame is sent to the to the remote endpoint with the
-
goAwayHandler
Set an handler called when a GOAWAY frame is received. This is not implemented for HTTP/1.x.- Parameters:
handler- the handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
shutdownHandler
Set ahandlernotified when the HTTP connection is shutdown: the client or server will close the connection within a certain amount of time. This gives the opportunity to thehandlerto close the current requests in progress gracefully before the HTTP connection is forcefully closed.- Parameters:
handler- the handler. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
closeHandler
Set a close handler. The handler will get notified when the connection is closed.- Parameters:
handler- the handler to be notified- Returns:
- a reference to this, so the API can be used fluently
-
settings
public io.vertx.core.http.HttpSettings settings()- Returns:
- the latest server settings acknowledged by the remote endpoint - this is not implemented for HTTP/1.x
-
remoteSettings
public io.vertx.core.http.HttpSettings remoteSettings()- Returns:
- the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x
-
remoteSettingsHandler
Set an handler that is called when remote endpointHttpSettingsare updated. This is not implemented for HTTP/1.x.- Parameters:
handler- the handler for remote endpoint settings- Returns:
- a reference to this, so the API can be used fluently
-
pingHandler
Set an handler notified when a PING frame is received from the remote endpoint. This is not implemented for HTTP/1.x.- Parameters:
handler- the handler to be called when a PING is received. Can benull.- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
Set an handler called when a connection error happens- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
remoteAddress
public io.vertx.core.net.SocketAddress remoteAddress()- Returns:
- the remote address for this connection, possibly
null(e.g a server bound on a domain socket). IfuseProxyProtocolis set totrue, the address returned will be of the actual connecting client.
-
remoteAddress
public io.vertx.core.net.SocketAddress remoteAddress(boolean real) -
localAddress
public io.vertx.core.net.SocketAddress localAddress()- Returns:
- the local address for this connection, possibly
null(e.g a server bound on a domain socket) IfuseProxyProtocolis set totrue, the address returned will be of the proxy.
-
localAddress
public io.vertx.core.net.SocketAddress localAddress(boolean real) -
isSsl
public boolean isSsl()- Returns:
- true if this
HttpConnectionis encrypted via SSL/TLS.
-
sslSession
- Returns:
- SSLSession associated with the underlying socket. Returns null if connection is not SSL.
- See Also:
-
indicatedServerName
Returns the SNI server name presented during the SSL handshake by the client.- Returns:
- the indicated server name
-
newInstance
Creates a new instance of theHttpConnection. -
hashCode
public int hashCode() -
equals
-
toString
-
shutdown()