public interface Scan extends Refreshable<Scan>
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Scan.Definition
Builder for defining a new scan.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<Scan> |
await(java.util.concurrent.ScheduledExecutorService scheduler) |
java.lang.String |
errorMessage() |
java.lang.String |
id() |
boolean |
isFinished() |
java.lang.String |
organizationId() |
java.lang.String |
projectId() |
java.io.InputStream |
sarif()
Retrieves a scan's results in SARIF.
|
void |
saveSarif(java.nio.file.Path file)
Retrieves and saves the scan's results (in SARIF) to the specified file.
|
ScanStatus |
status() |
ScanSummary |
summary()
Retrieves a summary of the scan results.
|
refreshjava.lang.String id()
java.lang.String projectId()
java.lang.String organizationId()
ScanStatus status()
java.lang.String errorMessage()
null if the scan has not failedboolean isFinished()
java.util.concurrent.CompletionStage<Scan> await(java.util.concurrent.ScheduledExecutorService scheduler)
scheduler - for scheduling requests when polling for the latest scan resourceCompletionStage that resolves successfully with a Scan record when the
scan has completed, or resolves exceptionally with a ScanException when the scan
has failed or there was a problem communicating with the Contrast Scan API.java.io.InputStream sarif()
throws java.io.IOException
InputStream for reading the SARIF file. The caller is expected to close the
InputStreamjava.lang.IllegalStateException - when called on a scan that is not yet finishedjava.io.IOException - when an IO error occurs while making the request to the Contrast APIUnauthorizedException - when Contrast rejects the credentials used to send the requestResourceNotFoundException - when the requested resource does not existHttpResponseException - when Contrast rejects this request with an error codeServerResponseException - when Contrast API returns a response that cannot be understoodvoid saveSarif(java.nio.file.Path file)
throws java.io.IOException
file - the file to which to save the resultsjava.lang.IllegalStateException - when called on a scan that is not yet finishedjava.io.IOException - when an IO error occurs while making the request to the Contrast APIUnauthorizedException - when Contrast rejects the credentials used to send the requestResourceNotFoundException - when the requested resource does not existHttpResponseException - when Contrast rejects this request with an error codeServerResponseException - when Contrast API returns a response that cannot be understoodScanSummary summary() throws java.io.IOException
CompletionStage that completes successfully when the scan has completed and the
summary has been retrievedjava.lang.IllegalStateException - when called on a scan that is not yet finishedjava.io.IOException - when an IO error occurs while making the request to the Contrast APIUnauthorizedException - when Contrast rejects the credentials used to send the requestResourceNotFoundException - when the requested resource does not existHttpResponseException - when Contrast rejects this request with an error codeServerResponseException - when Contrast API returns a response that cannot be understoodCopyright © 2021 Contrast Security, Inc.. All rights reserved.