Invoking newBuilder() is intended to always create a new instance, not use a cached version.
The RestClientBuilder is a Configurable class as defined by Jakarta RESTful Web Services. This
allows a user to register providers, implementation specific configuration.
Implementations are expected to implement this class and provide the instance via the mechanism in
RestClientBuilderResolver#instance().
| Modifier and Type | Method and Description |
|---|---|
| public default RestClientBuilder | |
| public default RestClientBuilder | |
| public RestClientBuilder | |
| public < the type of the interface T> T | |
| public RestClientBuilder | Returns: the current builder with the connect timeout set.the maximum time to wait. timeout, TimeUnit the time unit of the timeout argument. unit)Set the connect timeout. |
| public RestClientBuilder | Returns: the current builder with the executorService set.the executor service for the runtime to use when invoking asynchronous Rest Client interface methods -
must be non-null. executor)Specifies the |
| public RestClientBuilder | Returns: the current builder with the followRedirect property set.- true if the client should follow HTTP redirects, false if not. follow)Specifies whether client built by this builder should follow HTTP redirect responses (30x) or not. |
| public RestClientBuilder | |
| public RestClientBuilder | Returns: the current builder with hostname verifier setthe hostname verifier hostnameVerifier)Set the hostname verifier to verify the endpoint's hostname |
| public RestClientBuilder | |
| public static RestClientBuilder | |
| public RestClientBuilder | Returns: the current builder with the proxy host set- hostname or IP address of proxy server - must be non-null proxyHost, int - port of proxy server proxyPort)Specifies the HTTP proxy hostname/IP address and port to use for requests from client instances. |
| public RestClientBuilder | Returns: the current builder with the style of query params set- the URI formatting style to use for multiple query parameter values style)Specifies the URI formatting style to use when multiple query parameter values are passed to the client. |
| public RestClientBuilder | Returns: the current builder with the connect timeout set.the maximum time to wait. timeout, TimeUnit the time unit of the timeout argument. unit)Set the read timeout. |
| public RestClientBuilder | Returns: the current builder with ssl context setthe ssl context 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. |
| public RestClientBuilder | Returns: the current builder with the trust store setkey store trustStore)Set the client-side trust store. |
| baseUri | back to summary |
|---|---|
| public default RestClientBuilder baseUri(URI uri) Specifies the base URI to be used when making requests. Assuming that the interface has a
| |
| baseUri | back to summary |
|---|---|
| public default RestClientBuilder baseUri(String uri) Specifies the base URI to be used when making requests. Assuming that the interface has a
| |
| baseUrl | back to summary |
|---|---|
| public RestClientBuilder baseUrl(URL url) Specifies the base URL to be used when making requests. Assuming that the interface has a
| |
| build | back to summary |
|---|---|
| public <T> T build(Class<T> clazz) throws IllegalStateException, RestClientDefinitionException Based on the configured RestClientBuilder, creates a new instance of the given REST interface to invoke API calls against.
| |
| connectTimeout | back to summary |
|---|---|
| public RestClientBuilder connectTimeout(long timeout, TimeUnit unit) Set the connect timeout.
Like Jakarta RESTful Web Services's 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.
| |
| executorService | back to summary |
|---|---|
| public RestClientBuilder executorService(ExecutorService executor) Specifies the
| |
| followRedirects | back to summary |
|---|---|
| public RestClientBuilder followRedirects(boolean follow) Specifies whether client built by this builder should follow HTTP redirect responses (30x) or not.
| |
| header | back to summary |
|---|---|
| public RestClientBuilder header(String name, Object value) Add an arbitrary header.
| |
| hostnameVerifier | back to summary |
|---|---|
| public RestClientBuilder hostnameVerifier(HostnameVerifier hostnameVerifier) Set the hostname verifier to verify the endpoint's hostname
| |
| keyStore | back to summary |
|---|---|
| public RestClientBuilder keyStore(KeyStore keyStore, String keystorePassword) Set the client-side key store.
| |
| newBuilder | back to summary |
|---|---|
| public static RestClientBuilder newBuilder() | |
| proxyAddress | back to summary |
|---|---|
| public RestClientBuilder proxyAddress(String proxyHost, int proxyPort) Specifies the HTTP proxy hostname/IP address and port to use for requests from client instances.
| |
| queryParamStyle | back to summary |
|---|---|
| public RestClientBuilder queryParamStyle(QueryParamStyle style) Specifies the URI formatting style to use when multiple query parameter values are passed to the client.
| |
| readTimeout | back to summary |
|---|---|
| public RestClientBuilder readTimeout(long timeout, TimeUnit unit) Set the read timeout.
Like Jakarta RESTful Web Services's
Also like the Jakarta RESTful Web Services Client API, if the read timeout is reached, the client interface
method will throw a 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.
| |
| sslContext | back to summary |
|---|---|
| public RestClientBuilder 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.
| |
| trustStore | back to summary |
|---|---|
| public RestClientBuilder trustStore(KeyStore trustStore) Set the client-side trust store.
| |