Package com.contentstack.sdk
Class Config
java.lang.Object
com.contentstack.sdk.Config
public class Config extends Object
The type Config. enables optional parameters while passing from stack
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfig.ContentstackRegionThe enum Contentstack region. -
Field Summary
Fields Modifier and Type Field Description protected Stringbranchprotected okhttp3.ConnectionPoolconnectionPoolprotected booleanenableLivePreviewprotected Stringendpointprotected Stringhostprotected StringlivePreviewContentTypeprotected StringlivePreviewHashprotected StringlivePreviewHostprotected StringmanagementTokenprotected Proxyproxyprotected Config.ContentstackRegionregionprotected Stringschemeprotected Stringversion -
Constructor Summary
Constructors Constructor Description Config() -
Method Summary
Modifier and Type Method Description okhttp3.ConnectionPoolconnectionPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit)Manages reuse of HTTP and HTTP/2 connections for reduced network latency.ConfigenableLivePreview(boolean enableLivePreview)Enable live preview config.StringgetBranch()protected StringgetEndpoint()StringgetHost()Gets host.ProxygetProxy()Returns the Proxy instanceConfig.ContentstackRegiongetRegion()Gets region.StringgetVersion()Gets version.voidsetBranch(String branch)protected StringsetEndpoint(String endpoint)voidsetHost(String hostName)Sets host.ConfigsetLivePreviewHost(String livePreviewHost)Sets live preview host.ConfigsetManagementToken(String managementToken)Sets management token.voidsetProxy(Proxy proxy)Proxy can be set like below.Config.ContentstackRegionsetRegion(Config.ContentstackRegion region)Sets region.
-
Field Details
-
livePreviewHash
-
livePreviewContentType
-
host
-
version
-
scheme
-
endpoint
-
enableLivePreview
protected boolean enableLivePreview -
livePreviewHost
-
region
-
managementToken
-
branch
-
proxy
-
connectionPool
protected okhttp3.ConnectionPool connectionPool
-
-
Constructor Details
-
Config
public Config()
-
-
Method Details
-
getBranch
-
setBranch
-
setProxy
Proxy can be set like below.- Parameters:
proxy- Proxy setting, typically a type (http, socks) and a socket address. A Proxy is an immutable object
Example:
java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", "proxyPort")); java.net.Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("sl.theproxyvpn.io", 80)); Config config = new Config(); config.setProxy(proxy);
-
getProxy
Returns the Proxy instance- Returns:
- Proxy
-
connectionPool
public okhttp3.ConnectionPool connectionPool(int maxIdleConnections, long keepAliveDuration, TimeUnit timeUnit)Manages reuse of HTTP and HTTP/2 connections for reduced network latency. HTTP requests that * share the sameAddressmay share aConnection. This class implements the policy * of which connections to keep open for future use.- Parameters:
maxIdleConnections- the maxIdleConnections default value is 5keepAliveDuration- the keepAliveDuration default value is 5timeUnit- the timeUnit default value is TimeUnit.MINUTES- Returns:
- ConnectionPool
-
getRegion
Gets region.- Returns:
- the region
-
setRegion
Sets region.- Parameters:
region- the region- Returns:
- the region
-
getEndpoint
-
setEndpoint
-
getHost
Gets host.- Returns:
- the host
-
setHost
Sets host.- Parameters:
hostName- the host name
-
getVersion
Gets version.- Returns:
- the version
-
enableLivePreview
Enable live preview config.- Parameters:
enableLivePreview- to enable live preview- Returns:
- the config
-
setLivePreviewHost
Sets live preview host.- Parameters:
livePreviewHost- the live preview host- Returns:
- the live preview host
-
setManagementToken
Sets management token.- Parameters:
managementToken- the management token- Returns:
- the management token
-