java.lang.Object
fr.enedis.chutney.jira.infra.atlassian.httpclient.api.factory.HttpClientOptions

public final class HttpClientOptions extends Object
Configuration options for the http client instance and its caching system
  *  Changes :
  *   - Use local package ProxyOptions class
  *  
See Also:
  • HttpClientOptions
  • Field Details

  • Constructor Details

    • HttpClientOptions

      public HttpClientOptions()
  • Method Details

    • getIgnoreCookies

      public boolean getIgnoreCookies()
      Whether or not to ignore cookies.

      Default: false

    • getSupportedProtocols

      public String[] 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 null to 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: 1000 milliseconds.

    • setIoSelectInterval

      public void setIoSelectInterval(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. May not be negative or zero.
    • getConnectionTimeout

      public long getConnectionTimeout()
      Returns:
      How long, in milliseconds, to wait for a TCP connection
    • setConnectionTimeout

      public void setConnectionTimeout(int connectionTimeout, TimeUnit timeUnit)
      Sets how long, in milliseconds, to wait for a TCP connection
      Parameters:
      connectionTimeout - Timeout value, defaults to 5000 milliseconds
      timeUnit - The time unit
    • getSocketTimeout

      public long getSocketTimeout()
      Returns:
      How long, in milliseconds, to wait for data over the socket
    • setSocketTimeout

      public void setSocketTimeout(int socketTimeout, TimeUnit timeUnit)
      Parameters:
      socketTimeout - How long to wait for data, defaults to 20 seconds
      timeUnit - The time unit
    • getRequestTimeout

      public long getRequestTimeout()
      Returns:
      How long to wait for the entire request
    • setRequestTimeout

      public void setRequestTimeout(int requestTimeout, TimeUnit timeUnit)
      Parameters:
      requestTimeout - How long to wait for the entire request. Defaults to 30 seconds.
      timeUnit - The time unit
    • setSupportedProtocols

      public void setSupportedProtocols(String... supportedProtocols)
      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

      public String getUserAgent()
      Returns:
      The user agent string
    • setUserAgent

      public void setUserAgent(String userAgent)
      Parameters:
      userAgent - The user agent string
    • getThreadPrefix

      public String getThreadPrefix()
      Returns:
      Name prefix to use for spawned threads
    • setBlacklistedAddresses

      public void setBlacklistedAddresses(@Nonnull List<String> blacklistedAddresses)
      Parameters:
      blacklistedAddresses - a list of addresses or cidr ranges that this http client cannot connect to
    • getBlacklistedAddresses

      @Nonnull public List<String> getBlacklistedAddresses()
    • setThreadPrefix

      public void setThreadPrefix(String threadPrefix)
      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

      public void setConnectionPoolTimeToLive(int connectionPoolTimeToLive, TimeUnit timeUnit)
      Parameters:
      connectionPoolTimeToLive - How long to allow connections to live in the pool
      timeUnit - 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

      public Consumer<com.atlassian.httpclient.api.Request> getRequestPreparer()
      Returns:
      The effect to apply before the request is executed
    • setRequestPreparer

      public void setRequestPreparer(Consumer<com.atlassian.httpclient.api.Request> requestPreparer)
      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

      public void setCallbackExecutor(ExecutorService callbackExecutor)
    • getCallbackExecutor

      public ExecutorService getCallbackExecutor()
    • setTrustSelfSignedCertificates

      public void setTrustSelfSignedCertificates(boolean trustSelfSignedCertificates)
    • trustSelfSignedCertificates

      public boolean trustSelfSignedCertificates()
      Returns:
      whether self signed certificates are trusted.
    • setProxyOptions

      public void setProxyOptions(@Nonnull ProxyOptions proxyOptions)
      Set proxy options for the client
      Parameters:
      proxyOptions - Proxy options created using ProxyOptions.ProxyOptionsBuilder.
    • getProxyOptions

      public ProxyOptions getProxyOptions()
      Returns:
      The proxy options to use for the client.
    • getThreadWorkQueueLimit

      public int getThreadWorkQueueLimit()
    • setThreadWorkQueueLimit

      public void setThreadWorkQueueLimit(int threadWorkQueueLimit)