public final class ApacheClientProperties extends Object
ApacheConnectorProvider
.Modifier and Type | Field and Description |
---|---|
static String |
CONNECTION_CLOSING_STRATEGY
Strategy that closes the Apache Connection.
|
static String |
CONNECTION_MANAGER
Connection Manager which will be used to create
HttpClient . |
static String |
CONNECTION_MANAGER_SHARED
A value of
true indicates that configured connection manager should be shared
among multiple Jersey ClientRuntime instances. |
static String |
CREDENTIALS_PROVIDER
The credential provider that should be used to retrieve
credentials from a user.
|
static String |
DISABLE_COOKIES
A value of
false indicates the client should handle cookies
automatically using HttpClient's default cookie policy. |
static String |
KEEPALIVE_STRATEGY
ConnectionKeepAliveStrategy for the
HttpClient . |
static String |
PREEMPTIVE_BASIC_AUTHENTICATION
A value of
true indicates that a client should send an
authentication request even before the server gives a 401
response. |
static String |
REQUEST_CONFIG
Request configuration for the
HttpClient . |
static String |
RETRY_HANDLER
HttpRequestRetryHandler which will be used to create
HttpClient . |
static String |
REUSE_STRATEGY
ConnectionReuseStrategy for the
HttpClient . |
static String |
USE_SYSTEM_PROPERTIES
A value of
false indicates the client will use default ApacheConnector params. |
Modifier and Type | Method and Description |
---|---|
static <T> T |
getValue(Map<String,?> properties,
String key,
Class<T> type)
Get the value of the specified property.
|
public static final String CREDENTIALS_PROVIDER
CredentialsProvider
.
If the property is absent a default provider will be used.
The name of the configuration property is "jersey.config.apache.client.credentialsProvider".public static final String DISABLE_COOKIES
false
indicates the client should handle cookies
automatically using HttpClient's default cookie policy. A value
of true
will cause the client to ignore all cookies.
The value MUST be an instance of Boolean
.
The default value is false
.
The name of the configuration property is "jersey.config.apache.client.handleCookies".public static final String PREEMPTIVE_BASIC_AUTHENTICATION
true
indicates that a client should send an
authentication request even before the server gives a 401
response.
This property may only be set prior to constructing Apache connector using ApacheConnectorProvider
.
Boolean
.
The default value is false
.
The name of the configuration property is "jersey.config.apache.client.preemptiveBasicAuthentication".public static final String CONNECTION_MANAGER
HttpClient
.
The value MUST be an instance of HttpClientConnectionManager
.
If the property is absent a default Connection Manager will be used
(BasicHttpClientConnectionManager
).
If you want to use this client in multi-threaded environment, be sure you override default value with
PoolingHttpClientConnectionManager
instance.
The name of the configuration property is "jersey.config.apache.client.connectionManager".public static final String CONNECTION_MANAGER_SHARED
true
indicates that configured connection manager should be shared
among multiple Jersey ClientRuntime
instances. It means that closing
a particular ClientRuntime
instance does not shut down the underlying
connection manager automatically. In such case, the connection manager life-cycle
should be fully managed by the application code. To release all allocated resources,
caller code should especially ensure HttpClientConnectionManager.shutdown()
gets
invoked eventually.
This property may only be set prior to constructing Apache connector using ApacheConnectorProvider
.
Boolean
.
The default value is false
.
The name of the configuration property is "jersey.config.apache.client.connectionManagerShared".public static final String REQUEST_CONFIG
HttpClient
.
Http parameters which will be used to create HttpClient
.
The value MUST be an instance of RequestConfig
.
If the property is absent the default request configuration will be used.
The name of the configuration property is "jersey.config.apache.client.requestConfig".public static final String RETRY_HANDLER
HttpClient
.
The value MUST be an instance of HttpRequestRetryHandler
.
If the property is absent a default retry handler will be used
(DefaultHttpRequestRetryHandler
).
The name of the configuration property is "jersey.config.apache.client.retryHandler".public static final String REUSE_STRATEGY
HttpClient
.
The value MUST be an instance of ConnectionReuseStrategy
.
If the property is absent the default reuse strategy of the Apache HTTP library will be used.
The name of the configuration property is "jersey.config.apache.client.reuseStrategy".public static final String KEEPALIVE_STRATEGY
HttpClient
.
The value MUST be an instance of ConnectionKeepAliveStrategy
.
If the property is absent the default keepalive strategy of the Apache HTTP library will be used
The name of the configuration property is "jersey.config.apache.client.keepAliveStrategy".public static final String CONNECTION_CLOSING_STRATEGY
Strategy that closes the Apache Connection. Accepts an instance of ApacheConnectionClosingStrategy
.
ApacheConnectionClosingStrategy
,
Constant Field Valuespublic static final String USE_SYSTEM_PROPERTIES
false
indicates the client will use default ApacheConnector params. A value
of true
will cause the client to take into account the system properties
https.protocols
, https.cipherSuites
, http.keepAlive
,
http.maxConnections
.
The value MUST be an instance of Boolean
.
The default value is false
.
The name of the configuration property is "jersey.config.apache.client.useSystemProperties".public static <T> T getValue(Map<String,?> properties, String key, Class<T> type)
null
.T
- Type of the property value.properties
- Map of properties to get the property value from.key
- Name of the property.type
- Type to retrieve the value as.null
.Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.