java.lang.Object
io.helidon.webclient.http2.Http2ClientImpl
- All Implemented Interfaces:
RuntimeType.Api<Http2ClientConfig>,HttpClient<Http2ClientRequest>,ReleasableResource,Http2Client,HttpClientSpi
Implementation of HTTP2 client.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webclient.spi.HttpClientSpi
HttpClientSpi.SupportLevel -
Field Summary
Fields inherited from interface io.helidon.webclient.http2.Http2Client
PROTOCOL, PROTOCOL_ID -
Method Summary
Modifier and TypeMethodDescriptionclientRequest(FullClientRequest<?> clientRequest, ClientUri clientUri) Create a client request based on the provided HTTP request that is for the version of this client.voidGracefully close all opened client specific connections.Create a request for a method.The prototype as it was received when creating this runtime object instance.supports(FullClientRequest<?> clientRequest, ClientUri clientUri) Return whether this HTTP version can handle the provided request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.webclient.api.HttpClient
delete, delete, get, get, head, head, options, options, patch, patch, post, post, put, put, trace, traceMethods inherited from interface io.helidon.webclient.spi.HttpClientSpi
isTcpMethods inherited from interface io.helidon.webclient.api.ReleasableResource
releaseResource
-
Method Details
-
method
Description copied from interface:HttpClientCreate a request for a method.- Specified by:
methodin interfaceHttpClient<Http2ClientRequest>- Parameters:
method- HTTP method- Returns:
- a new request (not thread safe)
-
prototype
Description copied from interface:RuntimeType.ApiThe prototype as it was received when creating this runtime object instance.- Specified by:
prototypein interfaceRuntimeType.Api<Http2ClientConfig>- Returns:
- prototype object used to create this instance
-
supports
Description copied from interface:HttpClientSpiReturn whether this HTTP version can handle the provided request.Examples:
- HTTP/1.1 always returns true, as it is the fallback protocol of all other protocols
- HTTP/2 returns true when upgrade is enabled, false when prior-knowledge is specified (as we can always attempt to upgrade and fallback to 1.1 in the first case, but we would fail with prior-knowledge, unless the endpoint is known to be HTTP/2
- HTTP/3 would always return true, as it cannot fallback once a connection is attempted
- An explicit protocol id is configured for the request -
HttpClientRequest.protocolId(String) - There is no fallback protocol enabled, in such a case, we use the one with highest priority - see
WebClientConfig.BuilderBase.addProtocolPreference(String) - We get an
Alt-Svcheader from a response that points us to a protocol version (we only support permanent protocol changes,Alt-Svcwith timeout will be ignored - This protocol version already handled a request to such an endpoint and has the connection available
- Specified by:
supportsin interfaceHttpClientSpi- Parameters:
clientRequest- HTTP requestclientUri- URI to invoke- Returns:
trueif we are sure we can handle this request with this protocol version
-
clientRequest
Description copied from interface:HttpClientSpiCreate a client request based on the provided HTTP request that is for the version of this client.- Specified by:
clientRequestin interfaceHttpClientSpi- Parameters:
clientRequest- request configurationclientUri- URI to invoke (resolved)- Returns:
- a new request
-
closeResource
public void closeResource()Description copied from interface:HttpClientGracefully close all opened client specific connections.- Specified by:
closeResourcein interfaceHttpClient<Http2ClientRequest>- Specified by:
closeResourcein interfaceReleasableResource
-