public class Oak9ApiClient extends Object
| Constructor and Description |
|---|
Oak9ApiClient(String baseUrl,
String key,
String orgId,
String projectId,
TaskListener jenkinsTaskListener,
okhttp3.OkHttpClient httpClient)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
ApiResponse |
pollStatus(ValidationResult result)
Poll oak9 for validation status
|
ApiResponse |
pollStatus(ValidationResult result,
int attempts)
Poll oak9 for validation status
|
ValidationResult |
postFileValidation(String fileName,
ByteArrayOutputStream file)
post file for validation endpoint without providing a starting count of attempts
|
ValidationResult |
postFileValidation(String fileName,
ByteArrayOutputStream file,
int attempts)
post file for validation endpoint with a starting count of attempts
|
public Oak9ApiClient(String baseUrl, String key, String orgId, String projectId, TaskListener jenkinsTaskListener, okhttp3.OkHttpClient httpClient)
baseUrl - key - orgId - projectId - jenkinsTaskListener - public ValidationResult postFileValidation(String fileName, ByteArrayOutputStream file) throws IOException, InterruptedException
file - IOExceptionInterruptedExceptionpublic ValidationResult postFileValidation(String fileName, ByteArrayOutputStream file, int attempts) throws IOException, InterruptedException
file - the zip file to be postedattempts - current number of attemptsIOException - thrown if the file is invalid or the oak9 API request failsInterruptedExceptionpublic ApiResponse pollStatus(ValidationResult result) throws IOException
result - the scan for which we need to check the statusIOException - thrown if the oak9 api request failspublic ApiResponse pollStatus(ValidationResult result, int attempts) throws IOException
result - the scan for which we need to check the statusattempts - the number of attempts thus farIOException - thrown in the event of a communication failure with the oak9 APICopyright © 2016–2021. All rights reserved.