use of com.blackducksoftware.integration.hub.api.view.ScanSummaryView in project hub-detect by blackducksoftware.
the class HubManager method waitForBomUpdate.
public void waitForBomUpdate(final HubService hubService, final ScanStatusService scanStatusService, final ProjectVersionView version) throws IntegrationException, InterruptedException {
final List<CodeLocationView> allCodeLocations = hubService.getAllResponses(version, ProjectVersionView.CODELOCATIONS_LINK_RESPONSE);
final List<ScanSummaryView> scanSummaryViews = new ArrayList<>();
for (final CodeLocationView codeLocationView : allCodeLocations) {
final String scansLink = hubService.getFirstLinkSafely(codeLocationView, CodeLocationView.SCANS_LINK);
if (StringUtils.isNotBlank(scansLink)) {
final List<ScanSummaryView> codeLocationScanSummaryViews = hubService.getResponses(scansLink, ScanSummaryView.class, true);
scanSummaryViews.addAll(codeLocationScanSummaryViews);
}
}
logger.info("Waiting for the BOM to be updated");
scanStatusService.assertScansFinished(scanSummaryViews);
logger.info("The BOM has been updated");
}
Aggregations