Class OkHttpProperties


  • @ConfigurationProperties(prefix="okhttp")
    public class OkHttpProperties
    extends Object
    • Constructor Detail

      • OkHttpProperties

        public OkHttpProperties()
    • Method Detail

      • getConnectTimeout

        public Duration getConnectTimeout()
        The default connect timeout for new connections.
      • getReadTimeout

        public Duration getReadTimeout()
        The default read timeout for new connections.
      • getWriteTimeout

        public Duration getWriteTimeout()
        The default write timeout for new connections.
      • getPingInterval

        public Duration getPingInterval()
        The interval between web socket pings initiated by this client. Use this to automatically send web socket ping frames until either the web socket fails or it is closed. This keeps the connection alive and may detect connectivity failures early. No timeouts are enforced on the acknowledging pongs.

        The default value of 0 disables client-initiated pings.

      • isFollowSslRedirects

        public boolean isFollowSslRedirects()
        Whether to follow redirects from HTTPS to HTTP and from HTTP to HTTPS.
      • isFollowRedirects

        public boolean isFollowRedirects()
        Whether to follow redirects.
      • isRetryOnConnectionFailure

        public boolean isRetryOnConnectionFailure()
        Whether to retry or not when a connectivity problem is encountered.
      • setConnectTimeout

        public void setConnectTimeout​(Duration connectTimeout)
        The default connect timeout for new connections.
      • setReadTimeout

        public void setReadTimeout​(Duration readTimeout)
        The default read timeout for new connections.
      • setWriteTimeout

        public void setWriteTimeout​(Duration writeTimeout)
        The default write timeout for new connections.
      • setPingInterval

        public void setPingInterval​(Duration pingInterval)
        The interval between web socket pings initiated by this client. Use this to automatically send web socket ping frames until either the web socket fails or it is closed. This keeps the connection alive and may detect connectivity failures early. No timeouts are enforced on the acknowledging pongs.

        The default value of 0 disables client-initiated pings.

      • setFollowSslRedirects

        public void setFollowSslRedirects​(boolean followSslRedirects)
        Whether to follow redirects from HTTPS to HTTP and from HTTP to HTTPS.
      • setFollowRedirects

        public void setFollowRedirects​(boolean followRedirects)
        Whether to follow redirects.
      • setRetryOnConnectionFailure

        public void setRetryOnConnectionFailure​(boolean retryOnConnectionFailure)
        Whether to retry or not when a connectivity problem is encountered.
      • canEqual

        protected boolean canEqual​(Object other)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object