Package org.jboss.resteasy.client.jaxrs
Class ResteasyClientBuilder
java.lang.Object
javax.ws.rs.client.ClientBuilder
org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder
- All Implemented Interfaces:
javax.ws.rs.core.Configurable<javax.ws.rs.client.ClientBuilder>
public class ResteasyClientBuilder
extends javax.ws.rs.client.ClientBuilder
Abstraction for creating Clients. Allows SSL configuration. Uses Apache Http Client under
the covers. If used with other ClientHttpEngines though, all configuration options are ignored.
- Version:
- $Revision: 1 $
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ExecutorService
protected boolean
protected KeyStore
protected String
protected int
protected int
protected long
protected TimeUnit
protected org.apache.http.HttpHost
protected boolean
protected long
protected TimeUnit
protected ClientHttpEngine
protected int
protected ResteasyProviderFactory
protected int
protected long
protected TimeUnit
protected SSLContext
protected KeyStore
protected HostnameVerifier
Fields inherited from class javax.ws.rs.client.ClientBuilder
JAXRS_DEFAULT_CLIENT_BUILDER_PROPERTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasyncExecutor
(ExecutorService asyncExecutor) Executor to use to run AsyncInvoker invocationsasyncExecutor
(ExecutorService asyncExecutor, boolean cleanupExecutor) Executor to use to run AsyncInvoker invocationsbuild()
buildOld()
Deprecated.connectionCheckoutTimeout
(long timeout, TimeUnit unit) If connection pooling is enabled, how long will we wait to get a connection?connectionPoolSize
(int connectionPoolSize) Number of connections allowed to poolconnectionTTL
(long ttl, TimeUnit unit) If there is a connection pool, set the time to live in the pool.defaultProxy
(String hostname) Specify a default proxy.defaultProxy
(String hostname, int port) Specify a default proxy host and port.defaultProxy
(String hostname, int port, String scheme) Specify default proxy.Disable trust management and hostname verification.establishConnectionTimeout
(long timeout, TimeUnit unit) When trying to make an initial socket connection, what is the timeout?javax.ws.rs.core.Configuration
protected ResteasyProviderFactory
SSL policy used to verify hostnameshostnameVerifier
(HostnameVerifier verifier) httpEngine
(ClientHttpEngine httpEngine) Negates all ssl and connection specific configurationmaxPooledPerRoute
(int maxPooledPerRoute) If connection pooling enabled, how many connections to pool per url?protected void
prepareSocketForSni
(SSLSocket socket) providerFactory
(ResteasyProviderFactory providerFactory) Changing the providerFactory will wipe clean any registered components or properties.responseBufferSize
(int size) Response stream is wrapped in a BufferedInputStream.sniHostNames
(String... sniHostNames) Adds a TLS/SSL SNI Host Name for authentication.socketTimeout
(long timeout, TimeUnit unit) The timeout for waiting for data.sslContext
(SSLContext sslContext) trustStore
(KeyStore truststore) withConfig
(javax.ws.rs.core.Configuration config) Methods inherited from class javax.ws.rs.client.ClientBuilder
newBuilder, newClient, newClient
-
Field Details
-
truststore
-
clientKeyStore
-
clientPrivateKeyPassword
-
disableTrustManager
protected boolean disableTrustManager -
policy
-
providerFactory
-
asyncExecutor
-
cleanupExecutor
protected boolean cleanupExecutor -
sslContext
-
properties
-
httpEngine
-
connectionPoolSize
protected int connectionPoolSize -
maxPooledPerRoute
protected int maxPooledPerRoute -
connectionTTL
protected long connectionTTL -
connectionTTLUnit
-
socketTimeout
protected long socketTimeout -
socketTimeoutUnits
-
establishConnectionTimeout
protected long establishConnectionTimeout -
establishConnectionTimeoutUnits
-
connectionCheckoutTimeoutMs
protected int connectionCheckoutTimeoutMs -
verifier
-
defaultProxy
protected org.apache.http.HttpHost defaultProxy -
responseBufferSize
protected int responseBufferSize -
sniHostNames
-
-
Constructor Details
-
ResteasyClientBuilder
public ResteasyClientBuilder()
-
-
Method Details
-
providerFactory
Changing the providerFactory will wipe clean any registered components or properties.- Parameters:
providerFactory
-- Returns:
-
asyncExecutor
Executor to use to run AsyncInvoker invocations- Parameters:
asyncExecutor
-- Returns:
-
asyncExecutor
Executor to use to run AsyncInvoker invocations- Parameters:
asyncExecutor
-cleanupExecutor
- true if the Client should close the executor when it is closed- Returns:
-
connectionTTL
If there is a connection pool, set the time to live in the pool.- Parameters:
ttl
-unit
-- Returns:
-
socketTimeout
The timeout for waiting for data. A timeout value of zero is interpreted as an infinite timeout- Parameters:
timeout
-unit
-- Returns:
-
establishConnectionTimeout
When trying to make an initial socket connection, what is the timeout?- Parameters:
timeout
-unit
-- Returns:
-
maxPooledPerRoute
If connection pooling enabled, how many connections to pool per url?- Parameters:
maxPooledPerRoute
-- Returns:
-
connectionCheckoutTimeout
If connection pooling is enabled, how long will we wait to get a connection?- Parameters:
timeout
- the timeoutunit
- the units the timeout is in- Returns:
- this builder
-
connectionPoolSize
Number of connections allowed to pool- Parameters:
connectionPoolSize
-- Returns:
-
responseBufferSize
Response stream is wrapped in a BufferedInputStream. Default is 8192. Value of 0 will not wrap it. Value of -1 will use a SelfExpandingBufferedInputStream- Parameters:
size
-- Returns:
-
disableTrustManager
Disable trust management and hostname verification. NOTE this is a security hole, so only set this option if you cannot or do not want to verify the identity of the host you are communicating with. -
hostnameVerification
public ResteasyClientBuilder hostnameVerification(ResteasyClientBuilder.HostnameVerificationPolicy policy) SSL policy used to verify hostnames- Parameters:
policy
-- Returns:
-
httpEngine
Negates all ssl and connection specific configuration- Parameters:
httpEngine
-- Returns:
-
sslContext
- Specified by:
sslContext
in classjavax.ws.rs.client.ClientBuilder
-
trustStore
- Specified by:
trustStore
in classjavax.ws.rs.client.ClientBuilder
-
keyStore
- Overrides:
keyStore
in classjavax.ws.rs.client.ClientBuilder
-
keyStore
- Specified by:
keyStore
in classjavax.ws.rs.client.ClientBuilder
-
property
-
sniHostNames
Adds a TLS/SSL SNI Host Name for authentication.- Parameters:
sniHostNames
-- Returns:
-
defaultProxy
Specify a default proxy. Default port and schema will be used- Parameters:
hostname
-- Returns:
-
defaultProxy
Specify a default proxy host and port. Default schema will be used- Parameters:
hostname
-port
-- Returns:
-
defaultProxy
Specify default proxy.- Parameters:
hostname
-port
-scheme
-- Returns:
-
getProviderFactory
-
buildOld
Deprecated. -
build
- Specified by:
build
in classjavax.ws.rs.client.ClientBuilder
-
prepareSocketForSni
-
hostnameVerifier
- Specified by:
hostnameVerifier
in classjavax.ws.rs.client.ClientBuilder
-
getConfiguration
public javax.ws.rs.core.Configuration getConfiguration() -
register
-
register
-
register
-
register
-
register
-
register
-
register
-
register
-
withConfig
- Specified by:
withConfig
in classjavax.ws.rs.client.ClientBuilder
-