Search in sources :

Example 1 with DetectRun

use of com.synopsys.integration.detect.lifecycle.run.DetectRun in project synopsys-detect by blackducksoftware.

the class Application method runApplication.

private void runApplication(EventSystem eventSystem, ExitCodeManager exitCodeManager, DetectBootResult detectBootResult, ExceptionUtility exceptionUtility) {
    Optional<BootSingletons> optionalRunContext = detectBootResult.getBootSingletons();
    Optional<ProductRunData> optionalProductRunData = detectBootResult.getProductRunData();
    if (detectBootResult.getBootType() == DetectBootResult.BootType.RUN && optionalProductRunData.isPresent() && optionalRunContext.isPresent()) {
        logger.debug("Detect will attempt to run.");
        DetectRun detectRun = new DetectRun(exitCodeManager, exceptionUtility);
        detectRun.run(optionalRunContext.get());
    } else {
        logger.debug("Detect will NOT attempt to run.");
        detectBootResult.getException().ifPresent(exitCodeManager::requestExitCode);
        detectBootResult.getException().ifPresent(e -> DetectIssue.publish(eventSystem, DetectIssueType.EXCEPTION, "Detect Boot Error", e.getMessage()));
    }
}
Also used : BootSingletons(com.synopsys.integration.detect.lifecycle.run.singleton.BootSingletons) DetectRun(com.synopsys.integration.detect.lifecycle.run.DetectRun) ProductRunData(com.synopsys.integration.detect.lifecycle.run.data.ProductRunData)

Aggregations

DetectRun (com.synopsys.integration.detect.lifecycle.run.DetectRun)1 ProductRunData (com.synopsys.integration.detect.lifecycle.run.data.ProductRunData)1 BootSingletons (com.synopsys.integration.detect.lifecycle.run.singleton.BootSingletons)1