Class RestClientConfiguration

java.lang.Object
com.wultra.core.rest.client.base.RestClientConfiguration

public class RestClientConfiguration extends Object
REST client configuration. This class is safe to use as org.springframework.boot.context.properties.ConfigurationProperties.
Author:
Roman Strobl, roman.strobl@wultra.com
  • Constructor Details

    • RestClientConfiguration

      public RestClientConfiguration()
  • Method Details

    • getBaseUrl

      public String getBaseUrl()
      Get base URL.
      Returns:
      Base URL.
    • setBaseUrl

      public void setBaseUrl(String baseUrl)
      Set base URL.
      Parameters:
      baseUrl - Base URL.
    • getContentType

      public org.springframework.http.MediaType getContentType()
      Get content type.
      Returns:
      Content type.
    • setContentType

      public void setContentType(org.springframework.http.MediaType contentType)
      Set content type.
      Parameters:
      contentType - Content type.
    • getAcceptType

      public org.springframework.http.MediaType getAcceptType()
      Get accept type.
      Returns:
      Accept type.
    • setAcceptType

      public void setAcceptType(org.springframework.http.MediaType acceptType)
      Set accept type.
      Parameters:
      acceptType - Accepty type.
    • isProxyEnabled

      public boolean isProxyEnabled()
      Get whether proxy is enabled.
      Returns:
      Whether proxy is enabled.
    • setProxyEnabled

      public void setProxyEnabled(boolean proxyEnabled)
      Set whether proxy is enabled.
      Parameters:
      proxyEnabled - Whether proxy is enabled.
    • getProxyHost

      public String getProxyHost()
      Get proxy host.
      Returns:
      Proxy host.
    • setProxyHost

      public void setProxyHost(String proxyHost)
      Set proxy host.
      Parameters:
      proxyHost - Proxy host.
    • getProxyPort

      public int getProxyPort()
      Get proxy port.
      Returns:
      Proxy port.
    • setProxyPort

      public void setProxyPort(int proxyPort)
      Set proxy port.
      Parameters:
      proxyPort - Proxy port.
    • getProxyUsername

      public String getProxyUsername()
      Get proxy username.
      Returns:
      Proxy username.
    • setProxyUsername

      public void setProxyUsername(String proxyUsername)
      Set proxy username.
      Parameters:
      proxyUsername - Proxy username.
    • getProxyPassword

      public String getProxyPassword()
      Get proxy password.
      Returns:
      Proxy password.
    • setProxyPassword

      public void setProxyPassword(String proxyPassword)
      Set proxy password.
      Parameters:
      proxyPassword - Proxy password.
    • getConnectionTimeout

      public Duration getConnectionTimeout()
      Get connection timeout in milliseconds.
      Returns:
      Connection timeout.
    • setConnectionTimeout

      public void setConnectionTimeout(Duration connectionTimeout)
      Set connection timeout.
      Parameters:
      connectionTimeout - Connection timeout as a Duration object.
    • getMaxIdleTime

      public Duration getMaxIdleTime()
      Get max idle time.
      Returns:
      Max idle time.
    • setMaxIdleTime

      public void setMaxIdleTime(Duration maxIdleTime)
      Set the options to use for configuring ConnectionProvider max idle time. Null means no max idle time.
      Parameters:
      maxIdleTime - Max idle time.
    • getMaxLifeTime

      public Duration getMaxLifeTime()
      Get max life time.
      Returns:
      Max life time.
    • setMaxLifeTime

      public void setMaxLifeTime(Duration maxLifeTime)
      Set the options to use for configuring ConnectionProvider max life time. Null means no max life time.
      Parameters:
      maxLifeTime - Max life time.
    • isKeepAliveEnabled

      public boolean isKeepAliveEnabled()
      Return whether Keep-Alive is enabled.
      Returns:
      True if keep-alive enabled-
    • setKeepAliveEnabled

      public void setKeepAliveEnabled(boolean keepAliveEnabled)
      Set whether Keep-Alive is enabled
      Parameters:
      keepAliveEnabled - Keep-Alive.
    • getKeepAliveIdle

      public Duration getKeepAliveIdle()
      Get Keep-Alive idle time.
      Returns:
      Keep-Alive idle time.
    • setKeepAliveIdle

      public void setKeepAliveIdle(Duration keepAliveIdle)
      Set Keep-Alive idle time.
      Parameters:
      keepAliveIdle - Keep-Alive idle time.
    • getKeepAliveInterval

      public Duration getKeepAliveInterval()
      Get Keep-Alive retransmission interval time.
      Returns:
      Keep-Alive retransmission interval time.
    • setKeepAliveInterval

      public void setKeepAliveInterval(Duration keepAliveInterval)
      Set Keep-Alive retransmission interval time.
      Parameters:
      keepAliveInterval - Keep-Alive retransmission interval time.
    • getKeepAliveCount

      public Integer getKeepAliveCount()
      Get Keep-Alive retransmission limit.
      Returns:
      Keep-Alive retransmission limit.
    • setKeepAliveCount

      public void setKeepAliveCount(Integer keepAliveCount)
      Set Keep-Alive retransmission limit.
      Parameters:
      keepAliveCount - Keep-Alive retransmission limit.
    • isAcceptInvalidSslCertificate

      public boolean isAcceptInvalidSslCertificate()
      Get whether invalid SSL certificate is accepted.
      Returns:
      Whether invalid SSL certificate is accepted.
    • setAcceptInvalidSslCertificate

      public void setAcceptInvalidSslCertificate(boolean acceptInvalidSslCertificate)
      Set whether invalid SSL certificate is accepted.
      Parameters:
      acceptInvalidSslCertificate - Whether invalid SSL certificate is accepted.
    • getMaxInMemorySize

      public Integer getMaxInMemorySize()
      Get maximum in memory request size.
      Returns:
      Maximum in memory request size.
    • setMaxInMemorySize

      public void setMaxInMemorySize(Integer maxInMemorySize)
      Set maximum in memory request size.
      Parameters:
      maxInMemorySize - Maximum in memory request size.
    • isHttpBasicAuthEnabled

      public boolean isHttpBasicAuthEnabled()
      Get whether basic HTTP authentication is enabled.
      Returns:
      Whether basic HTTP authentication is enabled.
    • setHttpBasicAuthEnabled

      public void setHttpBasicAuthEnabled(boolean httpBasicAuthEnabled)
      Set whether basic HTTP authentication is enabled.
      Parameters:
      httpBasicAuthEnabled - Whether basic HTTP authentication is enabled.
    • getHttpBasicAuthUsername

      public String getHttpBasicAuthUsername()
      Get username for basic HTTP authentication.
      Returns:
      Username for basic HTTP authentication.
    • setHttpBasicAuthUsername

      public void setHttpBasicAuthUsername(String httpBasicAuthUsername)
      Set username for basic HTTP authentication.
      Parameters:
      httpBasicAuthUsername - Username for basic HTTP authentication.
    • getHttpBasicAuthPassword

      public String getHttpBasicAuthPassword()
      Get password for basic HTTP authentication.
      Returns:
      Password for basic HTTP authentication.
    • setHttpBasicAuthPassword

      public void setHttpBasicAuthPassword(String httpBasicAuthPassword)
      Set password for basic HTTP authentication.
      Parameters:
      httpBasicAuthPassword - Password for basic HTTP authentication.
    • isHttpDigestAuthEnabled

      public boolean isHttpDigestAuthEnabled()
      Get whether digest HTTP authentication is enabled.
      Returns:
      Whether digest HTTP authentication is enabled.
    • setHttpDigestAuthEnabled

      public void setHttpDigestAuthEnabled(boolean httpDigestAuthEnabled)
      Set whether digest HTTP authentication is enabled.
      Parameters:
      httpDigestAuthEnabled - Whether digest HTTP authentication is enabled.
    • getHttpDigestAuthUsername

      public String getHttpDigestAuthUsername()
      Get username for digest HTTP authentication.
      Returns:
      Username for digest HTTP authentication.
    • setHttpDigestAuthUsername

      public void setHttpDigestAuthUsername(String httpDigestAuthUsername)
      Set username for digest HTTP authentication.
      Parameters:
      httpDigestAuthUsername - Username for digest HTTP authentication.
    • getHttpDigestAuthPassword

      public String getHttpDigestAuthPassword()
      Get password for digest HTTP authentication.
      Returns:
      Password for digest HTTP authentication.
    • setHttpDigestAuthPassword

      public void setHttpDigestAuthPassword(String httpDigestAuthPassword)
      Set password for digest HTTP authentication.
      Parameters:
      httpDigestAuthPassword - Password for digest HTTP authentication.
    • isCertificateAuthEnabled

      public boolean isCertificateAuthEnabled()
      Get whether client TLS certificate authentication is enabled.
      Returns:
      Whether client TLS certificate authentication is enabled.
    • setCertificateAuthEnabled

      public void setCertificateAuthEnabled(boolean certificateAuthEnabled)
      Set whether client TLS certificate authentication is enabled.
      Parameters:
      certificateAuthEnabled - Whether client TLS certificate authentication is enabled.
    • useCustomKeyStore

      public boolean useCustomKeyStore()
      Get whether custom keystore is used for client TLS certificate authentication.
      Returns:
      Whether custom keystore is used for client TLS certificate authentication.
    • setUseCustomKeyStore

      public void setUseCustomKeyStore(boolean useCustomKeyStore)
      Set whether custom keystore is used for client TLS certificate authentication.
      Parameters:
      useCustomKeyStore - Whether custom keystore is used for client TLS certificate authentication.
    • getKeyStoreBytes

      @Nullable public byte[] getKeyStoreBytes()
      Get byte data with the key store.
      Returns:
      Byte data with the key store.
    • setKeyStoreBytes

      public void setKeyStoreBytes(byte[] keyStoreBytes)
      Set byte data with the key store.
      Parameters:
      keyStoreBytes - Byte data with the key store.
    • getKeyStoreLocation

      public String getKeyStoreLocation()
      Get keystore resource location for client TLS certificate authentication.
      Returns:
      Keystore resource location for client TLS certificate authentication.
    • setKeyStoreLocation

      public void setKeyStoreLocation(String keyStoreLocation)
      Set keystore resource location for client TLS certificate authentication.
      Parameters:
      keyStoreLocation - Keystore resource location for client TLS certificate authentication.
    • getKeyStorePassword

      public String getKeyStorePassword()
      Get keystore password for client TLS certificate authentication.
      Returns:
      Keystore password for client TLS certificate authentication.
    • setKeyStorePassword

      public void setKeyStorePassword(String keyStorePassword)
      Set keystore password for client TLS certificate authentication.
      Parameters:
      keyStorePassword - Keystore password for client TLS certificate authentication.
    • getKeyAlias

      public String getKeyAlias()
      Get private key alias for client TLS certificate authentication.
      Returns:
      Private key alias for client TLS certificate authentication.
    • setKeyAlias

      public void setKeyAlias(String keyAlias)
      Set private key alias for client TLS certificate authentication.
      Parameters:
      keyAlias - Private key alias for client TLS certificate authentication.
    • getKeyPassword

      public String getKeyPassword()
      Get private key password for client TLS certificate authentication.
      Returns:
      Private key password for client TLS certificate authentication.
    • setKeyPassword

      public void setKeyPassword(String keyPassword)
      Set private key password for client TLS certificate authentication.
      Parameters:
      keyPassword - Private key password for client TLS certificate authentication.
    • useCustomTrustStore

      public boolean useCustomTrustStore()
      Get whether custom truststore is used for client TLS certificate authentication.
      Returns:
      Whether custom truststore is used for client TLS certificate authentication.
    • setUseCustomTrustStore

      public void setUseCustomTrustStore(boolean useCustomTrustStore)
      Set whether custom truststore is used for client TLS certificate authentication.
      Parameters:
      useCustomTrustStore - Whether custom truststore is used for client TLS certificate authentication.
    • getTrustStoreBytes

      @Nullable public byte[] getTrustStoreBytes()
      Get byte data with the trust store.
      Returns:
      Byte data with the trust store
    • setTrustStoreBytes

      public void setTrustStoreBytes(byte[] trustStoreBytes)
      Set byte data with the trust store.
      Parameters:
      trustStoreBytes - Byte data with the trust store.
    • getTrustStoreLocation

      public String getTrustStoreLocation()
      Get truststore resource location for client TLS certificate authentication.
      Returns:
      Truststore resource location for client TLS certificate authentication.
    • setTrustStoreLocation

      public void setTrustStoreLocation(String trustStoreLocation)
      Set truststore resource location for client TLS certificate authentication.
      Parameters:
      trustStoreLocation - Truststore resource location for client TLS certificate authentication.
    • getTrustStorePassword

      public String getTrustStorePassword()
      Get truststore password for client TLS certificate authentication.
      Returns:
      Truststore password for client TLS certificate authentication.
    • setTrustStorePassword

      public void setTrustStorePassword(String trustStorePassword)
      Set truststore password for client TLS certificate authentication.
      Parameters:
      trustStorePassword - Truststore password for client TLS certificate authentication.
    • getJacksonConfiguration

      public RestClientConfiguration.JacksonConfiguration getJacksonConfiguration()
      Get the jackson configuration.
      Returns:
      Object mapper.
    • setJacksonConfiguration

      public void setJacksonConfiguration(RestClientConfiguration.JacksonConfiguration jacksonConfiguration)
      Set the jackson configuration.
      Parameters:
      jacksonConfiguration - jacksonConfiguration.
    • getFilter

      public org.springframework.web.reactive.function.client.ExchangeFilterFunction getFilter()
      Get the exchange filter function.
      Returns:
      Exchange filter function.
    • setFilter

      public void setFilter(org.springframework.web.reactive.function.client.ExchangeFilterFunction filter)
      Set the exchange filter function.
      Parameters:
      filter - Exchange filter function.
    • getDefaultHttpHeaders

      public org.springframework.http.HttpHeaders getDefaultHttpHeaders()
      Get the default HTTP headers.
      Returns:
      Default HTTP headers.
    • setDefaultHttpHeaders

      public void setDefaultHttpHeaders(org.springframework.http.HttpHeaders headers)
      Set the default HTTP headers.
      Parameters:
      headers - Default HTTP headers.
    • getHandshakeTimeout

      public Duration getHandshakeTimeout()
      Get the SSL handshake timeout.
      Returns:
      timeout duration
    • setHandshakeTimeout

      public void setHandshakeTimeout(Duration handshakeTimeout)
      Set the SSL handshake timeout. Default to 10000 ms.
      Parameters:
      handshakeTimeout - timeout duration
    • getResponseTimeout

      public Duration getResponseTimeout()
      Get the maximum duration allowed between each network-level read operations (resolution: ms).
      Returns:
      response timeout
    • setResponseTimeout

      public void setResponseTimeout(Duration responseTimeout)
      Set the maximum duration allowed between each network-level read operations (resolution: ms).
      Parameters:
      responseTimeout - response timeout (resolution: ms)
    • isFollowRedirectEnabled

      public boolean isFollowRedirectEnabled()
      Get whether following of redirections is enabled.
      Returns:
      Whether following of redirections is enabled.
    • setFollowRedirectEnabled

      public void setFollowRedirectEnabled(boolean followRedirectEnabled)
      Sets whether following of redirections is enabled
      Parameters:
      followRedirectEnabled - Whether following of redirections is enabled
    • isSimpleLoggingEnabled

      public boolean isSimpleLoggingEnabled()
      Get whether simple one-line logging of HTTP requests and responses is enabled.
      Returns:
      Whether simple logging is enabled.
    • setSimpleLoggingEnabled

      public void setSimpleLoggingEnabled(boolean simpleLoggingEnabled)
      Set whether simple one-line logging of HTTP requests and responses is enabled.
      Parameters:
      simpleLoggingEnabled - Whether simple logging is enabled.
    • isLogErrorResponsesAsWarnings

      public boolean isLogErrorResponsesAsWarnings()
      Get whether error HTTP responses are logged as warnings.
      Returns:
      Whether error HTTP responses are logged as warnings.
    • setLogErrorResponsesAsWarnings

      public void setLogErrorResponsesAsWarnings(boolean logErrorResponsesAsWarnings)
      Set whether error HTTP responses are logged as warnings.
      Parameters:
      logErrorResponsesAsWarnings - Whether error HTTP responses are logged as warnings.