Class HttpClientOptions
java.lang.Object
fr.enedis.chutney.jira.infra.atlassian.httpclient.api.factory.HttpClientOptions
Configuration options for the http client instance and its caching system
* Changes : * - Use local package ProxyOptions class *
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglongbooleanWhether or not to ignore cookies.longDetermines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests.intDetermines the number of I/O dispatch threads to be used by the I/O reactor.longintlongintintlongintConsumer<com.atlassian.httpclient.api.Request> longlongString[]Gets the supported protocols that are to be used in favor of the protocols specified by the "https.protocols" system property.intvoidsetBlacklistedAddresses(List<String> blacklistedAddresses) voidsetCallbackExecutor(ExecutorService callbackExecutor) voidsetConnectionPoolTimeToLive(int connectionPoolTimeToLive, TimeUnit timeUnit) voidsetConnectionTimeout(int connectionTimeout, TimeUnit timeUnit) Sets how long, in milliseconds, to wait for a TCP connectionvoidsetIgnoreCookies(boolean ignoreCookies) voidsetIoSelectInterval(int ioSelectInterval, TimeUnit timeUnit) Defines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests.voidsetIoThreadCount(int ioThreadCount) voidsetLeaseTimeout(long leaseTimeout) voidsetMaxCacheEntries(int maxCacheEntries) voidsetMaxCacheObjectSize(long maxCacheObjectSize) voidsetMaxCallbackThreadPoolSize(int maxCallbackThreadPoolSize) voidsetMaxConnectionsPerHost(int maxConnectionsPerHost) voidsetMaxEntitySize(long maxEntitySize) param maxEntitySize The maximum entity size in bytesvoidsetMaxTotalConnections(int maxTotalConnections) voidsetProxyOptions(ProxyOptions proxyOptions) Set proxy options for the clientvoidsetRequestPreparer(Consumer<com.atlassian.httpclient.api.Request> requestPreparer) voidsetRequestTimeout(int requestTimeout, TimeUnit timeUnit) voidsetSocketTimeout(int socketTimeout, TimeUnit timeUnit) voidsetSupportedProtocols(String... supportedProtocols) Override the default supported protocols specified by the system property "https.protocols"voidsetThreadPrefix(String threadPrefix) voidsetThreadWorkQueueLimit(int threadWorkQueueLimit) voidsetTrustSelfSignedCertificates(boolean trustSelfSignedCertificates) voidsetUserAgent(String userAgent) boolean
-
Field Details
-
OPTION_PROPERTY_PREFIX
- See Also:
-
OPTION_THREAD_WORK_QUEUE_LIMIT
- See Also:
-
-
Constructor Details
-
HttpClientOptions
public HttpClientOptions()
-
-
Method Details
-
getIgnoreCookies
public boolean getIgnoreCookies()Whether or not to ignore cookies.Default:
false -
getSupportedProtocols
Gets the supported protocols that are to be used in favor of the protocols specified by the "https.protocols" system property.- Returns:
- an array of supported protocols, or
nullto use the protocols specified by the "https.protocols" system property. - Since:
- 2.1.0
-
setIgnoreCookies
public void setIgnoreCookies(boolean ignoreCookies) - Parameters:
ignoreCookies- Whether or not to ignore cookies.
-
getIoThreadCount
public int getIoThreadCount()Determines the number of I/O dispatch threads to be used by the I/O reactor.Default:
10 -
setIoThreadCount
public void setIoThreadCount(int ioThreadCount) - Parameters:
ioThreadCount- The number of I/O dispatch threads to be used by the I/O reactor. May not be negative or zero.
-
getIoSelectInterval
public long getIoSelectInterval()Determines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests.Default:
1000milliseconds. -
setIoSelectInterval
Defines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests. May not be negative or zero. -
getConnectionTimeout
public long getConnectionTimeout()- Returns:
- How long, in milliseconds, to wait for a TCP connection
-
setConnectionTimeout
Sets how long, in milliseconds, to wait for a TCP connection- Parameters:
connectionTimeout- Timeout value, defaults to 5000 millisecondstimeUnit- The time unit
-
getSocketTimeout
public long getSocketTimeout()- Returns:
- How long, in milliseconds, to wait for data over the socket
-
setSocketTimeout
- Parameters:
socketTimeout- How long to wait for data, defaults to 20 secondstimeUnit- The time unit
-
getRequestTimeout
public long getRequestTimeout()- Returns:
- How long to wait for the entire request
-
setRequestTimeout
- Parameters:
requestTimeout- How long to wait for the entire request. Defaults to 30 seconds.timeUnit- The time unit
-
setSupportedProtocols
Override the default supported protocols specified by the system property "https.protocols"- Parameters:
supportedProtocols- The list of supported protocols (e.g. "TLSv1.2", "TLSv1.3")- Since:
- 2.1.0
-
getUserAgent
- Returns:
- The user agent string
-
setUserAgent
- Parameters:
userAgent- The user agent string
-
getThreadPrefix
- Returns:
- Name prefix to use for spawned threads
-
setBlacklistedAddresses
- Parameters:
blacklistedAddresses- a list of addresses or cidr ranges that this http client cannot connect to
-
getBlacklistedAddresses
-
setThreadPrefix
- Parameters:
threadPrefix- Name prefix to use for spawned threads
-
getConnectionPoolTimeToLive
public long getConnectionPoolTimeToLive()- Returns:
- How long, in milliseconds, to allow connections to live in the pool. Defaults to 30 seconds.
-
setConnectionPoolTimeToLive
- Parameters:
connectionPoolTimeToLive- How long to allow connections to live in the pooltimeUnit- The time unit
-
getMaxTotalConnections
public int getMaxTotalConnections()- Returns:
- How many simultaneous connections are allowed in total. Defaults to 20
-
setMaxTotalConnections
public void setMaxTotalConnections(int maxTotalConnections) - Parameters:
maxTotalConnections- How many simultaneous connections are allowed in total
-
getMaxConnectionsPerHost
public int getMaxConnectionsPerHost()- Returns:
- How many simultaneous connections are allowed per host. Defaults to 20
-
setMaxConnectionsPerHost
public void setMaxConnectionsPerHost(int maxConnectionsPerHost) - Parameters:
maxConnectionsPerHost- How many connections are allowed per host
-
getMaxCacheObjectSize
public long getMaxCacheObjectSize()- Returns:
- The max object size, in bytes, allowed in the HTTP cache. Defaults to 100k
-
setMaxCacheObjectSize
public void setMaxCacheObjectSize(long maxCacheObjectSize) - Parameters:
maxCacheObjectSize- The max cache object size in bytes
-
getMaxCacheEntries
public int getMaxCacheEntries()- Returns:
- The max cache entries. Defaults to 1000.
-
setMaxCacheEntries
public void setMaxCacheEntries(int maxCacheEntries) - Parameters:
maxCacheEntries- The max cache entries
-
getRequestPreparer
- Returns:
- The effect to apply before the request is executed
-
setRequestPreparer
- Parameters:
requestPreparer- The effect to apply before the request is executed
-
getMaxEntitySize
public long getMaxEntitySize()- Returns:
- The maximum entity size in bytes. Default is 100MB
-
getLeaseTimeout
public long getLeaseTimeout()- Returns:
- The maximum time request to be kept in queue before execution, after timeout - request will be removed
-
setLeaseTimeout
public void setLeaseTimeout(long leaseTimeout) - Parameters:
leaseTimeout- The maximum time request to be kept in queue before execution, after timeout - request will be removed
-
setMaxEntitySize
public void setMaxEntitySize(long maxEntitySize) param maxEntitySize The maximum entity size in bytes -
getMaxCallbackThreadPoolSize
public int getMaxCallbackThreadPoolSize()- Returns:
- The maximum number of threads that can be used for executing callbacks
-
setMaxCallbackThreadPoolSize
public void setMaxCallbackThreadPoolSize(int maxCallbackThreadPoolSize) - Parameters:
maxCallbackThreadPoolSize- The maximum number of threads that can be used for executing callbacks
-
setCallbackExecutor
-
getCallbackExecutor
-
setTrustSelfSignedCertificates
public void setTrustSelfSignedCertificates(boolean trustSelfSignedCertificates) -
trustSelfSignedCertificates
public boolean trustSelfSignedCertificates()- Returns:
- whether self signed certificates are trusted.
-
setProxyOptions
Set proxy options for the client- Parameters:
proxyOptions- Proxy options created usingProxyOptions.ProxyOptionsBuilder.
-
getProxyOptions
- Returns:
- The proxy options to use for the client.
-
getThreadWorkQueueLimit
public int getThreadWorkQueueLimit() -
setThreadWorkQueueLimit
public void setThreadWorkQueueLimit(int threadWorkQueueLimit)
-