Class ArmeriaResteasyClientBuilder
java.lang.Object
javax.ws.rs.client.ClientBuilder
org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
com.linecorp.armeria.client.resteasy.ArmeriaResteasyClientBuilder
- All Implemented Interfaces:
javax.ws.rs.core.Configurable<javax.ws.rs.client.ClientBuilder>
An optional helper class to build
ResteasyClient
using ResteasyClientBuilder
interface
as below.
final WebClientBuilder webClientBuilder = WebClient.builder(); // supply no server URI to the builder
// ... configure webClientBuilder ...
final ResteasyClientBuilder reasteasyClientBuilder =
ArmeriaResteasyClientBuilder.newBuilder(webClientBuilder);
// ... configure restClientBuilder ...
// construct JAX-RS client
final Client jaxrsClient = reasteasyClientBuilder.build();
// construct JAX-RS web target
final WebTarget webTarget = jaxrsClient.target(restServerUri); // supply server URI here
// make JAX-RS request
final Response restResponse = webTarget.path(servicePath).request().get();
ResteasyClient
could still be constructed using ArmeriaJaxrsClientEngine directly by setting it
to ResteasyClientBuilder
via ResteasyClientBuilder.httpEngine(ClientHttpEngine)
method
as below.
final Client jaxrsClient = ((ResteasyClientBuilder) ClientBuilder.newBuilder())
.httpEngine(new ArmeriaJaxrsClientEngine(armeriaWebClient))
.build();
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
ResteasyClientBuilder.HostnameVerificationPolicy
-
Field Summary
Fields inherited from class org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
PROPERTY_PROXY_HOST, PROPERTY_PROXY_PORT, PROPERTY_PROXY_SCHEME
Fields inherited from class javax.ws.rs.client.ClientBuilder
JAXRS_DEFAULT_CLIENT_BUILDER_PROPERTY
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
connectionCheckoutTimeout
(long timeout, TimeUnit unit) connectionPoolSize
(int connectionPoolSize) connectionTTL
(long ttl, TimeUnit unit) connectTimeout
(long timeout, TimeUnit unit) defaultProxy
(String hostname) defaultProxy
(String hostname, int port) defaultProxy
(String hostname, int port, String scheme) executorService
(ExecutorService executorService) executorService
(ExecutorService executorService, boolean cleanupExecutor) javax.ws.rs.core.Configuration
long
int
long
getConnectionTimeout
(TimeUnit unit) long
getConnectionTTL
(TimeUnit unit) int
int
long
getReadTimeout
(TimeUnit unit) int
hostnameVerifier
(HostnameVerifier verifier) Armeria does not allow to access the HostnameVerifier from WebClient API.httpEngine
(ClientHttpEngine httpEngine) ArmeriaJaxrsClientEngine
will always be set as anClientHttpEngine
.boolean
boolean
boolean
boolean
boolean
boolean
maxPooledPerRoute
(int maxPooledPerRoute) static ResteasyClientBuilder
newBuilder
(WebClientBuilder webClientBuilder) Creates newResteasyClientBuilder
based onWebClientBuilder
.static ResteasyClientBuilder
newBuilder
(WebClientBuilder webClientBuilder, ClientFactoryBuilder clientFactoryBuilder) static ResteasyClient
Creates newResteasyClient
using default settings.static ResteasyClient
Creates newResteasyClient
based onWebClient
.static ResteasyClient
newClient
(javax.ws.rs.core.Configuration configuration) Creates newResteasyClient
based onConfiguration
.providerFactory
(ResteasyProviderFactory providerFactory) readTimeout
(long timeout, TimeUnit unit) responseBufferSize
(int size) scheduledExecutorService
(ScheduledExecutorService scheduledExecutorService) setFollowRedirects
(boolean followRedirects) void
setIsTrustSelfSignedCertificates
(boolean b) sniHostNames
(String... sniHostNames) sslContext
(SSLContext sslContext) Armeria does not allow to access the ssl-context from WebClient API.trustStore
(KeyStore trustStore) withConfig
(javax.ws.rs.core.Configuration config) Methods inherited from class javax.ws.rs.client.ClientBuilder
newBuilder
-
Method Details
-
newBuilder
public static ResteasyClientBuilder newBuilder(WebClientBuilder webClientBuilder, ClientFactoryBuilder clientFactoryBuilder) -
newBuilder
Creates newResteasyClientBuilder
based onWebClientBuilder
. -
newClient
Creates newResteasyClient
based onWebClient
. -
newClient
Creates newResteasyClient
based onConfiguration
. -
newClient
Creates newResteasyClient
using default settings. -
build
- Specified by:
build
in classResteasyClientBuilder
-
httpEngine
ArmeriaJaxrsClientEngine
will always be set as anClientHttpEngine
.- Specified by:
httpEngine
in classResteasyClientBuilder
- Throws:
UnsupportedOperationException
- always
-
getHttpEngine
- Specified by:
getHttpEngine
in classResteasyClientBuilder
-
useAsyncHttpEngine
- Specified by:
useAsyncHttpEngine
in classResteasyClientBuilder
-
isUseAsyncHttpEngine
public boolean isUseAsyncHttpEngine()- Specified by:
isUseAsyncHttpEngine
in classResteasyClientBuilder
-
providerFactory
- Specified by:
providerFactory
in classResteasyClientBuilder
-
getProviderFactory
- Specified by:
getProviderFactory
in classResteasyClientBuilder
-
connectionTTL
- Specified by:
connectionTTL
in classResteasyClientBuilder
-
getConnectionTTL
- Specified by:
getConnectionTTL
in classResteasyClientBuilder
-
maxPooledPerRoute
- Specified by:
maxPooledPerRoute
in classResteasyClientBuilder
-
getMaxPooledPerRoute
public int getMaxPooledPerRoute()- Specified by:
getMaxPooledPerRoute
in classResteasyClientBuilder
-
connectionCheckoutTimeout
- Specified by:
connectionCheckoutTimeout
in classResteasyClientBuilder
-
getConnectionCheckoutTimeout
- Specified by:
getConnectionCheckoutTimeout
in classResteasyClientBuilder
-
connectionPoolSize
- Specified by:
connectionPoolSize
in classResteasyClientBuilder
-
getConnectionPoolSize
public int getConnectionPoolSize()- Specified by:
getConnectionPoolSize
in classResteasyClientBuilder
-
responseBufferSize
- Specified by:
responseBufferSize
in classResteasyClientBuilder
-
getResponseBufferSize
public int getResponseBufferSize()- Specified by:
getResponseBufferSize
in classResteasyClientBuilder
-
disableTrustManager
- Specified by:
disableTrustManager
in classResteasyClientBuilder
-
isTrustManagerDisabled
public boolean isTrustManagerDisabled()- Specified by:
isTrustManagerDisabled
in classResteasyClientBuilder
-
setIsTrustSelfSignedCertificates
public void setIsTrustSelfSignedCertificates(boolean b) - Specified by:
setIsTrustSelfSignedCertificates
in classResteasyClientBuilder
-
isTrustSelfSignedCertificates
public boolean isTrustSelfSignedCertificates()- Specified by:
isTrustSelfSignedCertificates
in classResteasyClientBuilder
-
hostnameVerification
public ArmeriaResteasyClientBuilder hostnameVerification(ResteasyClientBuilder.HostnameVerificationPolicy policy) - Specified by:
hostnameVerification
in classResteasyClientBuilder
-
getHostnameVerification
- Specified by:
getHostnameVerification
in classResteasyClientBuilder
-
sniHostNames
- Specified by:
sniHostNames
in classResteasyClientBuilder
-
getSniHostNames
- Specified by:
getSniHostNames
in classResteasyClientBuilder
-
getDefaultProxyHostname
- Specified by:
getDefaultProxyHostname
in classResteasyClientBuilder
-
getDefaultProxyPort
public int getDefaultProxyPort()- Specified by:
getDefaultProxyPort
in classResteasyClientBuilder
-
getDefaultProxyScheme
- Specified by:
getDefaultProxyScheme
in classResteasyClientBuilder
-
defaultProxy
- Specified by:
defaultProxy
in classResteasyClientBuilder
-
defaultProxy
- Specified by:
defaultProxy
in classResteasyClientBuilder
-
defaultProxy
- Specified by:
defaultProxy
in classResteasyClientBuilder
-
enableCookieManagement
- Specified by:
enableCookieManagement
in classResteasyClientBuilder
-
isCookieManagementEnabled
public boolean isCookieManagementEnabled()- Specified by:
isCookieManagementEnabled
in classResteasyClientBuilder
-
getSSLContext
- Specified by:
getSSLContext
in classResteasyClientBuilder
-
getKeyStore
- Specified by:
getKeyStore
in classResteasyClientBuilder
-
getKeyStorePassword
- Specified by:
getKeyStorePassword
in classResteasyClientBuilder
-
getTrustStore
- Specified by:
getTrustStore
in classResteasyClientBuilder
-
getHostnameVerifier
- Specified by:
getHostnameVerifier
in classResteasyClientBuilder
-
getReadTimeout
- Specified by:
getReadTimeout
in classResteasyClientBuilder
-
getConnectionTimeout
- Specified by:
getConnectionTimeout
in classResteasyClientBuilder
-
disableAutomaticRetries
- Specified by:
disableAutomaticRetries
in classResteasyClientBuilder
-
isDisableAutomaticRetries
public boolean isDisableAutomaticRetries()- Specified by:
isDisableAutomaticRetries
in classResteasyClientBuilder
-
withConfig
- Specified by:
withConfig
in classResteasyClientBuilder
-
sslContext
Armeria does not allow to access the ssl-context from WebClient API. This functionality must be achieved by configuringWebClientBuilder
.- Specified by:
sslContext
in classResteasyClientBuilder
- Throws:
UnsupportedOperationException
- always
-
keyStore
- Specified by:
keyStore
in classResteasyClientBuilder
-
keyStore
- Specified by:
keyStore
in classResteasyClientBuilder
-
trustStore
- Specified by:
trustStore
in classResteasyClientBuilder
-
hostnameVerifier
Armeria does not allow to access the HostnameVerifier from WebClient API. This functionality must be achieved by configuringWebClientBuilder
.- Specified by:
hostnameVerifier
in classResteasyClientBuilder
- Throws:
UnsupportedOperationException
- always
-
executorService
- Specified by:
executorService
in classResteasyClientBuilder
-
executorService
public ArmeriaResteasyClientBuilder executorService(ExecutorService executorService, boolean cleanupExecutor) - Specified by:
executorService
in classResteasyClientBuilder
-
scheduledExecutorService
public ArmeriaResteasyClientBuilder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService) - Specified by:
scheduledExecutorService
in classResteasyClientBuilder
-
connectTimeout
- Specified by:
connectTimeout
in classResteasyClientBuilder
-
readTimeout
- Specified by:
readTimeout
in classResteasyClientBuilder
-
setFollowRedirects
- Specified by:
setFollowRedirects
in classResteasyClientBuilder
-
isFollowRedirects
public boolean isFollowRedirects()- Specified by:
isFollowRedirects
in classResteasyClientBuilder
-
getConfiguration
public javax.ws.rs.core.Configuration getConfiguration() -
property
-
register
-
register
-
register
-
register
public ArmeriaResteasyClientBuilder register(Class<?> componentClass, Map<Class<?>, Integer> contracts) -
register
-
register
-
register
-
register
-