Package co.featbit.server.exterior
Class HttpConfigurationBuilder
java.lang.Object
co.featbit.server.exterior.HttpConfigurationBuilder
- All Implemented Interfaces:
HttpConfigFactory
Contains methods for configuring the SDK's networking behavior.
If you want to set non-default values, create a builder with Factory.httpConfigFactory(),
change its properties with the methods of this class and pass it to FBConfig.Builder.httpConfigFactory(HttpConfigFactory):
FBConfig config = new FBConfig.Builder()
.httpConfigFactory(Factory.httpConfigFactory()
.connectTime(Duration.ofMillis(3000))
.httpProxy("my-proxy", 9000))
.build();
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected okhttp3.Authenticatorprotected Durationprotected final Durationprotected final Durationprotected Proxyprotected SocketFactoryprotected Durationprotected SSLSocketFactoryprotected X509TrustManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticator(okhttp3.Authenticator authenticator) Sets a user implementation authentication strategy for use with a proxy.connectTime(Duration duration) Sets the connection timeout.Sets an HTTP proxy for making connections to feature flag centerpasswordAuthenticator(String userName, String password) Sets a basic authentication strategy for use with an HTTP proxy.Sets a user implementation proxy for making connections to feature flag centersocketFactory(SocketFactory factory) Specifies a custom socket configuration for HTTP connections to feature flag centersocketTime(Duration duration) Sets the read and write timeout.sslSocketFactory(SSLSocketFactory factory, X509TrustManager trustManager) Specifies a custom security configuration for HTTPS connections to feature flag centerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface co.featbit.server.exterior.HttpConfigFactory
createHttpConfig
-
Field Details
-
DEFAULT_CONN_TIME
-
DEFAULT_SOCK_TIME
-
connectTime
-
socketTime
-
proxy
-
authenticator
protected okhttp3.Authenticator authenticator -
socketFactory
-
sslSocketFactory
-
x509TrustManager
-
-
Constructor Details
-
HttpConfigurationBuilder
public HttpConfigurationBuilder()
-
-
Method Details
-
connectTime
Sets the connection timeout. This is the time allowed for the SDK to make a socket connection to any of API. The default value is 10s- Parameters:
duration- the connection timeout; null to use the default- Returns:
- the builder
-
socketTime
Sets the read and write timeout. This is the time allowed for the SDK to read/write any of API. The default value is 15s- Parameters:
duration- the read/write timeout; null to use the default- Returns:
- the builder
-
httpProxy
Sets an HTTP proxy for making connections to feature flag center- Parameters:
proxyHost- the proxy hostnameproxyPort- the proxy port- Returns:
- the builder
-
proxy
Sets a user implementation proxy for making connections to feature flag center- Parameters:
proxy- the proxy- Returns:
- the builder
-
passwordAuthenticator
Sets a basic authentication strategy for use with an HTTP proxy. This has no effect unless a proxy was specified- Parameters:
userName- a stringpassword- a string- Returns:
- the builder
-
authenticator
Sets a user implementation authentication strategy for use with a proxy. This has no effect unless a proxy was specified- Parameters:
authenticator- theAuthenticator- Returns:
- the builder
-
socketFactory
Specifies a custom socket configuration for HTTP connections to feature flag center- Parameters:
factory- the socket factory- Returns:
- the builder
-
sslSocketFactory
public HttpConfigurationBuilder sslSocketFactory(SSLSocketFactory factory, X509TrustManager trustManager) Specifies a custom security configuration for HTTPS connections to feature flag center- Parameters:
factory- the SSL socket factorytrustManager- the trust manager- Returns:
- the builder
-