Package io.undertow.client.http2
Class Http2ClientConnection
java.lang.Object
io.undertow.client.http2.Http2ClientConnection
- All Implemented Interfaces:
ClientConnection,Closeable,AutoCloseable,Channel
- Author:
- Stuart Douglas
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.undertow.client.ClientConnection
ClientConnection.PingListener -
Constructor Summary
ConstructorsConstructorDescriptionHttp2ClientConnection(Http2Channel http2Channel, boolean initialUpgradeRequest, String defaultHost, ClientStatistics clientStatistics, boolean secure) Http2ClientConnection(Http2Channel http2Channel, ClientCallback<ClientExchange> upgradeReadyCallback, ClientRequest clientRequest, String defaultHost, ClientStatistics clientStatistics, boolean secure) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseListener(org.xnio.ChannelListener<ClientConnection> listener) Adds a close listener, than will be invoked with the connection is closedvoidclose()org.xnio.ChannelListener.Setter<? extends ClientConnection>org.xnio.XnioIoThread<A extends SocketAddress>
AgetLocalAddress(Class<A> type) <T> TgetOption(org.xnio.Option<T> option) <A extends SocketAddress>
AgetPeerAddress(Class<A> type) org.xnio.XnioWorkerbooleanbooleanisOpen()booleanbooleanbooleanbooleanorg.xnio.StreamConnectionUpgrade the connection, if the underlying protocol supports it.voidsendPing(ClientConnection.PingListener listener, long timeout, TimeUnit timeUnit) voidsendRequest(ClientRequest request, ClientCallback<ClientExchange> clientCallback) Sends a client request.<T> TsetOption(org.xnio.Option<T> option, T value) booleansupportsOption(org.xnio.Option<?> option)
-
Constructor Details
-
Http2ClientConnection
public Http2ClientConnection(Http2Channel http2Channel, boolean initialUpgradeRequest, String defaultHost, ClientStatistics clientStatistics, boolean secure) -
Http2ClientConnection
public Http2ClientConnection(Http2Channel http2Channel, ClientCallback<ClientExchange> upgradeReadyCallback, ClientRequest clientRequest, String defaultHost, ClientStatistics clientStatistics, boolean secure)
-
-
Method Details
-
sendRequest
Description copied from interface:ClientConnectionSends a client request. The request object should not be modified after it has been submitted to the connection.Request objects can be queued. Once the request is in a state that it is ready to be sent the
clientCallbackis invoked to provide the caller with theClientExchangeIf
ClientConnection.isMultiplexingSupported()returns true then multiple requests may be active at the same time, and a later request may complete before an earlier one.Note that the request header may not be written out until after the callback has been invoked. This allows the client to write out a header with a gathering write if the request contains content.
- Specified by:
sendRequestin interfaceClientConnection- Parameters:
request- The request to send.
-
performUpgrade
Description copied from interface:ClientConnectionUpgrade the connection, if the underlying protocol supports it. This should only be called after an upgrade request has been submitted and the target server has accepted the upgrade.- Specified by:
performUpgradein interfaceClientConnection- Returns:
- The resulting StreamConnection
- Throws:
IOException
-
getBufferPool
- Specified by:
getBufferPoolin interfaceClientConnection- Returns:
- The buffer pool used by the client
-
getPeerAddress
- Specified by:
getPeerAddressin interfaceClientConnection
-
getPeerAddress
- Specified by:
getPeerAddressin interfaceClientConnection
-
getCloseSetter
- Specified by:
getCloseSetterin interfaceClientConnection
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceClientConnection
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceClientConnection
-
getWorker
public org.xnio.XnioWorker getWorker()- Specified by:
getWorkerin interfaceClientConnection
-
getIoThread
public org.xnio.XnioIoThread getIoThread()- Specified by:
getIoThreadin interfaceClientConnection
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceChannel- Specified by:
isOpenin interfaceClientConnection
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
supportsOption
public boolean supportsOption(org.xnio.Option<?> option) - Specified by:
supportsOptionin interfaceClientConnection
-
getOption
- Specified by:
getOptionin interfaceClientConnection- Throws:
IOException
-
setOption
public <T> T setOption(org.xnio.Option<T> option, T value) throws IllegalArgumentException, IOException - Specified by:
setOptionin interfaceClientConnection- Throws:
IllegalArgumentExceptionIOException
-
isUpgraded
public boolean isUpgraded()- Specified by:
isUpgradedin interfaceClientConnection
-
isPushSupported
public boolean isPushSupported()- Specified by:
isPushSupportedin interfaceClientConnection- Returns:
trueif this connection support server push
-
isMultiplexingSupported
public boolean isMultiplexingSupported()- Specified by:
isMultiplexingSupportedin interfaceClientConnection- Returns:
trueif this client supports multiplexing
-
getStatistics
- Specified by:
getStatisticsin interfaceClientConnection- Returns:
- the statistics information, or
nullif statistics are not supported or disabled
-
isUpgradeSupported
public boolean isUpgradeSupported()- Specified by:
isUpgradeSupportedin interfaceClientConnection
-
addCloseListener
Description copied from interface:ClientConnectionAdds a close listener, than will be invoked with the connection is closed- Specified by:
addCloseListenerin interfaceClientConnection- Parameters:
listener- The close listener
-
isPingSupported
public boolean isPingSupported()- Specified by:
isPingSupportedin interfaceClientConnection- Returns:
trueif the underlying protocol supports sending a ping
-
sendPing
- Specified by:
sendPingin interfaceClientConnection
-