Modifier and Type | Method and Description |
---|---|
CDAClient |
build()
Create CDAClient, using the specified configuration options.
|
okhttp3.OkHttpClient.Builder |
defaultCallFactoryBuilder()
Returns the default Call.Factory.Builder used throughout this SDK.
|
CDAClient.Builder |
preview()
Sets the endpoint to point the Preview API.
|
CDAClient.Builder |
setApplication(java.lang.String name,
java.lang.String version)
Tell the client which application this is.
|
CDAClient.Builder |
setCallFactory(okhttp3.Call.Factory callFactory)
Sets a custom HTTP call factory.
|
CDAClient.Builder |
setEndpoint(java.lang.String endpoint)
Sets a custom endpoint.
|
CDAClient.Builder |
setEnvironment(java.lang.String environment)
Sets the environment ID.
|
CDAClient.Builder |
setIntegration(java.lang.String name,
java.lang.String version)
Set the name of the integration.
|
CDAClient.Builder |
setLogger(Logger logger)
Sets a custom logger.
|
CDAClient.Builder |
setLogLevel(Logger.Level logLevel)
Sets a custom logger level.
|
CDAClient.Builder |
setSpace(java.lang.String space)
Sets the space ID.
|
CDAClient.Builder |
setTls12Implementation(Tls12Implementation implementation)
Overwrite the recommendation from the SDK for using a custom TLS12 socket factory.
|
CDAClient.Builder |
setToken(java.lang.String token)
Sets the space access token.
|
public CDAClient.Builder setSpace(java.lang.String space)
space
- the space id to be set.public CDAClient.Builder setEnvironment(java.lang.String environment)
environment
- the space id to be set.public CDAClient.Builder setToken(java.lang.String token)
token
- the access token, sometimes called authorization token.public CDAClient.Builder setEndpoint(java.lang.String endpoint)
endpoint
- the url to be calling to (i.e. https://cdn.contentful.com).public CDAClient.Builder setLogLevel(Logger.Level logLevel)
If set to Logger.Level
.NONE any custom logger will get ignored.
logLevel
- the amount/level of logging to be used.public CDAClient.Builder setLogger(Logger logger)
logger
- the logger to be set.public CDAClient.Builder preview()
public CDAClient.Builder setCallFactory(okhttp3.Call.Factory callFactory)
callFactory
- the factory to be used to create a call.public okhttp3.OkHttpClient.Builder defaultCallFactoryBuilder()
Please use this method last in the building step, since changing settings as in the
token
or others afterwards will not be reflected by this factory.
This might be useful if you want to augment the default client, without needing to rely on replicating the current sdk behaviour.
Call.Factory
used through out SDK, as if no custom call factory was used.public CDAClient.Builder setTls12Implementation(Tls12Implementation implementation)
This SDK recommends a TLS12 socket factory to be used: Either the system one, or an SDK owned implementation. If this recommendation does not fit your needs, feel free to overwrite the recommendation here.
Some operation systems and frameworks, esp. Android and Java 1.6, might opt for implementing TLS12 (enforced by Contentful) but do not enable it. The SDK tries to find those situations and recommends to either use the system TLSSocketFactory or a SDK provided one.
implementation
- which implementation to be used.public CDAClient.Builder setApplication(java.lang.String name, java.lang.String version)
It might be used for internal tracking of Contentfuls tools.
name
- the name of the app.version
- the version in semver of the app.public CDAClient.Builder setIntegration(java.lang.String name, java.lang.String version)
This custom user agent header will be used for libraries build on top of this library.
name
- of the integration.version
- version of the integration.public CDAClient build()
Copyright © 2019 Contentful, GmbH.. All Rights Reserved.