-
- All Implemented Interfaces:
public final class GiniCaptureDefaultNetworkService.BuilderBuilder for configuring a new instance of the GiniCaptureDefaultNetworkService.
-
-
Method Summary
Modifier and Type Method Description final GiniCaptureDefaultNetworkServicebuild()Create a new instance of the GiniCaptureDefaultNetworkService. final GiniCaptureDefaultNetworkService.BuildersetClientCredentials(String clientId, String clientSecret, String emailDomain)Set your Gini API client ID and secret. final GiniCaptureDefaultNetworkService.BuildersetSessionManager(SessionManager sessionManager)Set a custom SessionManager implementation for handling sessions. final GiniCaptureDefaultNetworkService.BuildersetBaseUrl(String baseUrl)Set the base URL of the Gini API. final GiniCaptureDefaultNetworkService.BuildersetUserCenterBaseUrl(String userCenterBaseUrl)Set the base URL of the Gini User Center API. final GiniCaptureDefaultNetworkService.BuildersetCache(Cache cache)Set the cache implementation to use with Volley. final GiniCaptureDefaultNetworkService.BuildersetCredentialsStore(CredentialsStore credentialsStore)Set the credentials store which is used by the Gini Bank API lib to store user credentials. final GiniCaptureDefaultNetworkService.BuildersetNetworkSecurityConfigResId(@XmlRes() Integer networkSecurityConfigResId)Set the resource id for the network security configuration xml to enable public key pinning. final GiniCaptureDefaultNetworkService.BuildersetConnectionTimeout(Long connectionTimeout)Set the (initial) timeout for each request. final GiniCaptureDefaultNetworkService.BuildersetConnectionTimeoutUnit(TimeUnit connectionTimeoutUnit)Set the connection timeout's time unit. final GiniCaptureDefaultNetworkService.BuildersetDocumentMetadata(DocumentMetadata documentMetadata)Set additional information related to the documents. final GiniCaptureDefaultNetworkService.BuildersetTrustManager(TrustManager trustManager)Set a custom TrustManager implementation to have full control over which certificates to trust. final GiniCaptureDefaultNetworkService.BuildersetDebuggingEnabled(Boolean enabled)Enable or disable debugging. -
-
Method Detail
-
build
final GiniCaptureDefaultNetworkService build()
Create a new instance of the GiniCaptureDefaultNetworkService.
-
setClientCredentials
final GiniCaptureDefaultNetworkService.Builder setClientCredentials(String clientId, String clientSecret, String emailDomain)
Set your Gini API client ID and secret. The email domain is used when generating anonymous Gini users in the form of
UUID@your-email-domain.- Parameters:
clientId- your application's client ID for the Gini APIclientSecret- your application's client secret for the Gini APIemailDomain- the email domain which is used for created Gini users
-
setSessionManager
final GiniCaptureDefaultNetworkService.Builder setSessionManager(SessionManager sessionManager)
Set a custom SessionManager implementation for handling sessions.
- Parameters:
sessionManager- the SessionManager to use
-
setBaseUrl
final GiniCaptureDefaultNetworkService.Builder setBaseUrl(String baseUrl)
Set the base URL of the Gini API.
- Parameters:
baseUrl- custom Gini API base URL
-
setUserCenterBaseUrl
final GiniCaptureDefaultNetworkService.Builder setUserCenterBaseUrl(String userCenterBaseUrl)
Set the base URL of the Gini User Center API.
- Parameters:
userCenterBaseUrl- custom Gini API base URL
-
setCache
final GiniCaptureDefaultNetworkService.Builder 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.
-
setCredentialsStore
final GiniCaptureDefaultNetworkService.Builder setCredentialsStore(CredentialsStore credentialsStore)
Set the credentials store which is used by the Gini Bank API lib to store user credentials. If no credentials store is set, the SharedPreferencesCredentialsStore from the Gini API SDK is used by default.
- Parameters:
credentialsStore- a credentials store instance (specified by the CredentialsStore interface)
-
setNetworkSecurityConfigResId
final GiniCaptureDefaultNetworkService.Builder setNetworkSecurityConfigResId(@XmlRes() Integer networkSecurityConfigResId)
Set the resource id for the network security configuration xml to enable public key pinning.
- Parameters:
networkSecurityConfigResId- xml resource id
-
setConnectionTimeout
final GiniCaptureDefaultNetworkService.Builder setConnectionTimeout(Long connectionTimeout)
Set 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 backoff multiplier and failed retries.
- Parameters:
connectionTimeout- initial timeout
-
setConnectionTimeoutUnit
final GiniCaptureDefaultNetworkService.Builder setConnectionTimeoutUnit(TimeUnit connectionTimeoutUnit)
Set the connection timeout's time unit.
- Parameters:
connectionTimeoutUnit- the time unit
-
setDocumentMetadata
final GiniCaptureDefaultNetworkService.Builder setDocumentMetadata(DocumentMetadata documentMetadata)
Set additional information related to the documents. This metadata will be passed to all document uploads.
- Parameters:
documentMetadata- a DocumentMetadata instance containing additional information for the uploaded documents
-
setTrustManager
final GiniCaptureDefaultNetworkService.Builder 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 GiniCaptureDefaultNetworkService.Builder 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
-
-
-
-