-
- All Implemented Interfaces:
public abstract class GiniCoreAPIBuilder<DM extends DocumentManager<DR, E>, G extends GiniCoreAPI<DM, DR, E>, DR extends DocumentRepository<E>, E extends ExtractionsContainer>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classGiniCoreAPIBuilder.Companion
-
Constructor Summary
Constructors Constructor Description GiniCoreAPIBuilder(Context context, String clientId, String clientSecret, String emailDomain, SessionManager sessionManager)
-
Method Summary
Modifier and Type Method Description GiniCoreAPIBuilder<DM, G, DR, E>setNetworkSecurityConfigResId(@XmlRes() Integer networkSecurityConfigResId)Set the resource id for the network security configuration xml to enable public key pinning. GiniCoreAPIBuilder<DM, G, DR, E>setApiBaseUrl(String newUrl)Set the base URL of the Gini API. GiniCoreAPIBuilder<DM, G, DR, E>setUserCenterApiBaseUrl(String newUrl)Set the base URL of the Gini User Center API. abstract GiniApiTypegetGiniApiType()GiniCoreAPIBuilder<DM, G, DR, E>setConnectionTimeoutInMs(Integer connectionTimeoutInMs)Sets the (initial) timeout for each request. GiniCoreAPIBuilder<DM, G, DR, E>setCredentialsStore(CredentialsStore credentialsStore)Set the credentials store which is used by the library to store user credentials. GiniCoreAPIBuilder<DM, G, DR, E>setCache(Cache cache)Set the cache implementation to use with Volley. GiniCoreAPIBuilder<DM, G, DR, E>setTrustManager(TrustManager trustManager)Set a custom TrustManager implementation to have full control over which certificates to trust. final GiniCoreAPIBuilder<DM, G, DR, E>setDebuggingEnabled(Boolean enabled)Enable or disable debugging. abstract Gbuild()Builds an instance with the configuration settings of the builder instance. SessionManagergetSessionManager()Return the SessionManager set via #setSessionManager. -
-
Constructor Detail
-
GiniCoreAPIBuilder
GiniCoreAPIBuilder(Context context, String clientId, String clientSecret, String emailDomain, SessionManager sessionManager)
-
-
Method Detail
-
setNetworkSecurityConfigResId
GiniCoreAPIBuilder<DM, G, DR, E> setNetworkSecurityConfigResId(@XmlRes() Integer networkSecurityConfigResId)
Set the resource id for the network security configuration xml to enable public key pinning.
- Parameters:
networkSecurityConfigResId- xml resource id
-
setApiBaseUrl
GiniCoreAPIBuilder<DM, G, DR, E> setApiBaseUrl(String newUrl)
Set the base URL of the Gini API. Handy for tests. Usually, you do not use this method.
- Parameters:
newUrl- The URL of the Gini API which is used by the requests of the library.
-
setUserCenterApiBaseUrl
GiniCoreAPIBuilder<DM, G, DR, E> setUserCenterApiBaseUrl(String newUrl)
Set the base URL of the Gini User Center API. Handy for tests. Usually, you do not use this method.
- Parameters:
newUrl- The URL of the Gini User Center API which is used by the requests of the library.
-
getGiniApiType
abstract GiniApiType getGiniApiType()
-
setConnectionTimeoutInMs
GiniCoreAPIBuilder<DM, G, DR, E> setConnectionTimeoutInMs(Integer connectionTimeoutInMs)
Sets the (initial) timeout for each request. A timeout error will occur if nothing is received from the underlying socket in the given time span. The initial timeout will be altered depending on the #backoffMultiplier and failed retries.
- Parameters:
connectionTimeoutInMs- initial timeout
-
setCredentialsStore
GiniCoreAPIBuilder<DM, G, DR, E> setCredentialsStore(CredentialsStore credentialsStore)
Set the credentials store which is used by the library to store user credentials. If no credentials store is set, the net.gini.android.core.api.authorization.SharedPreferencesCredentialsStore is used by default.
- Parameters:
credentialsStore- A credentials store instance (specified by the CredentialsStore interface).
-
setCache
GiniCoreAPIBuilder<DM, G, DR, E> setCache(Cache cache)
Set the cache implementation to use with Volley. If no cache is set, the default Volley cache will be used.
- Parameters:
cache- A cache instance (specified by the com.android.volley.Cache interface).
-
setTrustManager
GiniCoreAPIBuilder<DM, G, DR, E> setTrustManager(TrustManager trustManager)
Set a custom TrustManager implementation to have full control over which certificates to trust.
Please be aware that if you set a custom TrustManager implementation here than it will override any network security configuration you may have set.
- Parameters:
trustManager- A TrustManager implementation.
-
setDebuggingEnabled
final GiniCoreAPIBuilder<DM, G, DR, E> setDebuggingEnabled(Boolean enabled)
Enable or disable debugging.
Disabled by default.
When enabled all the requests and responses are logged.
WARNING: Make sure to disable debugging for release builds.
- Parameters:
enabled- passtrueto enable andfalseto disable debugging
-
build
abstract G build()
Builds an instance with the configuration settings of the builder instance.
-
getSessionManager
@Synchronized() SessionManager getSessionManager()
Return the SessionManager set via #setSessionManager. If no SessionManager has been set, default to AnonymousSessionManager.
-
-
-
-