Package co.arago.hiro.client.connection
Class AbstractClientAPIHandler.Conf<T extends AbstractClientAPIHandler.Conf<T>>
- java.lang.Object
-
- co.arago.hiro.client.connection.AbstractAPIHandler.Conf<T>
-
- co.arago.hiro.client.connection.AbstractClientAPIHandler.Conf<T>
-
- All Implemented Interfaces:
AbstractAPIHandler.GetterConf
- Direct Known Subclasses:
AbstractVersionAPIHandler.Conf
- Enclosing class:
- AbstractClientAPIHandler
public abstract static class AbstractClientAPIHandler.Conf<T extends AbstractClientAPIHandler.Conf<T>> extends AbstractAPIHandler.Conf<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.BooleanacceptAllCertsprotected java.lang.LongconnectTimeoutprotected booleanfollowRedirectsprotected java.net.http.HttpClienthttpClientprotected intmaxBinaryLogLengthprotected intmaxConnectionPoolprotected AbstractClientAPIHandler.ProxySpecproxyprotected javax.net.ssl.SSLContextsslContextprotected javax.net.ssl.SSLParameterssslParameters
-
Constructor Summary
Constructors Constructor Description Conf()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AbstractClientAPIHandlerbuild()java.lang.BooleangetAcceptAllCerts()java.lang.LonggetConnectTimeout()java.net.http.HttpClientgetHttpClient()intgetMaxBinaryLogLength()intgetMaxConnectionPool()javax.net.ssl.SSLContextgetSslContext()javax.net.ssl.SSLParametersgetSslParameters()booleanisFollowRedirects()TsetAcceptAllCerts(java.lang.Boolean acceptAllCerts)Skip SSL certificate verification.TsetConnectTimeout(java.lang.Long connectTimeout)TsetFollowRedirects(boolean followRedirects)TsetHttpClient(java.net.http.HttpClient httpClient)Instance of an externally configured http client.TsetMaxBinaryLogLength(int maxBinaryLogLength)Maximum size to log binary data in logfiles.TsetMaxConnectionPool(int maxConnectionPool)Set the maximum of open connections for this HttpClient (This sets the fixedThreadPool for the Executor of the HttpClient).TsetProxy(AbstractClientAPIHandler.ProxySpec proxy)TsetSslContext(javax.net.ssl.SSLContext sslContext)TsetSslParameters(javax.net.ssl.SSLParameters sslParameters)-
Methods inherited from class co.arago.hiro.client.connection.AbstractAPIHandler.Conf
getApiUrl, getHttpRequestTimeout, getMaxRetries, getUserAgent, getWebSocketUri, self, setApiUrl, setApiUrl, setHttpRequestTimeout, setMaxRetries, setUserAgent, setWebSocketUri, setWebSocketUrl
-
-
-
-
Field Detail
-
proxy
protected AbstractClientAPIHandler.ProxySpec proxy
-
followRedirects
protected boolean followRedirects
-
acceptAllCerts
protected java.lang.Boolean acceptAllCerts
-
connectTimeout
protected java.lang.Long connectTimeout
-
sslParameters
protected javax.net.ssl.SSLParameters sslParameters
-
httpClient
protected java.net.http.HttpClient httpClient
-
sslContext
protected javax.net.ssl.SSLContext sslContext
-
maxConnectionPool
protected int maxConnectionPool
-
maxBinaryLogLength
protected int maxBinaryLogLength
-
-
Method Detail
-
setProxy
public T setProxy(AbstractClientAPIHandler.ProxySpec proxy)
- Parameters:
proxy- Simple proxy with one address and port- Returns:
AbstractAPIHandler.Conf.self()
-
isFollowRedirects
public boolean isFollowRedirects()
-
setFollowRedirects
public T setFollowRedirects(boolean followRedirects)
- Parameters:
followRedirects- Enable Redirect.NORMAL. Default is true.- Returns:
AbstractAPIHandler.Conf.self()
-
getConnectTimeout
public java.lang.Long getConnectTimeout()
-
setConnectTimeout
public T setConnectTimeout(java.lang.Long connectTimeout)
- Parameters:
connectTimeout- Connect timeout in milliseconds.- Returns:
AbstractAPIHandler.Conf.self()
-
getAcceptAllCerts
public java.lang.Boolean getAcceptAllCerts()
-
setAcceptAllCerts
public T setAcceptAllCerts(java.lang.Boolean acceptAllCerts)
Skip SSL certificate verification. Leave this unset to use the default in HttpClient. Setting this to true installs a permissive SSLContext, setting it to false removes the SSLContext to use the default.- Parameters:
acceptAllCerts- the toggle- Returns:
AbstractAPIHandler.Conf.self()
-
getSslContext
public javax.net.ssl.SSLContext getSslContext()
-
setSslContext
public T setSslContext(javax.net.ssl.SSLContext sslContext)
- Parameters:
sslContext- The specific SSLContext to use.- Returns:
AbstractAPIHandler.Conf.self()- See Also:
setAcceptAllCerts(Boolean)
-
getSslParameters
public javax.net.ssl.SSLParameters getSslParameters()
-
setSslParameters
public T setSslParameters(javax.net.ssl.SSLParameters sslParameters)
- Parameters:
sslParameters- The specific SSLParameters to use.- Returns:
AbstractAPIHandler.Conf.self()
-
getHttpClient
public java.net.http.HttpClient getHttpClient()
-
setHttpClient
public T setHttpClient(java.net.http.HttpClient httpClient)
Instance of an externally configured http client. An internal HttpClient will be built with parameters given by this Builder if this is not set.- Parameters:
httpClient- Instance of an HttpClient.- Returns:
AbstractAPIHandler.Conf.self()
-
getMaxConnectionPool
public int getMaxConnectionPool()
-
setMaxConnectionPool
public T setMaxConnectionPool(int maxConnectionPool)
Set the maximum of open connections for this HttpClient (This sets the fixedThreadPool for the Executor of the HttpClient).- Parameters:
maxConnectionPool- Maximum size of the pool. Default is 8.- Returns:
AbstractAPIHandler.Conf.self()
-
getMaxBinaryLogLength
public int getMaxBinaryLogLength()
-
setMaxBinaryLogLength
public T setMaxBinaryLogLength(int maxBinaryLogLength)
Maximum size to log binary data in logfiles. Default is 1024.- Parameters:
maxBinaryLogLength- Size in bytes- Returns:
AbstractAPIHandler.Conf.self()
-
build
public abstract AbstractClientAPIHandler build()
- Specified by:
buildin classAbstractAPIHandler.Conf<T extends AbstractClientAPIHandler.Conf<T>>
-
-