Class QuarkusRestClientBuilderImpl
- All Implemented Interfaces:
QuarkusRestClientBuilder
,jakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the base URI to be used when making requests.Specifies the base URL to be used when making requests.<T> T
Based on the configured QuarkusRestClientBuilder, creates a new instance of the given REST interface to invoke API calls against.clientHeadersFactory
(Class<? extends org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory> clientHeadersFactoryClass) Specifies the client headers factory to use.clientHeadersFactory
(org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory clientHeadersFactory) Specifies the client headers factory to use.clientLogger
(org.jboss.resteasy.reactive.client.api.ClientLogger clientLogger) Specifies the client logger to use.connectTimeout
(long timeout, TimeUnit unit) Set the connect timeout.followRedirects
(boolean follow) Specifies whether client built by this builder should follow HTTP redirect responses (30x) or not.jakarta.ws.rs.core.Configuration
hostnameVerifier
(HostnameVerifier hostnameVerifier) Set the hostname verifier to verify the endpoint's hostnamehttpClientOptions
(io.vertx.core.http.HttpClientOptions httpClientOptions) Specifies the HTTP client options to use.httpClientOptions
(Class<? extends io.vertx.core.http.HttpClientOptions> httpClientOptionsClass) Specifies the HTTP client options to use.Set the client-side key store.loggingBodyLimit
(Integer limit) How many characters of the body should be logged.loggingScope
(org.jboss.resteasy.reactive.client.api.LoggingScope loggingScope) Specifies the client logger to use.nonProxyHosts
(String nonProxyHosts) Specifies the hosts to access without proxy.proxyAddress
(String proxyHost, int proxyPort) Specifies the HTTP proxy hostname/IP address and port to use for requests from client instances.proxyPassword
(String proxyPassword) Specifies the proxy password.Specifies the proxy username.queryParamStyle
(org.eclipse.microprofile.rest.client.ext.QueryParamStyle style) Specifies the URI formatting style to use when multiple query parameter values are passed to the client.readTimeout
(long timeout, TimeUnit unit) Set the read timeout.sslContext
(SSLContext sslContext) Specifies the SSL context to use when creating secured transport connections to server endpoints from web targets created by the client instance that is using this SSL context.trustAll
(boolean trustAll) Enable trusting all certificates.trustStore
(KeyStore trustStore) Set the client-side trust store.trustStore
(KeyStore trustStore, String trustStorePassword) Set the client-side trust store.verifyHost
(boolean verifyHost) Set whether hostname verification is enabled.
-
Constructor Details
-
QuarkusRestClientBuilderImpl
-
-
Method Details
-
baseUrl
Description copied from interface:QuarkusRestClientBuilder
Specifies the base URL to be used when making requests. Assuming that the interface has a@Path("/api")
at the interface level and aurl
is given withhttp://my-service:8080/service
then all REST calls will be invoked with aurl
ofhttp://my-service:8080/service/api
in addition to any@Path
annotations included on the method. Subsequent calls to this method will replace the previously specified baseUri/baseUrl.- Specified by:
baseUrl
in interfaceQuarkusRestClientBuilder
- Parameters:
url
- the base Url for the service.- Returns:
- the current builder with the baseUrl set.
-
baseUri
Description copied from interface:QuarkusRestClientBuilder
Specifies the base URI to be used when making requests. Assuming that the interface has a@Path("/api")
at the interface level and auri
is given withhttp://my-service:8080/service
then all REST calls will be invoked with auri
ofhttp://my-service:8080/service/api
in addition to any@Path
annotations included on the method. Subsequent calls to this method will replace the previously specified baseUri/baseUrl.- Specified by:
baseUri
in interfaceQuarkusRestClientBuilder
- Parameters:
uri
- the base URI for the service.- Returns:
- the current builder with the baseUri set
-
connectTimeout
Description copied from interface:QuarkusRestClientBuilder
Set the connect timeout.Like JAX-RS's
jakarta.ws.rs.client.ClientBuilder
'sconnectTimeout
method, specifying a timeout of 0 represents infinity, and negative values are not allowed.If the client instance is injected via CDI and the "fully.qualified.InterfaceName/mp-rest/connectTimeout" property is set via MicroProfile Config, that property's value will override, the value specified to this method.
- Specified by:
connectTimeout
in interfaceQuarkusRestClientBuilder
- Parameters:
timeout
- the maximum time to wait.unit
- the time unit of the timeout argument.- Returns:
- the current builder with the connect timeout set.
-
readTimeout
Description copied from interface:QuarkusRestClientBuilder
Set the read timeout.Like JAX-RS's
jakarta.ws.rs.client.ClientBuilder
'sreadTimeout
method, specifying a timeout of 0 represents infinity, and negative values are not allowed.Also like the JAX-RS Client API, if the read timeout is reached, the client interface method will throw a
jakarta.ws.rs.ProcessingException
.If the client instance is injected via CDI and the "fully.qualified.InterfaceName/mp-rest/readTimeout" property is set via MicroProfile Config, that property's value will override, the value specified to this method.
- Specified by:
readTimeout
in interfaceQuarkusRestClientBuilder
- Parameters:
timeout
- the maximum time to wait.unit
- the time unit of the timeout argument.- Returns:
- the current builder with the connect timeout set.
-
sslContext
Description copied from interface:QuarkusRestClientBuilder
Specifies the SSL context to use when creating secured transport connections to server endpoints from web targets created by the client instance that is using this SSL context.- Specified by:
sslContext
in interfaceQuarkusRestClientBuilder
- Parameters:
sslContext
- the ssl context- Returns:
- the current builder with ssl context set
-
verifyHost
Description copied from interface:QuarkusRestClientBuilder
Set whether hostname verification is enabled.- Specified by:
verifyHost
in interfaceQuarkusRestClientBuilder
- Parameters:
verifyHost
- whether the hostname verification is enabled.- Returns:
- the current builder with the hostname verification set.
-
trustStore
Description copied from interface:QuarkusRestClientBuilder
Set the client-side trust store.- Specified by:
trustStore
in interfaceQuarkusRestClientBuilder
- Parameters:
trustStore
- key store- Returns:
- the current builder with the trust store set
-
trustStore
Description copied from interface:QuarkusRestClientBuilder
Set the client-side trust store.- Specified by:
trustStore
in interfaceQuarkusRestClientBuilder
- Parameters:
trustStore
- key storetrustStorePassword
- the password for the specifiedtrustStore
- Returns:
- the current builder with the trust store set
-
keyStore
Description copied from interface:QuarkusRestClientBuilder
Set the client-side key store.- Specified by:
keyStore
in interfaceQuarkusRestClientBuilder
- Parameters:
keyStore
- key storekeystorePassword
- the password for the specifiedkeyStore
- Returns:
- the current builder with the key store set
-
hostnameVerifier
Description copied from interface:QuarkusRestClientBuilder
Set the hostname verifier to verify the endpoint's hostname- Specified by:
hostnameVerifier
in interfaceQuarkusRestClientBuilder
- Parameters:
hostnameVerifier
- the hostname verifier- Returns:
- the current builder with hostname verifier set
-
followRedirects
Description copied from interface:QuarkusRestClientBuilder
Specifies whether client built by this builder should follow HTTP redirect responses (30x) or not.- Specified by:
followRedirects
in interfaceQuarkusRestClientBuilder
- Parameters:
follow
- true if the client should follow HTTP redirects, false if not.- Returns:
- the current builder with the followRedirect property set.
-
proxyAddress
Description copied from interface:QuarkusRestClientBuilder
Specifies the HTTP proxy hostname/IP address and port to use for requests from client instances.- Specified by:
proxyAddress
in interfaceQuarkusRestClientBuilder
- Parameters:
proxyHost
- hostname or IP address of proxy server - must be non-nullproxyPort
- port of proxy server- Returns:
- the current builder with the proxy host set
-
proxyPassword
Description copied from interface:QuarkusRestClientBuilder
Specifies the proxy password.- Specified by:
proxyPassword
in interfaceQuarkusRestClientBuilder
- Parameters:
proxyPassword
- the proxy password.- Returns:
- the current builder
-
proxyUser
Description copied from interface:QuarkusRestClientBuilder
Specifies the proxy username.- Specified by:
proxyUser
in interfaceQuarkusRestClientBuilder
- Parameters:
proxyUser
- the proxy username.- Returns:
- the current builder
-
nonProxyHosts
Description copied from interface:QuarkusRestClientBuilder
Specifies the hosts to access without proxy.- Specified by:
nonProxyHosts
in interfaceQuarkusRestClientBuilder
- Parameters:
nonProxyHosts
- the hosts to access without proxy.- Returns:
- the current builder
-
queryParamStyle
public QuarkusRestClientBuilder queryParamStyle(org.eclipse.microprofile.rest.client.ext.QueryParamStyle style) Description copied from interface:QuarkusRestClientBuilder
Specifies the URI formatting style to use when multiple query parameter values are passed to the client.- Specified by:
queryParamStyle
in interfaceQuarkusRestClientBuilder
- Parameters:
style
- the URI formatting style to use for multiple query parameter values- Returns:
- the current builder with the style of query params set
-
getConfiguration
public jakarta.ws.rs.core.Configuration getConfiguration()- Specified by:
getConfiguration
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
property
- Specified by:
property
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
- Specified by:
register
in interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
clientHeadersFactory
public QuarkusRestClientBuilder clientHeadersFactory(Class<? extends org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory> clientHeadersFactoryClass) Description copied from interface:QuarkusRestClientBuilder
Specifies the client headers factory to use.- Specified by:
clientHeadersFactory
in interfaceQuarkusRestClientBuilder
- Parameters:
clientHeadersFactoryClass
- the client headers factory class to use.- Returns:
- the current builder
-
clientHeadersFactory
public QuarkusRestClientBuilder clientHeadersFactory(org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory clientHeadersFactory) Description copied from interface:QuarkusRestClientBuilder
Specifies the client headers factory to use.- Specified by:
clientHeadersFactory
in interfaceQuarkusRestClientBuilder
- Parameters:
clientHeadersFactory
- the client headers factory to use.- Returns:
- the current builder
-
httpClientOptions
public QuarkusRestClientBuilder httpClientOptions(Class<? extends io.vertx.core.http.HttpClientOptions> httpClientOptionsClass) Description copied from interface:QuarkusRestClientBuilder
Specifies the HTTP client options to use.- Specified by:
httpClientOptions
in interfaceQuarkusRestClientBuilder
- Parameters:
httpClientOptionsClass
- the HTTP client options to use.- Returns:
- the current builder
-
httpClientOptions
public QuarkusRestClientBuilder httpClientOptions(io.vertx.core.http.HttpClientOptions httpClientOptions) Description copied from interface:QuarkusRestClientBuilder
Specifies the HTTP client options to use.- Specified by:
httpClientOptions
in interfaceQuarkusRestClientBuilder
- Parameters:
httpClientOptions
- the HTTP client options to use.- Returns:
- the current builder
-
clientLogger
public QuarkusRestClientBuilder clientLogger(org.jboss.resteasy.reactive.client.api.ClientLogger clientLogger) Description copied from interface:QuarkusRestClientBuilder
Specifies the client logger to use.- Specified by:
clientLogger
in interfaceQuarkusRestClientBuilder
- Parameters:
clientLogger
- the client logger to use.- Returns:
- the current builder
-
loggingScope
public QuarkusRestClientBuilder loggingScope(org.jboss.resteasy.reactive.client.api.LoggingScope loggingScope) Description copied from interface:QuarkusRestClientBuilder
Specifies the client logger to use.- Specified by:
loggingScope
in interfaceQuarkusRestClientBuilder
- Parameters:
loggingScope
- to use- Returns:
- the current builder
-
loggingBodyLimit
Description copied from interface:QuarkusRestClientBuilder
How many characters of the body should be logged. Message body can be large and can easily pollute the logs.- Specified by:
loggingBodyLimit
in interfaceQuarkusRestClientBuilder
-
trustAll
Description copied from interface:QuarkusRestClientBuilder
Enable trusting all certificates. Disable by default.- Specified by:
trustAll
in interfaceQuarkusRestClientBuilder
-
build
public <T> T build(Class<T> clazz) throws IllegalStateException, org.eclipse.microprofile.rest.client.RestClientDefinitionException Description copied from interface:QuarkusRestClientBuilder
Based on the configured QuarkusRestClientBuilder, creates a new instance of the given REST interface to invoke API calls against.- Specified by:
build
in interfaceQuarkusRestClientBuilder
- Type Parameters:
T
- the type of the interface- Parameters:
clazz
- the interface that defines REST API methods for use- Returns:
- a new instance of an implementation of this REST interface that
- Throws:
IllegalStateException
- if not all pre-requisites are satisfied for the builder, this exception may get thrown. For instance, if the base URI/URL has not been set.org.eclipse.microprofile.rest.client.RestClientDefinitionException
- if the passed-in interface class is invalid.
-