- java.lang.Object
-
- io.rxmicro.config.Config
-
- io.rxmicro.http.HttpConfig
-
- io.rxmicro.http.client.HttpClientConfig
-
public class HttpClientConfig extends HttpConfig
Allows configuring HTTP client options.- Since:
- 0.1
- Author:
- nedis
- See Also:
Duration
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_HTTP_CLIENT_TIMEOUT_VALUE_IN_SECONDSDefault HTTP client timeout in seconds.-
Fields inherited from class io.rxmicro.http.HttpConfig
DEFAULT_HTTP_PORT
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHttpClientConfig()Creates a HTTP client config instance with default settings.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccessKey()Returns the set access key ornullif access key is not configured.DurationgetRequestTimeout()Returns the request timeout.booleanisFollowRedirects()Returnstrueif current HTTP client must follow redirects.HttpClientConfigsetAccessKey(String accessKey)Sets the access key that can be used for authentication on the server side.HttpClientConfigsetConnectionString(String connectionString)HttpClientConfigsetFollowRedirects(boolean followRedirects)Sets that current HTTP client must follow redirects or not.HttpClientConfigsetHost(String host)HttpClientConfigsetPort(int port)HttpClientConfigsetRequestTimeout(Duration requestTimeout)Sets the request timeout.HttpClientConfigsetSchema(ProtocolSchema schema)StringtoString()-
Methods inherited from class io.rxmicro.http.HttpConfig
getConnectionString, getHost, getPort, getSchema
-
-
-
-
Field Detail
-
DEFAULT_HTTP_CLIENT_TIMEOUT_VALUE_IN_SECONDS
public static final int DEFAULT_HTTP_CLIENT_TIMEOUT_VALUE_IN_SECONDS
Default HTTP client timeout in seconds.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAccessKey
public String getAccessKey()
Returns the set access key ornullif access key is not configured.- Returns:
- the set access key or
nullif access key is not configured
-
setAccessKey
@BuilderMethod public HttpClientConfig setAccessKey(String accessKey)
Sets the access key that can be used for authentication on the server side.- Parameters:
accessKey- the access key- Returns:
- the reference to this
HttpClientConfiginstance
-
isFollowRedirects
public boolean isFollowRedirects()
Returnstrueif current HTTP client must follow redirects.- Returns:
trueif current HTTP client must follow redirects
-
setFollowRedirects
@BuilderMethod public HttpClientConfig setFollowRedirects(boolean followRedirects)
Sets that current HTTP client must follow redirects or not.- Parameters:
followRedirects- follow redirects or not- Returns:
- the reference to this
HttpClientConfiginstance
-
getRequestTimeout
public Duration getRequestTimeout()
Returns the request timeout.- Returns:
- the request timeout
-
setRequestTimeout
@BuilderMethod public HttpClientConfig setRequestTimeout(Duration requestTimeout)
Sets the request timeout.Duration.ZEROmeans the infinite timeout- Parameters:
requestTimeout- the request timeout- Returns:
- the reference to this
HttpClientConfiginstance
-
setSchema
public HttpClientConfig setSchema(ProtocolSchema schema)
- Overrides:
setSchemain classHttpConfig
-
setHost
public HttpClientConfig setHost(String host)
- Overrides:
setHostin classHttpConfig
-
setPort
public HttpClientConfig setPort(int port)
- Overrides:
setPortin classHttpConfig
-
setConnectionString
public HttpClientConfig setConnectionString(String connectionString)
- Overrides:
setConnectionStringin classHttpConfig
-
toString
public String toString()
- Overrides:
toStringin classHttpConfig
-
-