Search in sources :

Example 1 with BlackDuckBomDetectResult

use of com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult in project synopsys-detect by blackducksoftware.

the class DetectStatusLoggerTest method createResults.

private List<DetectResult> createResults() {
    ArrayList<DetectResult> detectResults = new ArrayList<>();
    DetectResult result = new BlackDuckBomDetectResult("https://example.com/api/projects/project_1");
    detectResults.add(result);
    result = new BlackDuckBomDetectResult("https://example.com/api/projects/project_2");
    detectResults.add(result);
    result = new AirGapDetectResult("./air_gap/directory");
    detectResults.add(result);
    result = new ReportDetectResult("report_1", "./report/1/report_file");
    detectResults.add(result);
    return detectResults;
}
Also used : AirGapDetectResult(com.synopsys.integration.detect.workflow.result.AirGapDetectResult) ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) ArrayList(java.util.ArrayList) BlackDuckBomDetectResult(com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult) AirGapDetectResult(com.synopsys.integration.detect.workflow.result.AirGapDetectResult) DetectResult(com.synopsys.integration.detect.workflow.result.DetectResult) ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) BlackDuckBomDetectResult(com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult)

Example 2 with BlackDuckBomDetectResult

use of com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult in project synopsys-detect by blackducksoftware.

the class IntelligentModeStepRunner method publishPostResults.

private void publishPostResults(BdioResult bdioResult, ProjectVersionWrapper projectVersionWrapper, DetectToolFilter detectToolFilter) {
    if ((!bdioResult.getUploadTargets().isEmpty() || detectToolFilter.shouldInclude(DetectTool.SIGNATURE_SCAN))) {
        Optional<String> componentsLink = Optional.ofNullable(projectVersionWrapper).map(ProjectVersionWrapper::getProjectVersionView).flatMap(projectVersionView -> projectVersionView.getFirstLinkSafely(ProjectVersionView.COMPONENTS_LINK)).map(HttpUrl::string);
        if (componentsLink.isPresent()) {
            DetectResult detectResult = new BlackDuckBomDetectResult(componentsLink.get());
            operationFactory.publishResult(detectResult);
        }
    }
}
Also used : BlackDuckRunData(com.synopsys.integration.detect.lifecycle.run.data.BlackDuckRunData) OperationFactory(com.synopsys.integration.detect.lifecycle.run.operation.OperationFactory) ImpactAnalysisBatchOutput(com.synopsys.integration.detect.tool.impactanalysis.service.ImpactAnalysisBatchOutput) LoggerFactory(org.slf4j.LoggerFactory) DetectToolFilter(com.synopsys.integration.detect.util.filter.DetectToolFilter) BdioResult(com.synopsys.integration.detect.workflow.bdio.BdioResult) ReportConstants(com.synopsys.integration.detect.workflow.report.util.ReportConstants) DockerTargetData(com.synopsys.integration.detect.lifecycle.run.data.DockerTargetData) HttpUrl(com.synopsys.integration.rest.HttpUrl) HashSet(java.util.HashSet) StepHelper(com.synopsys.integration.detect.lifecycle.run.step.utility.StepHelper) NameVersion(com.synopsys.integration.util.NameVersion) SignatureScannerCodeLocationResult(com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerCodeLocationResult) BlackDuckServicesFactory(com.synopsys.integration.blackduck.service.BlackDuckServicesFactory) BlackDuckBomDetectResult(com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult) OperationType(com.synopsys.integration.detect.workflow.status.OperationType) Path(java.nio.file.Path) Logger(org.slf4j.Logger) DetectResult(com.synopsys.integration.detect.workflow.result.DetectResult) Set(java.util.Set) IOException(java.io.IOException) CodeLocationResults(com.synopsys.integration.detect.workflow.blackduck.codelocation.CodeLocationResults) ProjectVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView) BdioUploadResult(com.synopsys.integration.detect.lifecycle.run.operation.blackduck.BdioUploadResult) ProjectVersionWrapper(com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper) CodeLocationAccumulator(com.synopsys.integration.detect.workflow.blackduck.codelocation.CodeLocationAccumulator) File(java.io.File) DetectTool(com.synopsys.integration.detect.configuration.enumeration.DetectTool) ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) CodeLocationWaitData(com.synopsys.integration.detect.workflow.blackduck.codelocation.CodeLocationWaitData) CodeLocationCreationData(com.synopsys.integration.blackduck.codelocation.CodeLocationCreationData) Optional(java.util.Optional) OperationException(com.synopsys.integration.detect.lifecycle.OperationException) BlackDuckBomDetectResult(com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult) BlackDuckBomDetectResult(com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult) DetectResult(com.synopsys.integration.detect.workflow.result.DetectResult) ReportDetectResult(com.synopsys.integration.detect.workflow.result.ReportDetectResult) ProjectVersionWrapper(com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper) HttpUrl(com.synopsys.integration.rest.HttpUrl)

Aggregations

BlackDuckBomDetectResult (com.synopsys.integration.detect.workflow.result.BlackDuckBomDetectResult)2 DetectResult (com.synopsys.integration.detect.workflow.result.DetectResult)2 ReportDetectResult (com.synopsys.integration.detect.workflow.result.ReportDetectResult)2 ProjectVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionView)1 CodeLocationCreationData (com.synopsys.integration.blackduck.codelocation.CodeLocationCreationData)1 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)1 ProjectVersionWrapper (com.synopsys.integration.blackduck.service.model.ProjectVersionWrapper)1 DetectTool (com.synopsys.integration.detect.configuration.enumeration.DetectTool)1 OperationException (com.synopsys.integration.detect.lifecycle.OperationException)1 BlackDuckRunData (com.synopsys.integration.detect.lifecycle.run.data.BlackDuckRunData)1 DockerTargetData (com.synopsys.integration.detect.lifecycle.run.data.DockerTargetData)1 OperationFactory (com.synopsys.integration.detect.lifecycle.run.operation.OperationFactory)1 BdioUploadResult (com.synopsys.integration.detect.lifecycle.run.operation.blackduck.BdioUploadResult)1 StepHelper (com.synopsys.integration.detect.lifecycle.run.step.utility.StepHelper)1 ImpactAnalysisBatchOutput (com.synopsys.integration.detect.tool.impactanalysis.service.ImpactAnalysisBatchOutput)1 SignatureScannerCodeLocationResult (com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerCodeLocationResult)1 DetectToolFilter (com.synopsys.integration.detect.util.filter.DetectToolFilter)1 BdioResult (com.synopsys.integration.detect.workflow.bdio.BdioResult)1 CodeLocationAccumulator (com.synopsys.integration.detect.workflow.blackduck.codelocation.CodeLocationAccumulator)1 CodeLocationResults (com.synopsys.integration.detect.workflow.blackduck.codelocation.CodeLocationResults)1