org.glassfish.jersey.client
Class ClientProperties

java.lang.Object
  extended by org.glassfish.jersey.client.ClientProperties

public final class ClientProperties
extends Object

Jersey client implementation configuration properties.

Author:
Marek Potociar (marek.potociar at oracle.com), Libor Kramolis (libor.kramolis at oracle.com)

Field Summary
static String ASYNC_THREADPOOL_SIZE
          Asynchronous thread pool size.
static String CHUNKED_ENCODING_SIZE
          Chunked encoding size.
static String CONNECT_TIMEOUT
          Connect timeout interval, in milliseconds.
static String DIGESTAUTH_URI_CACHE_SIZELIMIT
          The property defines the size of digest cache in the HttpDigestAuthFilter.
static String FEATURE_AUTO_DISCOVERY_DISABLE
          If true then disable auto-discovery on the client.
static String FOLLOW_REDIRECTS
          Automatic redirection.
static String HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND
          A value of true declares that the client will try to set unsupported HTTP method to HttpURLConnection via reflection.
static String HTTP_URL_CONNECTOR_FIX_LENGTH_STREAMING
          If true, HttpUrlConnector (if used) will assume the content length from the value of "Content-Length" request header (if present).
static String JSON_PROCESSING_FEATURE_DISABLE
          If true then disable configuration of Json Processing (JSR-353) feature on client.
static String METAINF_SERVICES_LOOKUP_DISABLE
          If true then disable META-INF/services lookup on client.
static String MOXY_JSON_FEATURE_DISABLE
          If true then disable configuration of MOXy Json feature on client.
static String OUTBOUND_CONTENT_LENGTH_BUFFER
          An integer value that defines the buffer size used to buffer client-side request entity in order to determine its size and set the value of HTTP "Content-Length" header.
static String READ_TIMEOUT
          Read timeout interval, in milliseconds.
static String SUPPRESS_HTTP_COMPLIANCE_VALIDATION
          If true, the strict validation of HTTP specification compliance will be suppressed.
static String USE_ENCODING
          If EncodingFilter is registered, this property indicates the value of Content-Encoding property the filter should be adding.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOLLOW_REDIRECTS

public static final String FOLLOW_REDIRECTS
Automatic redirection. A value of true declares that the client will automatically redirect to the URI declared in 3xx responses. The value MUST be an instance convertible to Boolean.

The default value is true.

The name of the configuration property is "jersey.config.client.followRedirects".

See Also:
Constant Field Values

READ_TIMEOUT

public static final String READ_TIMEOUT
Read timeout interval, in milliseconds. The value MUST be an instance convertible to Integer. A value of zero (0) is equivalent to an interval of infinity.

The default value is infinity (0).

The name of the configuration property is "jersey.config.client.readTimeout".

See Also:
Constant Field Values

CONNECT_TIMEOUT

public static final String CONNECT_TIMEOUT
Connect timeout interval, in milliseconds. The value MUST be an instance convertible to Integer. A value of zero (0) is equivalent to an interval of infinity.

The default value is infinity (0).

The name of the configuration property is "jersey.config.client.connectTimeout".

See Also:
Constant Field Values

CHUNKED_ENCODING_SIZE

public static final String CHUNKED_ENCODING_SIZE
Chunked encoding size. The value MUST be an instance convertible to Integer.

If the property is absent then chunked encoding will not be used. A value <= 0 declares that chunked encoding will be used with the default chunk size. A value > 0 declares that chunked encoding will be used with the value as the declared chunk size.

Due to the bug in HttpURLConnection using chunk encoding with HttpUrlConnector might cause unpredictable problems.

A default value is not set.

The name of the configuration property is "jersey.config.client.chunkedEncodingSize".

See Also:
Constant Field Values

ASYNC_THREADPOOL_SIZE

public static final String ASYNC_THREADPOOL_SIZE
Asynchronous thread pool size. The value MUST be an instance of Integer.

If the property is absent then thread pool used for async requests will be initialized as default cached thread pool, which creates new thread for every new request, see Executors. When a value > 0 is provided, the created cached thread pool limited to that number of threads will be utilized.

A default value is not set.

The name of the configuration property is "jersey.config.client.async.threadPoolSize".

See Also:
Constant Field Values

USE_ENCODING

public static final String USE_ENCODING
If EncodingFilter is registered, this property indicates the value of Content-Encoding property the filter should be adding.

The value MUST be an instance of String.

The default value is null.

The name of the configuration property is "jersey.config.client.useEncoding".

See Also:
Constant Field Values

HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND

public static final String HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND
A value of true declares that the client will try to set unsupported HTTP method to HttpURLConnection via reflection.

NOTE: Enabling this feature might cause security related warnings/errors and it might break when other JDK implementation is used. Use only when you know what you are doing.

The value MUST be an instance of Boolean.

The default value is false.

The name of the configuration property is "jersey.config.client.httpUrlConnection.setMethodWorkaround".

See Also:
Constant Field Values

FEATURE_AUTO_DISCOVERY_DISABLE

public static final String FEATURE_AUTO_DISCOVERY_DISABLE
If true then disable auto-discovery on the client.

By default auto-discovery on client is automatically enabled if global property "jersey.config.disableAutoDiscovery" is not disabled. If set then the client property value overrides the global property value.

The default value is false.

The name of the configuration property is "jersey.config.disableAutoDiscovery.client".

See Also:
CommonProperties.FEATURE_AUTO_DISCOVERY_DISABLE, Constant Field Values

OUTBOUND_CONTENT_LENGTH_BUFFER

public static final String OUTBOUND_CONTENT_LENGTH_BUFFER
An integer value that defines the buffer size used to buffer client-side request entity in order to determine its size and set the value of HTTP "Content-Length" header.

If the entity size exceeds the configured buffer size, the buffering would be cancelled and the entity size would not be determined. Value less or equal to zero disable the buffering of the entity at all.

This property can be used on the client side to override the outbound message buffer size value - default or the global custom value set using the "jersey.config.contentLength.buffer" global property.

The default value is .

The name of the configuration property is "jersey.config.contentLength.buffer.client".

Since:
2.2
See Also:
Constant Field Values

JSON_PROCESSING_FEATURE_DISABLE

public static final String JSON_PROCESSING_FEATURE_DISABLE
If true then disable configuration of Json Processing (JSR-353) feature on client.

By default Json Processing on client is automatically enabled if global property "jersey.config.disableJsonProcessing" is not disabled. If set then the client property value overrides the global property value.

The default value is false.

The name of the configuration property is "jersey.config.disableJsonProcessing.client".

See Also:
CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, Constant Field Values

METAINF_SERVICES_LOOKUP_DISABLE

public static final String METAINF_SERVICES_LOOKUP_DISABLE
If true then disable META-INF/services lookup on client.

By default Jersey lookups SPI implementations described by META-INF/services/* files. Then you can register appropriate provider classes by Application.

The default value is false.

The name of the configuration property is "jersey.config.disableMetainfServicesLookup.client".

See Also:
CommonProperties.METAINF_SERVICES_LOOKUP_DISABLE, Constant Field Values

MOXY_JSON_FEATURE_DISABLE

public static final String MOXY_JSON_FEATURE_DISABLE
If true then disable configuration of MOXy Json feature on client.

By default MOXy Json on client is automatically enabled if global property "jersey.config.disableMoxyJson" is not disabled. If set then the client property value overrides the global property value.

The default value is false.

The name of the configuration property is "jersey.config.disableMoxyJson.client".

Since:
2.1
See Also:
CommonProperties.MOXY_JSON_FEATURE_DISABLE, Constant Field Values

SUPPRESS_HTTP_COMPLIANCE_VALIDATION

public static final String SUPPRESS_HTTP_COMPLIANCE_VALIDATION
If true, the strict validation of HTTP specification compliance will be suppressed.

By default, Jersey client runtime performs certain HTTP compliance checks (such as which HTTP methods can facilitate non-empty request entities etc.) in order to fail fast with an exception when user tries to establish a communication non-compliant with HTTP specification. Users who need to override these compliance checks and avoid the exceptions being thrown by Jersey client runtime for some reason, can set this property to true. As a result, the compliance issues will be merely reported in a log and no exceptions will be thrown.

Note that the property suppresses the Jersey layer exceptions. Chances are that the non-compliant behavior will cause different set of exceptions being raised in the underlying I/O connector layer.

This property can be configured in a client runtime configuration or directly on an individual request. In case of conflict, request-specific property value takes precedence over value configured in the runtime configuration.

The default value is false.

The name of the configuration property is "jersey.config.client.suppressHttpComplianceValidation".

Since:
2.2
See Also:
Constant Field Values

DIGESTAUTH_URI_CACHE_SIZELIMIT

public static final String DIGESTAUTH_URI_CACHE_SIZELIMIT
The property defines the size of digest cache in the HttpDigestAuthFilter. Cache contains authentication schemes for different request URIs. The value MUST be an instance of Integer and it must be higher or equal to 1.

The default value is 1000.

The name of the configuration property is "jersey.config.client.digestAuthUriCacheSizeLimit".

Since:
2.3
See Also:
Constant Field Values

HTTP_URL_CONNECTOR_FIX_LENGTH_STREAMING

public static final String HTTP_URL_CONNECTOR_FIX_LENGTH_STREAMING
If true, HttpUrlConnector (if used) will assume the content length from the value of "Content-Length" request header (if present).

When this property is enabled and the request has a valid non-zero content length value specified in its "Content-Length" request header, that this value will be used as an input to the HttpURLConnection.setFixedLengthStreamingMode(int)} method call invoked on the underlying connection. This will suppress the entity buffering in the @{code HttpURLConnection}, which is undesirable in certain scenarios, e.g. when streaming large entities.

Note that the content length value defined in the request header must exactly match the real size of the entity. If the HttpHeaders.CONTENT_LENGTH header is explicitly specified in a request, this property will be ignored and the request entity will be still buffered by the underlying @{code HttpURLConnection} infrastructure.

This property also overrides the behaviour enabled by the CHUNKED_ENCODING_SIZE property. Chunked encoding will only be used, if the size is not specified in the header of the request.

Note that this property only applies to client run-times that are configured to use the default HttpUrlConnector as the client connector. The property is ignored by other connectors.

The default value is false.

The name of the configuration property is "jersey.config.client.httpUrlConnector.fixLength.streaming".

Since:
2.4
See Also:
Constant Field Values


Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.