public class GiniCaptureDefaultNetworkService extends java.lang.Object implements GiniCaptureNetworkService
Relies on the Gini Pay API lib for executing the requests, which implements communication with the Gini API using generated anonymous Gini users.
Important: Access to the Gini User Center API is required which is restricted to selected clients only. Contact Gini if you require access.
To create an instance use the GiniCaptureDefaultNetworkService.Builder
returned by the
GiniCaptureDefaultNetworkService.builder(Context)
method.
In order for the Gini Capture SDK to use this implementation pass an instance of it to
GiniCapture.Builder#setGiniCaptureNetworkService(GiniCaptureNetworkService)
when creating a
GiniCapture
instance.
Modifier and Type | Class and Description |
---|---|
static class |
GiniCaptureDefaultNetworkService.Builder
Builder for configuring a new instance of the
GiniCaptureDefaultNetworkService . |
Modifier and Type | Method and Description |
---|---|
CancellationToken |
analyze(java.util.LinkedHashMap giniApiDocumentIdRotationMap,
GiniCaptureNetworkCallback callback)
Called when a document needs to be analyzed by the Gini API.
|
static GiniCaptureDefaultNetworkService.Builder |
builder(Context context)
Creates a new
GiniCaptureDefaultNetworkService.Builder to configure and create a new
instance. |
void |
cleanup()
Called when the Gini Capture SDK is not needed anymore and the
GiniCapture#cleanup(Context) method has been called. |
CancellationToken |
delete(java.lang.String giniApiDocumentId,
GiniCaptureNetworkCallback callback)
Called when a document needs to be deleted from the Gini API.
|
void |
handleErrorLog(ErrorLog errorLog) |
CancellationToken |
upload(Document document,
GiniCaptureNetworkCallback callback)
Called when a document needs to be uploaded to the Gini API.
|
public static GiniCaptureDefaultNetworkService.Builder builder(Context context)
GiniCaptureDefaultNetworkService.Builder
to configure and create a new
instance.context
- Android contextGiniCaptureDefaultNetworkService.Builder
public CancellationToken upload(Document document, GiniCaptureNetworkCallback callback)
GiniCaptureNetworkService
You should only upload the document. Polling or retrieving extractions is not needed at this point.
upload
in interface GiniCaptureNetworkService
document
- a Document
containing an image, pdf or other supported formatscallback
- a callback implementation to return the outcome of the uploadCancellationToken
to be used for requesting upload cancellationpublic CancellationToken delete(java.lang.String giniApiDocumentId, GiniCaptureNetworkCallback callback)
GiniCaptureNetworkService
delete
in interface GiniCaptureNetworkService
giniApiDocumentId
- id of the document received when it was uploaded to the Gini APIcallback
- a callback implementation to return the outcome of the deletionCancellationToken
to be used for requesting cancellation of the deletionpublic CancellationToken analyze(java.util.LinkedHashMap giniApiDocumentIdRotationMap, GiniCaptureNetworkCallback callback)
GiniCaptureNetworkService
The documents were already uploaded and only the Gini API document ids of documents are passed in along with the user applied document rotations.
analyze
in interface GiniCaptureNetworkService
giniApiDocumentIdRotationMap
- a map of Gini API document ids and the user applied
document rotationscallback
- a callback implementation to return the outcome of the
analysisCancellationToken
to be used for requesting analysis cancellationpublic void handleErrorLog(ErrorLog errorLog)
handleErrorLog
in interface GiniCaptureNetworkService
public void cleanup()
GiniCaptureNetworkService
GiniCapture#cleanup(Context)
method has been called.
Free up any resources your implementation is using.
cleanup
in interface GiniCaptureNetworkService