Search in sources :

Example 1 with SignatureScannerLogger

use of com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerLogger in project synopsys-detect by blackducksoftware.

the class OperationFactory method createScanBatchRunnerWithCustomUrl.

// TODO: Why is this unused? JM-02/2022
// Does WithCustomUrl mean a non-blackduck location?
public ScanBatchRunner createScanBatchRunnerWithCustomUrl(String url, File installDirectory) throws OperationException {
    return auditLog.namedInternal("Create Scan Batch Runner with Custom URL", () -> {
        IntEnvironmentVariables intEnvironmentVariables = IntEnvironmentVariables.includeSystemEnv();
        ScanPathsUtility scanPathsUtility = new ScanPathsUtility(new Slf4jIntLogger(LoggerFactory.getLogger(ScanPathsUtility.class)), intEnvironmentVariables, OperatingSystemType.determineFromSystem());
        ScanCommandRunner scanCommandRunner = new ScanCommandRunner(new Slf4jIntLogger(LoggerFactory.getLogger(ScanCommandRunner.class)), intEnvironmentVariables, scanPathsUtility, createExecutorServiceForScanner());
        BlackDuckServerConfig blackDuckServerConfig = BlackDuckServerConfig.newApiTokenBuilder().setIntEnvironmentVariables(intEnvironmentVariables).build();
        BlackDuckServicesFactory blackDuckServicesFactory = blackDuckServerConfig.createBlackDuckServicesFactory(new Slf4jIntLogger(LoggerFactory.getLogger(BlackDuckServicesFactory.class)));
        BlackDuckRegistrationService blackDuckRegistrationService = blackDuckServicesFactory.createBlackDuckRegistrationService();
        return new CreateScanBatchRunnerWithCustomUrl(intEnvironmentVariables, new SignatureScannerLogger(LoggerFactory.getLogger(ScanCommandRunner.class)), OperatingSystemType.determineFromSystem(), scanPathsUtility, scanCommandRunner).createScanBatchRunner(url, connectionDetails, blackDuckRegistrationService, installDirectory);
    });
}
Also used : IntEnvironmentVariables(com.synopsys.integration.util.IntEnvironmentVariables) CreateScanBatchRunnerWithCustomUrl(com.synopsys.integration.detect.tool.signaturescanner.operation.CreateScanBatchRunnerWithCustomUrl) Slf4jIntLogger(com.synopsys.integration.log.Slf4jIntLogger) SignatureScannerLogger(com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerLogger) ScanPathsUtility(com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanPathsUtility) BlackDuckServicesFactory(com.synopsys.integration.blackduck.service.BlackDuckServicesFactory) ScanCommandRunner(com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanCommandRunner) BlackDuckServerConfig(com.synopsys.integration.blackduck.configuration.BlackDuckServerConfig) BlackDuckRegistrationService(com.synopsys.integration.blackduck.service.dataservice.BlackDuckRegistrationService)

Example 2 with SignatureScannerLogger

use of com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerLogger in project synopsys-detect by blackducksoftware.

the class CreateScanBatchRunnerWithBlackDuck method createScanBatchRunner.

public ScanBatchRunner createScanBatchRunner(BlackDuckServerConfig blackDuckServerConfig, File installDirectory) {
    logger.debug("Signature scanner will use the Black Duck server to download/update the scanner - this is the most likely situation.");
    SignatureScannerLogger slf4jIntLogger = new SignatureScannerLogger(logger);
    ScanPathsUtility scanPathsUtility = new ScanPathsUtility(slf4jIntLogger, intEnvironmentVariables, operatingSystemType);
    ScanCommandRunner scanCommandRunner = new ScanCommandRunner(slf4jIntLogger, intEnvironmentVariables, scanPathsUtility, executorService);
    BlackDuckHttpClient blackDuckHttpClient = blackDuckServerConfig.createBlackDuckHttpClient(slf4jIntLogger);
    CleanupZipExpander cleanupZipExpander = new CleanupZipExpander(slf4jIntLogger);
    SignatureScannerClient signatureScannerClient = new SignatureScannerClient(blackDuckHttpClient);
    BlackDuckRegistrationService blackDuckRegistrationService = blackDuckServerConfig.createBlackDuckServicesFactory(slf4jIntLogger).createBlackDuckRegistrationService();
    KeyStoreHelper keyStoreHelper = new KeyStoreHelper(slf4jIntLogger);
    ScannerZipInstaller scannerZipInstaller = new ScannerZipInstaller(slf4jIntLogger, signatureScannerClient, blackDuckRegistrationService, cleanupZipExpander, scanPathsUtility, keyStoreHelper, blackDuckServerConfig.getBlackDuckUrl(), operatingSystemType, installDirectory);
    return ScanBatchRunner.createComplete(intEnvironmentVariables, scanPathsUtility, scanCommandRunner, scannerZipInstaller);
}
Also used : BlackDuckHttpClient(com.synopsys.integration.blackduck.http.client.BlackDuckHttpClient) KeyStoreHelper(com.synopsys.integration.blackduck.keystore.KeyStoreHelper) ScannerZipInstaller(com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScannerZipInstaller) SignatureScannerLogger(com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerLogger) ScanPathsUtility(com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanPathsUtility) ScanCommandRunner(com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanCommandRunner) SignatureScannerClient(com.synopsys.integration.blackduck.http.client.SignatureScannerClient) CleanupZipExpander(com.synopsys.integration.util.CleanupZipExpander) BlackDuckRegistrationService(com.synopsys.integration.blackduck.service.dataservice.BlackDuckRegistrationService)

Aggregations

ScanCommandRunner (com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanCommandRunner)2 ScanPathsUtility (com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScanPathsUtility)2 BlackDuckRegistrationService (com.synopsys.integration.blackduck.service.dataservice.BlackDuckRegistrationService)2 SignatureScannerLogger (com.synopsys.integration.detect.tool.signaturescanner.SignatureScannerLogger)2 ScannerZipInstaller (com.synopsys.integration.blackduck.codelocation.signaturescanner.command.ScannerZipInstaller)1 BlackDuckServerConfig (com.synopsys.integration.blackduck.configuration.BlackDuckServerConfig)1 BlackDuckHttpClient (com.synopsys.integration.blackduck.http.client.BlackDuckHttpClient)1 SignatureScannerClient (com.synopsys.integration.blackduck.http.client.SignatureScannerClient)1 KeyStoreHelper (com.synopsys.integration.blackduck.keystore.KeyStoreHelper)1 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)1 CreateScanBatchRunnerWithCustomUrl (com.synopsys.integration.detect.tool.signaturescanner.operation.CreateScanBatchRunnerWithCustomUrl)1 Slf4jIntLogger (com.synopsys.integration.log.Slf4jIntLogger)1 CleanupZipExpander (com.synopsys.integration.util.CleanupZipExpander)1 IntEnvironmentVariables (com.synopsys.integration.util.IntEnvironmentVariables)1