Package com.hiddenlayer.api.lib
Class ScanUtilsKt
-
- All Implemented Interfaces:
public final class ScanUtilsKt
-
-
Method Summary
Modifier and Type Method Description final static ScanReportgetScanResults(HiddenLayerClient client, String scanId)Get scan results with retry logic for 404 errors. final static ScanReportwaitForScanResults(HiddenLayerClient client, String scanId)Wait for scan results using exponential backoff polling. final static CompletableFuture<ScanReport>getScanResultsAsync(HiddenLayerClientAsync client, String scanId, ScheduledExecutorService executor)Async version of getScanResults with retry logic for 404 errors. final static CompletableFuture<ScanReport>waitForScanResultsAsync(HiddenLayerClientAsync client, String scanId, ScheduledExecutorService executor)Async version of waitForScanResults. -
-
Method Detail
-
getScanResults
final static ScanReport getScanResults(HiddenLayerClient client, String scanId)
Get scan results with retry logic for 404 errors.
Used when waitForResults=false to handle initial scan availability.
- Parameters:
client- The HiddenLayer client instancescanId- The ID of the scan to retrieve- Returns:
The scan report
-
waitForScanResults
final static ScanReport waitForScanResults(HiddenLayerClient client, String scanId)
Wait for scan results using exponential backoff polling.
Handles initial 404 errors when scan is not immediately available.
- Parameters:
client- The HiddenLayer client instancescanId- The ID of the scan to wait for- Returns:
The completed scan report
-
getScanResultsAsync
final static CompletableFuture<ScanReport> getScanResultsAsync(HiddenLayerClientAsync client, String scanId, ScheduledExecutorService executor)
Async version of getScanResults with retry logic for 404 errors.
Used when waitForResults=false to handle initial scan availability.
- Parameters:
client- The async HiddenLayer client instancescanId- The ID of the scan to retrieveexecutor- The executor to use for scheduling retries- Returns:
A CompletableFuture containing the scan report
-
waitForScanResultsAsync
final static CompletableFuture<ScanReport> waitForScanResultsAsync(HiddenLayerClientAsync client, String scanId, ScheduledExecutorService executor)
Async version of waitForScanResults.
Handles initial 404 errors when scan is not immediately available.
- Parameters:
client- The async HiddenLayer client instancescanId- The ID of the scan to wait forexecutor- The executor to use for scheduling retries- Returns:
A CompletableFuture containing the completed scan report
-
-
-
-