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>
public final class ArmeriaResteasyClientBuilder
extends org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
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
org.jboss.resteasy.client.jaxrs.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
Methods inherited from class javax.ws.rs.client.ClientBuilder
newBuilder
-
Method Details
-
newBuilder
public static org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder newBuilder(WebClientBuilder webClientBuilder, ClientFactoryBuilder clientFactoryBuilder) -
newBuilder
public static org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder newBuilder(WebClientBuilder webClientBuilder)Creates newResteasyClientBuilder
based onWebClientBuilder
. -
newClient
Creates newResteasyClient
based onWebClient
. -
newClient
public static org.jboss.resteasy.client.jaxrs.ResteasyClient newClient(javax.ws.rs.core.Configuration configuration)Creates newResteasyClient
based onConfiguration
. -
newClient
public static org.jboss.resteasy.client.jaxrs.ResteasyClient newClient()Creates newResteasyClient
using default settings. -
build
public org.jboss.resteasy.client.jaxrs.ResteasyClient build()- Specified by:
build
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
httpEngine
public ArmeriaResteasyClientBuilder httpEngine(org.jboss.resteasy.client.jaxrs.ClientHttpEngine httpEngine)ArmeriaJaxrsClientEngine
will always be set as anClientHttpEngine
.- Specified by:
httpEngine
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
- Throws:
UnsupportedOperationException
- always
-
getHttpEngine
public org.jboss.resteasy.client.jaxrs.ClientHttpEngine getHttpEngine()- Specified by:
getHttpEngine
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
useAsyncHttpEngine
- Specified by:
useAsyncHttpEngine
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
isUseAsyncHttpEngine
public boolean isUseAsyncHttpEngine()- Specified by:
isUseAsyncHttpEngine
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
providerFactory
public ArmeriaResteasyClientBuilder providerFactory(org.jboss.resteasy.spi.ResteasyProviderFactory providerFactory)- Specified by:
providerFactory
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getProviderFactory
public org.jboss.resteasy.spi.ResteasyProviderFactory getProviderFactory()- Specified by:
getProviderFactory
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
connectionTTL
- Specified by:
connectionTTL
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getConnectionTTL
- Specified by:
getConnectionTTL
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
maxPooledPerRoute
- Specified by:
maxPooledPerRoute
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getMaxPooledPerRoute
public int getMaxPooledPerRoute()- Specified by:
getMaxPooledPerRoute
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
connectionCheckoutTimeout
- Specified by:
connectionCheckoutTimeout
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getConnectionCheckoutTimeout
- Specified by:
getConnectionCheckoutTimeout
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
connectionPoolSize
- Specified by:
connectionPoolSize
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getConnectionPoolSize
public int getConnectionPoolSize()- Specified by:
getConnectionPoolSize
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
responseBufferSize
- Specified by:
responseBufferSize
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getResponseBufferSize
public int getResponseBufferSize()- Specified by:
getResponseBufferSize
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
disableTrustManager
- Specified by:
disableTrustManager
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
isTrustManagerDisabled
public boolean isTrustManagerDisabled()- Specified by:
isTrustManagerDisabled
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
setIsTrustSelfSignedCertificates
public void setIsTrustSelfSignedCertificates(boolean b)- Specified by:
setIsTrustSelfSignedCertificates
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
isTrustSelfSignedCertificates
public boolean isTrustSelfSignedCertificates()- Specified by:
isTrustSelfSignedCertificates
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
hostnameVerification
public ArmeriaResteasyClientBuilder hostnameVerification(org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.HostnameVerificationPolicy policy)- Specified by:
hostnameVerification
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getHostnameVerification
public org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder.HostnameVerificationPolicy getHostnameVerification()- Specified by:
getHostnameVerification
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
sniHostNames
- Specified by:
sniHostNames
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getSniHostNames
- Specified by:
getSniHostNames
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getDefaultProxyHostname
- Specified by:
getDefaultProxyHostname
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getDefaultProxyPort
public int getDefaultProxyPort()- Specified by:
getDefaultProxyPort
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getDefaultProxyScheme
- Specified by:
getDefaultProxyScheme
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
defaultProxy
- Specified by:
defaultProxy
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
defaultProxy
- Specified by:
defaultProxy
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
defaultProxy
- Specified by:
defaultProxy
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
enableCookieManagement
- Specified by:
enableCookieManagement
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
isCookieManagementEnabled
public boolean isCookieManagementEnabled()- Specified by:
isCookieManagementEnabled
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getSSLContext
- Specified by:
getSSLContext
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getKeyStore
- Specified by:
getKeyStore
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getKeyStorePassword
- Specified by:
getKeyStorePassword
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getTrustStore
- Specified by:
getTrustStore
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getHostnameVerifier
- Specified by:
getHostnameVerifier
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getReadTimeout
- Specified by:
getReadTimeout
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
getConnectionTimeout
- Specified by:
getConnectionTimeout
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
disableAutomaticRetries
- Specified by:
disableAutomaticRetries
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
isDisableAutomaticRetries
public boolean isDisableAutomaticRetries()- Specified by:
isDisableAutomaticRetries
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
withConfig
- Specified by:
withConfig
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
sslContext
Armeria does not allow to access the ssl-context from WebClient API. This functionality must be achieved by configuringWebClientBuilder
.- Specified by:
sslContext
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
- Throws:
UnsupportedOperationException
- always
-
keyStore
- Specified by:
keyStore
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
keyStore
- Specified by:
keyStore
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
trustStore
- Specified by:
trustStore
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
hostnameVerifier
Armeria does not allow to access the HostnameVerifier from WebClient API. This functionality must be achieved by configuringWebClientBuilder
.- Specified by:
hostnameVerifier
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
- Throws:
UnsupportedOperationException
- always
-
executorService
- Specified by:
executorService
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
executorService
public ArmeriaResteasyClientBuilder executorService(ExecutorService executorService, boolean cleanupExecutor)- Specified by:
executorService
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
scheduledExecutorService
public ArmeriaResteasyClientBuilder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)- Specified by:
scheduledExecutorService
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
connectTimeout
- Specified by:
connectTimeout
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
readTimeout
- Specified by:
readTimeout
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
setFollowRedirects
- Specified by:
setFollowRedirects
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
isFollowRedirects
public boolean isFollowRedirects()- Specified by:
isFollowRedirects
in classorg.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
-
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
-