public class GiniVisionDefaultNetworkService extends java.lang.Object implements GiniVisionNetworkService
Relies on the Gini API SDK 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 GiniVisionDefaultNetworkService.Builder
returned by the
GiniVisionDefaultNetworkService.builder(Context)
method.
In order for the Gini Vision Library to use this implementation pass an instance of it to
GiniVision.Builder#setGiniVisionNetworkService(GiniVisionNetworkService)
when creating a
GiniVision
instance.
Modifier and Type | Class and Description |
---|---|
static class |
GiniVisionDefaultNetworkService.Builder
Builder for configuring a new instance of the
GiniVisionDefaultNetworkService . |
Modifier and Type | Method and Description |
---|---|
CancellationToken |
analyze(java.util.LinkedHashMap giniApiDocumentIdRotationMap,
GiniVisionNetworkCallback callback)
Called when a document needs to be analyzed by the Gini API.
|
static GiniVisionDefaultNetworkService.Builder |
builder(Context context)
Creates a new
GiniVisionDefaultNetworkService.Builder to configure and create a new
instance. |
void |
cleanup()
Called when the Gini Vision Library is not needed anymore and the
GiniVision#cleanup(Context) method has been called. |
CancellationToken |
delete(java.lang.String giniApiDocumentId,
GiniVisionNetworkCallback callback)
Called when a document needs to be deleted from the Gini API.
|
CancellationToken |
upload(Document document,
GiniVisionNetworkCallback callback)
Called when a document needs to be uploaded to the Gini API.
|
public static GiniVisionDefaultNetworkService.Builder builder(Context context)
GiniVisionDefaultNetworkService.Builder
to configure and create a new
instance.context
- Android contextGiniVisionDefaultNetworkService.Builder
public CancellationToken upload(Document document, GiniVisionNetworkCallback callback)
GiniVisionNetworkService
You should only upload the document. Polling or retrieving extractions is not needed at this point.
upload
in interface GiniVisionNetworkService
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, GiniVisionNetworkCallback callback)
GiniVisionNetworkService
delete
in interface GiniVisionNetworkService
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, GiniVisionNetworkCallback callback)
GiniVisionNetworkService
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 GiniVisionNetworkService
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 cleanup()
GiniVisionNetworkService
GiniVision#cleanup(Context)
method has been called.
Free up any resources your implementation is using.
cleanup
in interface GiniVisionNetworkService