Class QuarkusRestClientBuilderImpl
- java.lang.Object
-
- io.quarkus.rest.client.reactive.runtime.QuarkusRestClientBuilderImpl
-
- All Implemented Interfaces:
QuarkusRestClientBuilder,jakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
public class QuarkusRestClientBuilderImpl extends Object implements QuarkusRestClientBuilder
-
-
Constructor Summary
Constructors Constructor Description QuarkusRestClientBuilderImpl(RestClientBuilderImpl proxy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QuarkusRestClientBuilderbaseUri(URI uri)Specifies the base URI to be used when making requests.QuarkusRestClientBuilderbaseUrl(URL url)Specifies the base URL to be used when making requests.<T> Tbuild(Class<T> clazz)Based on the configured QuarkusRestClientBuilder, creates a new instance of the given REST interface to invoke API calls against.QuarkusRestClientBuilderclientHeadersFactory(Class<? extends org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory> clientHeadersFactoryClass)Specifies the client headers factory to use.QuarkusRestClientBuilderclientHeadersFactory(org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory clientHeadersFactory)Specifies the client headers factory to use.QuarkusRestClientBuilderclientLogger(org.jboss.resteasy.reactive.client.api.ClientLogger clientLogger)Specifies the client logger to use.QuarkusRestClientBuilderconnectTimeout(long timeout, TimeUnit unit)Set the connect timeout.QuarkusRestClientBuilderfollowRedirects(boolean follow)Specifies whether client built by this builder should follow HTTP redirect responses (30x) or not.jakarta.ws.rs.core.ConfigurationgetConfiguration()QuarkusRestClientBuilderhostnameVerifier(HostnameVerifier hostnameVerifier)Set the hostname verifier to verify the endpoint's hostnameQuarkusRestClientBuilderhttpClientOptions(io.vertx.core.http.HttpClientOptions httpClientOptions)Specifies the HTTP client options to use.QuarkusRestClientBuilderhttpClientOptions(Class<? extends io.vertx.core.http.HttpClientOptions> httpClientOptionsClass)Specifies the HTTP client options to use.QuarkusRestClientBuilderkeyStore(KeyStore keyStore, String keystorePassword)Set the client-side key store.QuarkusRestClientBuildernonProxyHosts(String nonProxyHosts)Specifies the hosts to access without proxy.QuarkusRestClientBuilderproperty(String name, Object value)QuarkusRestClientBuilderproxyAddress(String proxyHost, int proxyPort)Specifies the HTTP proxy hostname/IP address and port to use for requests from client instances.QuarkusRestClientBuilderproxyPassword(String proxyPassword)Specifies the proxy password.QuarkusRestClientBuilderproxyUser(String proxyUser)Specifies the proxy username.QuarkusRestClientBuilderqueryParamStyle(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.QuarkusRestClientBuilderreadTimeout(long timeout, TimeUnit unit)Set the read timeout.QuarkusRestClientBuilderregister(Class<?> componentClass)QuarkusRestClientBuilderregister(Class<?> componentClass, int priority)QuarkusRestClientBuilderregister(Class<?> componentClass, Class<?>... contracts)QuarkusRestClientBuilderregister(Class<?> componentClass, Map<Class<?>,Integer> contracts)QuarkusRestClientBuilderregister(Object component)QuarkusRestClientBuilderregister(Object component, int priority)QuarkusRestClientBuilderregister(Object component, Class<?>... contracts)QuarkusRestClientBuilderregister(Object component, Map<Class<?>,Integer> contracts)QuarkusRestClientBuildersslContext(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.QuarkusRestClientBuildertrustStore(KeyStore trustStore)Set the client-side trust store.QuarkusRestClientBuildertrustStore(KeyStore trustStore, String trustStorePassword)Set the client-side trust store.QuarkusRestClientBuilderverifyHost(boolean verifyHost)Set whether hostname verification is enabled.
-
-
-
Constructor Detail
-
QuarkusRestClientBuilderImpl
public QuarkusRestClientBuilderImpl(RestClientBuilderImpl proxy)
-
-
Method Detail
-
baseUrl
public QuarkusRestClientBuilder baseUrl(URL url)
Description copied from interface:QuarkusRestClientBuilderSpecifies the base URL to be used when making requests. Assuming that the interface has a@Path("/api")at the interface level and aurlis given withhttp://my-service:8080/servicethen all REST calls will be invoked with aurlofhttp://my-service:8080/service/apiin addition to any@Pathannotations included on the method. Subsequent calls to this method will replace the previously specified baseUri/baseUrl.- Specified by:
baseUrlin interfaceQuarkusRestClientBuilder- Parameters:
url- the base Url for the service.- Returns:
- the current builder with the baseUrl set.
-
baseUri
public QuarkusRestClientBuilder baseUri(URI uri)
Description copied from interface:QuarkusRestClientBuilderSpecifies the base URI to be used when making requests. Assuming that the interface has a@Path("/api")at the interface level and auriis given withhttp://my-service:8080/servicethen all REST calls will be invoked with auriofhttp://my-service:8080/service/apiin addition to any@Pathannotations included on the method. Subsequent calls to this method will replace the previously specified baseUri/baseUrl.- Specified by:
baseUriin interfaceQuarkusRestClientBuilder- Parameters:
uri- the base URI for the service.- Returns:
- the current builder with the baseUri set
-
connectTimeout
public QuarkusRestClientBuilder connectTimeout(long timeout, TimeUnit unit)
Description copied from interface:QuarkusRestClientBuilderSet the connect timeout.Like JAX-RS's
jakarta.ws.rs.client.ClientBuilder'sconnectTimeoutmethod, 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:
connectTimeoutin 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
public QuarkusRestClientBuilder readTimeout(long timeout, TimeUnit unit)
Description copied from interface:QuarkusRestClientBuilderSet the read timeout.Like JAX-RS's
jakarta.ws.rs.client.ClientBuilder'sreadTimeoutmethod, 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:
readTimeoutin 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
public QuarkusRestClientBuilder sslContext(SSLContext sslContext)
Description copied from interface:QuarkusRestClientBuilderSpecifies 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:
sslContextin interfaceQuarkusRestClientBuilder- Parameters:
sslContext- the ssl context- Returns:
- the current builder with ssl context set
-
verifyHost
public QuarkusRestClientBuilder verifyHost(boolean verifyHost)
Description copied from interface:QuarkusRestClientBuilderSet whether hostname verification is enabled.- Specified by:
verifyHostin interfaceQuarkusRestClientBuilder- Parameters:
verifyHost- whether the hostname verification is enabled.- Returns:
- the current builder with the hostname verification set.
-
trustStore
public QuarkusRestClientBuilder trustStore(KeyStore trustStore)
Description copied from interface:QuarkusRestClientBuilderSet the client-side trust store.- Specified by:
trustStorein interfaceQuarkusRestClientBuilder- Parameters:
trustStore- key store- Returns:
- the current builder with the trust store set
-
trustStore
public QuarkusRestClientBuilder trustStore(KeyStore trustStore, String trustStorePassword)
Description copied from interface:QuarkusRestClientBuilderSet the client-side trust store.- Specified by:
trustStorein interfaceQuarkusRestClientBuilder- Parameters:
trustStore- key storetrustStorePassword- the password for the specifiedtrustStore- Returns:
- the current builder with the trust store set
-
keyStore
public QuarkusRestClientBuilder keyStore(KeyStore keyStore, String keystorePassword)
Description copied from interface:QuarkusRestClientBuilderSet the client-side key store.- Specified by:
keyStorein interfaceQuarkusRestClientBuilder- Parameters:
keyStore- key storekeystorePassword- the password for the specifiedkeyStore- Returns:
- the current builder with the key store set
-
hostnameVerifier
public QuarkusRestClientBuilder hostnameVerifier(HostnameVerifier hostnameVerifier)
Description copied from interface:QuarkusRestClientBuilderSet the hostname verifier to verify the endpoint's hostname- Specified by:
hostnameVerifierin interfaceQuarkusRestClientBuilder- Parameters:
hostnameVerifier- the hostname verifier- Returns:
- the current builder with hostname verifier set
-
followRedirects
public QuarkusRestClientBuilder followRedirects(boolean follow)
Description copied from interface:QuarkusRestClientBuilderSpecifies whether client built by this builder should follow HTTP redirect responses (30x) or not.- Specified by:
followRedirectsin interfaceQuarkusRestClientBuilder- Parameters:
follow- true if the client should follow HTTP redirects, false if not.- Returns:
- the current builder with the followRedirect property set.
-
proxyAddress
public QuarkusRestClientBuilder proxyAddress(String proxyHost, int proxyPort)
Description copied from interface:QuarkusRestClientBuilderSpecifies the HTTP proxy hostname/IP address and port to use for requests from client instances.- Specified by:
proxyAddressin 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
public QuarkusRestClientBuilder proxyPassword(String proxyPassword)
Description copied from interface:QuarkusRestClientBuilderSpecifies the proxy password.- Specified by:
proxyPasswordin interfaceQuarkusRestClientBuilder- Parameters:
proxyPassword- the proxy password.- Returns:
- the current builder
-
proxyUser
public QuarkusRestClientBuilder proxyUser(String proxyUser)
Description copied from interface:QuarkusRestClientBuilderSpecifies the proxy username.- Specified by:
proxyUserin interfaceQuarkusRestClientBuilder- Parameters:
proxyUser- the proxy username.- Returns:
- the current builder
-
nonProxyHosts
public QuarkusRestClientBuilder nonProxyHosts(String nonProxyHosts)
Description copied from interface:QuarkusRestClientBuilderSpecifies the hosts to access without proxy.- Specified by:
nonProxyHostsin 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:QuarkusRestClientBuilderSpecifies the URI formatting style to use when multiple query parameter values are passed to the client.- Specified by:
queryParamStylein 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:
getConfigurationin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
property
public QuarkusRestClientBuilder property(String name, Object value)
- Specified by:
propertyin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Class<?> componentClass)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Class<?> componentClass, int priority)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Class<?> componentClass, Class<?>... contracts)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Class<?> componentClass, Map<Class<?>,Integer> contracts)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Object component)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Object component, int priority)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Object component, Class<?>... contracts)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
register
public QuarkusRestClientBuilder register(Object component, Map<Class<?>,Integer> contracts)
- Specified by:
registerin interfacejakarta.ws.rs.core.Configurable<QuarkusRestClientBuilder>
-
clientHeadersFactory
public QuarkusRestClientBuilder clientHeadersFactory(Class<? extends org.eclipse.microprofile.rest.client.ext.ClientHeadersFactory> clientHeadersFactoryClass)
Description copied from interface:QuarkusRestClientBuilderSpecifies the client headers factory to use.- Specified by:
clientHeadersFactoryin 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:QuarkusRestClientBuilderSpecifies the client headers factory to use.- Specified by:
clientHeadersFactoryin 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:QuarkusRestClientBuilderSpecifies the HTTP client options to use.- Specified by:
httpClientOptionsin 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:QuarkusRestClientBuilderSpecifies the HTTP client options to use.- Specified by:
httpClientOptionsin 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:QuarkusRestClientBuilderSpecifies the client logger to use.- Specified by:
clientLoggerin interfaceQuarkusRestClientBuilder- Parameters:
clientLogger- the client logger to use.- Returns:
- the current builder
-
build
public <T> T build(Class<T> clazz) throws IllegalStateException, org.eclipse.microprofile.rest.client.RestClientDefinitionException
Description copied from interface:QuarkusRestClientBuilderBased on the configured QuarkusRestClientBuilder, creates a new instance of the given REST interface to invoke API calls against.- Specified by:
buildin 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.
-
-