Class ApacheClientProperties
- java.lang.Object
-
- org.glassfish.jersey.apache.connector.ApacheClientProperties
-
public final class ApacheClientProperties extends java.lang.ObjectConfiguration options specific to the Client API that utilizesApacheConnectorProvider.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONNECTION_MANAGERConnection Manager which will be used to createHttpClient.static java.lang.StringCONNECTION_MANAGER_SHAREDA value oftrueindicates that configured connection manager should be shared among multiple JerseyClientRuntimeinstances.static java.lang.StringCREDENTIALS_PROVIDERThe credential provider that should be used to retrieve credentials from a user.static java.lang.StringDISABLE_COOKIESA value offalseindicates the client should handle cookies automatically using HttpClient's default cookie policy.static java.lang.StringPREEMPTIVE_BASIC_AUTHENTICATIONA value oftrueindicates that a client should send an authentication request even before the server gives a 401 response.static java.lang.StringREQUEST_CONFIGRequest configuration for theHttpClient.static java.lang.StringRETRY_HANDLERHttpRequestRetryHandler which will be used to createHttpClient.
-
Constructor Summary
Constructors Modifier Constructor Description privateApacheClientProperties()Prevents instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetValue(java.util.Map<java.lang.String,?> properties, java.lang.String key, java.lang.Class<T> type)Get the value of the specified property.
-
-
-
Field Detail
-
CREDENTIALS_PROVIDER
public static final java.lang.String CREDENTIALS_PROVIDER
The credential provider that should be used to retrieve credentials from a user. Credentials needed for proxy authentication are stored here as well. The value MUST be an instance ofCredentialsProvider. If the property is absent a default provider will be used. The name of the configuration property is "jersey.config.apache.client.credentialsProvider".- See Also:
- Constant Field Values
-
DISABLE_COOKIES
public static final java.lang.String DISABLE_COOKIES
A value offalseindicates the client should handle cookies automatically using HttpClient's default cookie policy. A value oftruewill cause the client to ignore all cookies. The value MUST be an instance ofBoolean. The default value isfalse. The name of the configuration property is "jersey.config.apache.client.handleCookies".- See Also:
- Constant Field Values
-
PREEMPTIVE_BASIC_AUTHENTICATION
public static final java.lang.String PREEMPTIVE_BASIC_AUTHENTICATION
A value oftrueindicates 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
The value MUST be an instance ofApacheConnectorProvider.Boolean. The default value isfalse. The name of the configuration property is "jersey.config.apache.client.preemptiveBasicAuthentication".- See Also:
- Constant Field Values
-
CONNECTION_MANAGER
public static final java.lang.String CONNECTION_MANAGER
Connection Manager which will be used to createHttpClient. The value MUST be an instance ofHttpClientConnectionManager. 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 withPoolingHttpClientConnectionManagerinstance. The name of the configuration property is "jersey.config.apache.client.connectionManager".- See Also:
- Constant Field Values
-
CONNECTION_MANAGER_SHARED
public static final java.lang.String CONNECTION_MANAGER_SHARED
A value oftrueindicates that configured connection manager should be shared among multiple JerseyClientRuntimeinstances. It means that closing a particularClientRuntimeinstance 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 ensureHttpClientConnectionManager.shutdown()gets invoked eventually.This property may only be set prior to constructing Apache connector using
The value MUST be an instance ofApacheConnectorProvider.Boolean. The default value isfalse. The name of the configuration property is "jersey.config.apache.client.connectionManagerShared".- Since:
- 2.18
- See Also:
- Constant Field Values
-
REQUEST_CONFIG
public static final java.lang.String REQUEST_CONFIG
Request configuration for theHttpClient. Http parameters which will be used to createHttpClient. The value MUST be an instance ofRequestConfig. If the property is absent default request configuration will be used. The name of the configuration property is "jersey.config.apache.client.requestConfig".- Since:
- 2.5
- See Also:
- Constant Field Values
-
RETRY_HANDLER
public static final java.lang.String RETRY_HANDLER
HttpRequestRetryHandler which will be used to createHttpClient. The value MUST be an instance ofHttpRequestRetryHandler. 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".- See Also:
- Constant Field Values
-
-
Method Detail
-
getValue
public static <T> T getValue(java.util.Map<java.lang.String,?> properties, java.lang.String key, java.lang.Class<T> type)Get the value of the specified property. If the property is not set or the actual property value type is not compatible with the specified type, the method will returnnull.- Type Parameters:
T- Type of the property value.- Parameters:
properties- Map of properties to get the property value from.key- Name of the property.type- Type to retrieve the value as.- Returns:
- Value of the property or
null. - Since:
- 2.8
-
-