Connector provider for Jersey {@link Connector connectors} that utilizeApache HTTP Client to send and receive HTTP request and responses.
The following connector configuration properties are supported:
- {@link ApacheClientProperties#CONNECTION_MANAGER}
- {@link ApacheClientProperties#REQUEST_CONFIG}
- {@link ApacheClientProperties#CREDENTIALS_PROVIDER}
- {@link ApacheClientProperties#DISABLE_COOKIES}
- {@link org.glassfish.jersey.client.ClientProperties#PROXY_URI}
- {@link org.glassfish.jersey.client.ClientProperties#PROXY_USERNAME}
- {@link org.glassfish.jersey.client.ClientProperties#PROXY_PASSWORD}
- {@link org.glassfish.jersey.client.ClientProperties#REQUEST_ENTITY_PROCESSING}- default value is {@link org.glassfish.jersey.client.RequestEntityProcessing#CHUNKED}
- {@link ApacheClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}
- {@link ApacheClientProperties#SSL_CONFIG}
Connector instances created via this connector provider use {@link org.glassfish.jersey.client.RequestEntityProcessing#CHUNKED chunked encoding} as a default setting.This can be overridden by the {@link org.glassfish.jersey.client.ClientProperties#REQUEST_ENTITY_PROCESSING}. By default the {@link org.glassfish.jersey.client.ClientProperties#CHUNKED_ENCODING_SIZE} property is only supportedwhen using the default {@code org.apache.http.conn.HttpClientConnectionManager} instance. If customconnection manager is used, then chunked encoding size can be set by providing a custom {@code org.apache.http.HttpClientConnection} (via custom {@code org.apache.http.impl.conn.ManagedHttpClientConnectionFactory}) and overriding it's {@code createOutputStream} method.
Use of authorization by the AHC-based connectors is dependent on the chunk encoding setting. If the entity buffering is enabled, the entity is buffered and authorization can be performed automatically in response to a 401 by sending the request again. When entity buffering is disabled (chunked encoding is used) then the property {@link org.glassfish.jersey.apache.connector.ApacheClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION} mustbe set to {@code true}.
If a {@link org.glassfish.jersey.client.ClientResponse} is obtained and an entity is not read from the response then{@link org.glassfish.jersey.client.ClientResponse#close()} MUST be called after processing the response to releaseconnection-based resources.
If a response entity is obtained that is an instance of {@link java.io.Closeable}then the instance MUST be closed after processing the entity to release connection-based resources.
The following methods are currently supported: HEAD, GET, POST, PUT, DELETE, OPTIONS, PATCH and TRACE.
@author Pavel Bucek (pavel.bucek at oracle.com)
@author Arul Dhesiaseelan (aruld at acm.org)
@author jorgeluisw at mac.com
@author Marek Potociar (marek.potociar at oracle.com)
@author Paul Sandoz (paul.sandoz at oracle.com)
@since 2.5