Search in sources :

Example 1 with DetectorNameVersionDecider

use of com.blackducksoftware.integration.hub.detect.workflow.project.DetectorNameVersionDecider in project hub-detect by blackducksoftware.

the class DetectorTool method performDetectors.

public DetectorToolResult performDetectors(SearchOptions searchOptions, String projectBomTool) throws DetectUserFriendlyException {
    logger.info("Preparing to initialize detectors.");
    DetectorFactory detectorFactory = detectContext.getBean(DetectorFactory.class);
    EventSystem eventSystem = detectContext.getBean(EventSystem.class);
    logger.info("Building detector system.");
    DetectorSearchProvider detectorSearchProvider = new DetectorSearchProvider(detectorFactory);
    DetectorSearchEvaluator detectorSearchEvaluator = new DetectorSearchEvaluator();
    SearchManager searchManager = new SearchManager(searchOptions, detectorSearchProvider, detectorSearchEvaluator, eventSystem);
    PreparationManager preparationManager = new PreparationManager(eventSystem);
    ExtractionManager extractionManager = new ExtractionManager();
    DetectorManager detectorManager = new DetectorManager(searchManager, extractionManager, preparationManager, eventSystem);
    logger.info("Running detectors.");
    DetectorToolResult detectorToolResult = detectorManager.runDetectors();
    logger.info("Finished running detectors.");
    eventSystem.publishEvent(Event.DetectorsComplete, detectorToolResult);
    logger.info("Evaluating detectors for project info.");
    DetectorEvaluationNameVersionDecider detectorEvaluationNameVersionDecider = new DetectorEvaluationNameVersionDecider(new DetectorNameVersionDecider());
    Optional<NameVersion> bomToolNameVersion = detectorEvaluationNameVersionDecider.decideSuggestion(detectorToolResult.evaluatedDetectors, projectBomTool);
    detectorToolResult.bomToolProjectNameVersion = bomToolNameVersion;
    logger.info("Finished evaluating detectors for project info.");
    return detectorToolResult;
}
Also used : DetectorSearchEvaluator(com.blackducksoftware.integration.hub.detect.workflow.search.rules.DetectorSearchEvaluator) NameVersion(com.synopsys.integration.util.NameVersion) SearchManager(com.blackducksoftware.integration.hub.detect.workflow.search.SearchManager) ExtractionManager(com.blackducksoftware.integration.hub.detect.workflow.extraction.ExtractionManager) DetectorFactory(com.blackducksoftware.integration.hub.detect.detector.DetectorFactory) DetectorSearchProvider(com.blackducksoftware.integration.hub.detect.workflow.search.rules.DetectorSearchProvider) DetectorManager(com.blackducksoftware.integration.hub.detect.workflow.detector.DetectorManager) PreparationManager(com.blackducksoftware.integration.hub.detect.workflow.extraction.PreparationManager) DetectorEvaluationNameVersionDecider(com.blackducksoftware.integration.hub.detect.workflow.project.DetectorEvaluationNameVersionDecider) DetectorNameVersionDecider(com.blackducksoftware.integration.hub.detect.workflow.project.DetectorNameVersionDecider) EventSystem(com.blackducksoftware.integration.hub.detect.workflow.event.EventSystem)

Aggregations

DetectorFactory (com.blackducksoftware.integration.hub.detect.detector.DetectorFactory)1 DetectorManager (com.blackducksoftware.integration.hub.detect.workflow.detector.DetectorManager)1 EventSystem (com.blackducksoftware.integration.hub.detect.workflow.event.EventSystem)1 ExtractionManager (com.blackducksoftware.integration.hub.detect.workflow.extraction.ExtractionManager)1 PreparationManager (com.blackducksoftware.integration.hub.detect.workflow.extraction.PreparationManager)1 DetectorEvaluationNameVersionDecider (com.blackducksoftware.integration.hub.detect.workflow.project.DetectorEvaluationNameVersionDecider)1 DetectorNameVersionDecider (com.blackducksoftware.integration.hub.detect.workflow.project.DetectorNameVersionDecider)1 SearchManager (com.blackducksoftware.integration.hub.detect.workflow.search.SearchManager)1 DetectorSearchEvaluator (com.blackducksoftware.integration.hub.detect.workflow.search.rules.DetectorSearchEvaluator)1 DetectorSearchProvider (com.blackducksoftware.integration.hub.detect.workflow.search.rules.DetectorSearchProvider)1 NameVersion (com.synopsys.integration.util.NameVersion)1