Search in sources :

Example 1 with ScanSummaryView

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");
}
Also used : CodeLocationView(com.blackducksoftware.integration.hub.api.generated.view.CodeLocationView) ArrayList(java.util.ArrayList) ScanSummaryView(com.blackducksoftware.integration.hub.api.view.ScanSummaryView)

Aggregations

CodeLocationView (com.blackducksoftware.integration.hub.api.generated.view.CodeLocationView)1 ScanSummaryView (com.blackducksoftware.integration.hub.api.view.ScanSummaryView)1 ArrayList (java.util.ArrayList)1