use of com.blackducksoftware.integration.hub.detect.workflow.detector.DetectorManager 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;
}
Aggregations