Package com.mindee.http
Class MindeeApiV2
- java.lang.Object
-
- com.mindee.http.MindeeApiCommon
-
- com.mindee.http.MindeeApiV2
-
- Direct Known Subclasses:
MindeeHttpApiV2
public abstract class MindeeApiV2 extends MindeeApiCommon
Defines required methods for an API.
-
-
Constructor Summary
Constructors Constructor Description MindeeApiV2()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected ProductInfogetParamsProductInfo(Class<? extends BaseParameters> responseClass)protected ProductInfogetResponseProductInfo(Class<? extends CommonResponse> responseClass)protected ErrorResponsemakeUnknownError(int statusCode)Creates an "unknown error" response from an HTTP status code.abstract JobResponsereqGetJob(String jobId)Attempts to poll the queue.abstract <TResponse extends CommonResponse>
TResponsereqGetResult(Class<TResponse> responseClass, String inferenceId)Retrieves the inference from a 302 redirect.abstract JobResponsereqPostEnqueue(LocalInputSource inputSource, BaseParameters options)Send a file to the prediction queue with a local file.abstract JobResponsereqPostEnqueue(URLInputSource inputSource, BaseParameters options)Send a file to the prediction queue with a remote file.-
Methods inherited from class com.mindee.http.MindeeApiCommon
getUserAgent, isInvalidStatusCode, readRawResponse
-
-
-
-
Method Detail
-
reqPostEnqueue
public abstract JobResponse reqPostEnqueue(LocalInputSource inputSource, BaseParameters options) throws IOException
Send a file to the prediction queue with a local file.- Parameters:
inputSource- Local input source from URL.options- parameters.- Throws:
IOException
-
reqPostEnqueue
public abstract JobResponse reqPostEnqueue(URLInputSource inputSource, BaseParameters options) throws IOException
Send a file to the prediction queue with a remote file.- Parameters:
inputSource- Remote input source from URL.options- parameters.- Throws:
IOException
-
reqGetJob
public abstract JobResponse reqGetJob(String jobId)
Attempts to poll the queue.- Parameters:
jobId- id of the job to get.
-
reqGetResult
public abstract <TResponse extends CommonResponse> TResponse reqGetResult(Class<TResponse> responseClass, String inferenceId)
Retrieves the inference from a 302 redirect.- Parameters:
inferenceId- ID of the inference to poll.
-
makeUnknownError
protected ErrorResponse makeUnknownError(int statusCode)
Creates an "unknown error" response from an HTTP status code.
-
getResponseProductInfo
protected ProductInfo getResponseProductInfo(Class<? extends CommonResponse> responseClass)
-
getParamsProductInfo
protected ProductInfo getParamsProductInfo(Class<? extends BaseParameters> responseClass)
-
-