Package org.azd.abstractions
Class RequestOption
java.lang.Object
org.azd.abstractions.RequestOption
Configuration class to configure the Api request before sending.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the proxy authentication.Request timeout duration.static RequestOption
Get a new instance.Get the proxy selector object.Get the Http redirect policy.Get the Http version.void
setAuthenticator
(Authenticator authenticator) Sets the proxy authenticator.void
setConnectionTimeOut
(long seconds) Sets the timeout duration.void
setProxySelector
(ProxySelector proxySelector) Sets the proxy selector object.void
setRedirectPolicy
(HttpClient.Redirect redirectPolicy) Sets the redirect policy.void
setVersion
(HttpClient.Version version) Sets the Http version.
-
Constructor Details
-
RequestOption
public RequestOption()
-
-
Method Details
-
getInstance
Get a new instance.- Returns:
- RequestObject instance.
-
getRedirectPolicy
Get the Http redirect policy.- Returns:
- Default redirect policy.
-
setRedirectPolicy
Sets the redirect policy.- Parameters:
redirectPolicy
- Redirect policy to set.
-
getVersion
Get the Http version.- Returns:
- Default http version which is Http2.0.
-
setVersion
Sets the Http version.- Parameters:
version
- Http version to set.
-
getConnectionTimeOut
Request timeout duration.- Returns:
- Default timeout value. Set to 10 seconds.
-
setConnectionTimeOut
public void setConnectionTimeOut(long seconds) Sets the timeout duration.- Parameters:
seconds
- Seconds to set as timeout duration.
-
getProxySelector
Get the proxy selector object.- Returns:
- ProxySelector
ProxySelector
.
-
setProxySelector
Sets the proxy selector object.- Parameters:
proxySelector
- Proxy selector object to set.
-
getAuthenticator
Get the proxy authentication.- Returns:
- Authenticator
Authenticator
.
-
setAuthenticator
Sets the proxy authenticator.- Parameters:
authenticator
- Proxy authenticator to set.
-