Class ConfigurationOverride
- java.lang.Object
-
- dev.openfga.sdk.api.configuration.ConfigurationOverride
-
- All Implemented Interfaces:
BaseConfiguration
public class ConfigurationOverride extends java.lang.Object implements BaseConfiguration
Configuration overrides for an api client. Values are initialized to null, and any values unset are intended to fall through to the values of aConfiguration.More details on intended usage of this class can be found in the documentation of the
Configuration.override(ConfigurationOverride)method.
-
-
Constructor Summary
Constructors Constructor Description ConfigurationOverride()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurationOverrideaddHeaders(AdditionalHeadersSupplier supplier)ConfigurationOverrideadditionalHeaders(java.util.Map<java.lang.String,java.lang.String> additionalHeaders)ConfigurationOverrideapiUrl(java.lang.String apiUrl)Set the API URL for the http client.ConfigurationOverrideconnectTimeout(java.time.Duration connectTimeout)Sets the connect timeout (in milliseconds) for the http client.ConfigurationOverridecredentials(Credentials credentials)Set the credentials.java.util.Map<java.lang.String,java.lang.String>getAdditionalHeaders()java.lang.StringgetApiUrl()Get the API URL that was set.java.time.DurationgetConnectTimeout()Get connection timeout (in milliseconds).CredentialsgetCredentials()Get the configured credentials.java.lang.IntegergetMaxRetries()java.time.DurationgetMinimumRetryDelay()java.time.DurationgetReadTimeout()Get the read timeout that was set.java.lang.StringgetUserAgent()Get the user agent.ConfigurationOverridemaxRetries(int maxRetries)ConfigurationOverrideminimumRetryDelay(java.time.Duration minimumRetryDelay)ConfigurationOverridereadTimeout(java.time.Duration readTimeout)Set the read timeout for the http client.ConfigurationOverrideuserAgent(java.lang.String userAgent)Set the user agent.
-
-
-
Method Detail
-
apiUrl
public ConfigurationOverride apiUrl(java.lang.String apiUrl)
Set the API URL for the http client.- Parameters:
apiUrl- The URL.- Returns:
- This object.
-
getApiUrl
public java.lang.String getApiUrl()
Get the API URL that was set.- Specified by:
getApiUrlin interfaceBaseConfiguration- Returns:
- The url.
-
credentials
public ConfigurationOverride credentials(Credentials credentials)
Set the credentials.- Parameters:
credentials- The credentials.- Returns:
- This object.
-
getCredentials
public Credentials getCredentials()
Get the configured credentials.- Returns:
- The credentials.
-
userAgent
public ConfigurationOverride userAgent(java.lang.String userAgent)
Set the user agent.- Parameters:
userAgent- The user agent.- Returns:
- This object.
-
getUserAgent
public java.lang.String getUserAgent()
Get the user agent.- Specified by:
getUserAgentin interfaceBaseConfiguration- Returns:
- The user agent.
-
readTimeout
public ConfigurationOverride readTimeout(java.time.Duration readTimeout)
Set the read timeout for the http client.This is the value used by default for each request, though it can be overridden on a per-request basis with a request interceptor.
- Parameters:
readTimeout- The read timeout used by default by the http client. Setting this value to null resets the timeout to an effectively infinite value.- Returns:
- This object.
-
getReadTimeout
public java.time.Duration getReadTimeout()
Get the read timeout that was set.- Specified by:
getReadTimeoutin interfaceBaseConfiguration- Returns:
- The read timeout, or null if no timeout was set. Null represents an infinite wait time.
-
connectTimeout
public ConfigurationOverride connectTimeout(java.time.Duration connectTimeout)
Sets the connect timeout (in milliseconds) for the http client.In the case where a new connection needs to be established, if the connection cannot be established within the given
duration, thenHttpClient::sendthrows anHttpConnectTimeoutException, orHttpClient::sendAsynccompletes exceptionally with anHttpConnectTimeoutException. If a new connection does not need to be established, for example if a connection can be reused from a previous request, then this timeout duration has no effect.- Parameters:
connectTimeout- connection timeout in milliseconds- Returns:
- This object.
-
getConnectTimeout
public java.time.Duration getConnectTimeout()
Get connection timeout (in milliseconds).- Specified by:
getConnectTimeoutin interfaceBaseConfiguration- Returns:
- Timeout in milliseconds
-
maxRetries
public ConfigurationOverride maxRetries(int maxRetries)
-
getMaxRetries
public java.lang.Integer getMaxRetries()
- Specified by:
getMaxRetriesin interfaceBaseConfiguration
-
minimumRetryDelay
public ConfigurationOverride minimumRetryDelay(java.time.Duration minimumRetryDelay)
-
getMinimumRetryDelay
public java.time.Duration getMinimumRetryDelay()
- Specified by:
getMinimumRetryDelayin interfaceBaseConfiguration
-
additionalHeaders
public ConfigurationOverride additionalHeaders(java.util.Map<java.lang.String,java.lang.String> additionalHeaders)
-
addHeaders
public ConfigurationOverride addHeaders(AdditionalHeadersSupplier supplier)
-
getAdditionalHeaders
public java.util.Map<java.lang.String,java.lang.String> getAdditionalHeaders()
-
-