public static class ApacheConnectorProperties.ApacheConnectorPropertiesBuilder extends Object
Modifier and Type | Method and Description |
---|---|
ApacheConnectorProperties |
build() |
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
connectionClosingStrategy(org.glassfish.jersey.apache.connector.ApacheConnectionClosingStrategy connectionClosingStrategy)
Strategy that closes the Apache Connection.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
connectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
Connection Manager which will be used to create the Apache HttpClient.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
connectionManagerShared(boolean connectionManagerShared)
A value of true indicates that configured connection manager should be shared among multiple Jersey ClientRuntime instances.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
connectionPoolConfig(ApacheConnectionPoolConfig connectionPoolConfig)
ApacheConnectionPoolConfig for the connection pooling
The value MUST be an instance of ApacheConnectionPoolConfig
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
connectionPooling(boolean connectionPooling)
A value that indicates whether connection pooling will be enabled.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
connectionReuseStrategy(org.apache.http.ConnectionReuseStrategy connectionReuseStrategy)
ConnectionReuseStrategy for the Apache HttpClient.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
expectContinue(boolean expectContinue)
A value that indicates whether to support expect 100 continue behavior for the Apache HttpClient.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
hostnameVerifier(HostnameVerifier hostnameVerifier)
HostnameVerifier to be used for the Apache Connection.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
keepAliveStrategy(org.apache.http.conn.ConnectionKeepAliveStrategy keepAliveStrategy)
ConnectionKeepAliveStrategy for the Apache HttpClient.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
requestRetryHandler(org.apache.http.client.HttpRequestRetryHandler requestRetryHandler)
Request RetryHandler to be used for the Apache Connection.
|
ApacheConnectorProperties.ApacheConnectorPropertiesBuilder |
sslContext(SSLContext sslContext)
SSLContext to be used for the Apache Connection.
|
String |
toString() |
public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder keepAliveStrategy(org.apache.http.conn.ConnectionKeepAliveStrategy keepAliveStrategy)
ConnectionKeepAliveStrategy for the Apache 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
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder connectionManagerShared(boolean connectionManagerShared)
A value of 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.
The value MUST be boolean
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder connectionManager(org.apache.http.conn.HttpClientConnectionManager connectionManager)
Connection Manager which will be used to create the Apache HttpClient. This takes precedence over the default pooling configuration The value MUST be an instance of HttpClientConnectionManager.
If the property is absent a default Connection Manager will be used (PoolingHttpClientConnectionManager)
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder connectionReuseStrategy(org.apache.http.ConnectionReuseStrategy connectionReuseStrategy)
ConnectionReuseStrategy for the Apache HttpClient. The value MUST be an instance of org.apache.http.impl.ConnectionReuseStrategy.
If the property is absent the default reuse strategy of the Apache HTTP library will be used
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder connectionPooling(boolean connectionPooling)
A value that indicates whether connection pooling will be enabled. The value MUST be boolean
If the property is absent then default option of pooling will be used If the property is false, then the thread-safe BasicHttpClientConnectionManager is used for the Apache HttpClient A connection manager for a single connection. This connection manager maintains only one active connection. Even though this class is fully thread-safe it ought to be used by one execution thread only, as only one thread a time can lease the connection at a time. This connection manager implementation should be used inside an EJB container
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder connectionPoolConfig(ApacheConnectionPoolConfig connectionPoolConfig)
ApacheConnectionPoolConfig for the connection pooling The value MUST be an instance of ApacheConnectionPoolConfig
If the property is absent then default option of pool config will be used
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder expectContinue(boolean expectContinue)
A value that indicates whether to support expect 100 continue behavior for the Apache HttpClient.
If this value is true, and the Apache HttpClient is used, and operation supports expect 100 continue, then this request header will be emitted.
The value MUST be boolean.
If the property is absent then default option of true will be used.
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder connectionClosingStrategy(org.glassfish.jersey.apache.connector.ApacheConnectionClosingStrategy connectionClosingStrategy)
Strategy that closes the Apache Connection. Accepts an instance of ApacheConnectionClosingStrategy. The value MUST be an instance of ApacheConnectionClosingStrategy.
If the property is absent then default option of ApacheConnectionClosingStrategy.ImmediateClosingStrategy will be used
Note: When using ApacheConnectionClosingStrategy.GracefulClosingStrategy, streams returned from response are read till the end of the stream when closing the stream. This can introduce additional time when closing the stream with partial read, depending on how large the remaining stream is. Use ApacheConnectionClosingStrategy.ImmediateClosingStrategy for large files with partial reads instead for faster close. ApacheConnectionClosingStrategy.ImmediateClosingStrategy on the other hand takes longer when using partial read for smaller stream size (< 1MB). Please consider your use-case and change accordingly. Please use ApacheConnectorPropertiesExample for reference
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder sslContext(SSLContext sslContext)
SSLContext to be used for the Apache Connection. Accepts an instance of SSLContext. The value MUST be an instance of SSLContext.
If the property is absent then default value of null will be used
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder hostnameVerifier(HostnameVerifier hostnameVerifier)
HostnameVerifier to be used for the Apache Connection. Accepts an instance of HostnameVerifier. The value MUST be an instance of HostnameVerifier.
If the property is absent then default value of null will be used
this
.public ApacheConnectorProperties.ApacheConnectorPropertiesBuilder requestRetryHandler(org.apache.http.client.HttpRequestRetryHandler requestRetryHandler)
Request RetryHandler to be used for the Apache Connection. Accepts an instance of HttpRequestRetryHandler
this
.public ApacheConnectorProperties build()
Copyright © 2016–2023. All rights reserved.