Search in sources :

Example 1 with ConnectionFactory

use of com.synopsys.integration.detect.configuration.connection.ConnectionFactory in project synopsys-detect by blackducksoftware.

the class DetectBootFactory method createAirGapCreator.

public AirGapCreator createAirGapCreator(ConnectionDetails connectionDetails, DetectExecutableOptions detectExecutableOptions, Configuration freemarkerConfiguration, InstalledToolManager installedToolManager, InstalledToolLocator installedToolLocator) {
    ConnectionFactory connectionFactory = new ConnectionFactory(connectionDetails);
    ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
    ArtifactoryZipInstaller artifactoryZipInstaller = new ArtifactoryZipInstaller(artifactResolver);
    DirectoryExecutableFinder directoryExecutableFinder = DirectoryExecutableFinder.forCurrentOperatingSystem(fileFinder);
    SystemPathExecutableFinder systemPathExecutableFinder = new SystemPathExecutableFinder(directoryExecutableFinder);
    DetectExecutableResolver detectExecutableResolver = new DetectExecutableResolver(directoryExecutableFinder, systemPathExecutableFinder, detectExecutableOptions);
    DetectExecutableRunner runner = DetectExecutableRunner.newDebug(eventSystem);
    GradleAirGapCreator gradleAirGapCreator = new GradleAirGapCreator(detectExecutableResolver, runner, freemarkerConfiguration);
    NugetInspectorAirGapCreator nugetAirGapCreator = new NugetInspectorAirGapCreator(new ArtifactoryNugetInspectorInstaller(detectInfo, artifactoryZipInstaller, new NugetInspectorExecutableLocator(detectInfo)));
    ProjectInspectorExecutableLocator projectInspectorExecutableLocator = new ProjectInspectorExecutableLocator(detectInfo);
    ArtifactoryProjectInspectorInstaller projectInspectorInstaller = new ArtifactoryProjectInspectorInstaller(detectInfo, artifactoryZipInstaller, projectInspectorExecutableLocator);
    ProjectInspectorAirGapCreator projectInspectorAirGapCreator = new ProjectInspectorAirGapCreator(projectInspectorInstaller);
    DockerAirGapCreator dockerAirGapCreator = new DockerAirGapCreator(new DockerInspectorInstaller(artifactResolver));
    DetectFontAirGapCreator detectFontAirGapCreator = new DetectFontAirGapCreator(new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator));
    return new AirGapCreator(new AirGapPathFinder(), eventSystem, gradleAirGapCreator, nugetAirGapCreator, dockerAirGapCreator, detectFontAirGapCreator, projectInspectorAirGapCreator);
}
Also used : ArtifactoryNugetInspectorInstaller(com.synopsys.integration.detect.tool.detector.inspectors.nuget.ArtifactoryNugetInspectorInstaller) NugetInspectorExecutableLocator(com.synopsys.integration.detect.tool.detector.inspectors.nuget.NugetInspectorExecutableLocator) DirectoryExecutableFinder(com.synopsys.integration.detect.tool.detector.executable.DirectoryExecutableFinder) ArtifactoryZipInstaller(com.synopsys.integration.detect.tool.detector.inspectors.ArtifactoryZipInstaller) GradleAirGapCreator(com.synopsys.integration.detect.workflow.airgap.GradleAirGapCreator) ArtifactoryProjectInspectorInstaller(com.synopsys.integration.detect.tool.detector.inspectors.projectinspector.ArtifactoryProjectInspectorInstaller) NugetInspectorAirGapCreator(com.synopsys.integration.detect.workflow.airgap.NugetInspectorAirGapCreator) DockerInspectorInstaller(com.synopsys.integration.detect.tool.detector.inspectors.DockerInspectorInstaller) ArtifactResolver(com.synopsys.integration.detect.workflow.ArtifactResolver) SystemPathExecutableFinder(com.synopsys.integration.detect.tool.detector.executable.SystemPathExecutableFinder) ProjectInspectorExecutableLocator(com.synopsys.integration.detect.tool.detector.inspectors.projectinspector.ProjectInspectorExecutableLocator) DockerAirGapCreator(com.synopsys.integration.detect.workflow.airgap.DockerAirGapCreator) DetectFontAirGapCreator(com.synopsys.integration.detect.workflow.airgap.DetectFontAirGapCreator) DockerAirGapCreator(com.synopsys.integration.detect.workflow.airgap.DockerAirGapCreator) AirGapCreator(com.synopsys.integration.detect.workflow.airgap.AirGapCreator) NugetInspectorAirGapCreator(com.synopsys.integration.detect.workflow.airgap.NugetInspectorAirGapCreator) GradleAirGapCreator(com.synopsys.integration.detect.workflow.airgap.GradleAirGapCreator) ProjectInspectorAirGapCreator(com.synopsys.integration.detect.workflow.airgap.ProjectInspectorAirGapCreator) DetectFontAirGapCreator(com.synopsys.integration.detect.workflow.airgap.DetectFontAirGapCreator) ConnectionFactory(com.synopsys.integration.detect.configuration.connection.ConnectionFactory) DetectFontInstaller(com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller) DetectExecutableResolver(com.synopsys.integration.detect.tool.detector.executable.DetectExecutableResolver) AirGapPathFinder(com.synopsys.integration.detect.workflow.airgap.AirGapPathFinder) ProjectInspectorAirGapCreator(com.synopsys.integration.detect.workflow.airgap.ProjectInspectorAirGapCreator) DetectExecutableRunner(com.synopsys.integration.detect.tool.detector.executable.DetectExecutableRunner)

Example 2 with ConnectionFactory

use of com.synopsys.integration.detect.configuration.connection.ConnectionFactory in project synopsys-detect by blackducksoftware.

the class FontLoaderTestIT method createTempDirectory.

@BeforeEach
public void createTempDirectory() throws Exception {
    fontDirectory = Files.createTempDirectory("junit_test_font_loader").toFile();
    PropertyConfiguration propertyConfiguration = new PropertyConfiguration(Collections.emptyList());
    Gson gson = new Gson();
    DetectConfigurationFactory detectConfigurationFactory = new DetectConfigurationFactory(new DetectPropertyConfiguration(propertyConfiguration, new SimplePathResolver()), gson);
    ConnectionFactory connectionFactory = new ConnectionFactory(detectConfigurationFactory.createConnectionDetails());
    ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
    InstalledToolManager installedToolManager = new InstalledToolManager();
    InstalledToolLocator installedToolLocator = new InstalledToolLocator(Paths.get(""), new Gson());
    DetectFontInstaller installer = new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator);
    DirectoryOptions directoryOptions = new DirectoryOptions(null, null, null, null, fontDirectory.toPath(), null);
    DirectoryManager directoryManager = new DirectoryManager(directoryOptions, DetectRunId.createDefault());
    detectFontLocator = new OnlineDetectFontLocator(installer, directoryManager);
}
Also used : InstalledToolLocator(com.synopsys.integration.detect.tool.cache.InstalledToolLocator) DirectoryManager(com.synopsys.integration.detect.workflow.file.DirectoryManager) Gson(com.google.gson.Gson) SimplePathResolver(com.synopsys.integration.configuration.property.types.path.SimplePathResolver) ArtifactResolver(com.synopsys.integration.detect.workflow.ArtifactResolver) ConnectionFactory(com.synopsys.integration.detect.configuration.connection.ConnectionFactory) InstalledToolManager(com.synopsys.integration.detect.tool.cache.InstalledToolManager) DetectFontInstaller(com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller) DirectoryOptions(com.synopsys.integration.detect.workflow.file.DirectoryOptions) DetectPropertyConfiguration(com.synopsys.integration.detect.configuration.DetectPropertyConfiguration) DetectConfigurationFactory(com.synopsys.integration.detect.configuration.DetectConfigurationFactory) OnlineDetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator) PropertyConfiguration(com.synopsys.integration.configuration.config.PropertyConfiguration) DetectPropertyConfiguration(com.synopsys.integration.detect.configuration.DetectPropertyConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with ConnectionFactory

use of com.synopsys.integration.detect.configuration.connection.ConnectionFactory in project synopsys-detect by blackducksoftware.

the class SingletonFactory method createUtilitySingletons.

public UtilitySingletons createUtilitySingletons(EventSingletons eventSingletons) throws DetectUserFriendlyException {
    ExternalIdFactory externalIdFactory = new ExternalIdFactory();
    ConnectionDetails connectionDetails = detectConfigurationFactory.createConnectionDetails();
    ConnectionFactory connectionFactory = new ConnectionFactory(connectionDetails);
    ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
    ArtifactoryZipInstaller artifactoryZipInstaller = new ArtifactoryZipInstaller(artifactResolver);
    AirGapPathFinder airGapPathFinder = new AirGapPathFinder();
    BdioOptions bdioOptions = detectConfigurationFactory.createBdioOptions();
    CodeLocationNameGenerator codeLocationNameGenerator = detectConfigurationFactory.createCodeLocationOverride().map(CodeLocationNameGenerator::withOverride).orElse(CodeLocationNameGenerator.withPrefixSuffix(bdioOptions.getProjectCodeLocationPrefix().orElse(null), bdioOptions.getProjectCodeLocationSuffix().orElse(null)));
    CodeLocationNameManager codeLocationNameManager = new CodeLocationNameManager(codeLocationNameGenerator);
    AirGapInspectorPaths airGapInspectorPaths = new AirGapInspectorPaths(airGapPathFinder);
    DetectExecutableRunner executableRunner = DetectExecutableRunner.newDebug(eventSystem);
    DirectoryExecutableFinder directoryExecutableFinder = DirectoryExecutableFinder.forCurrentOperatingSystem(fileFinder);
    SystemPathExecutableFinder systemExecutableFinder = new SystemPathExecutableFinder(directoryExecutableFinder);
    DetectExecutableResolver detectExecutableResolver = new DetectExecutableResolver(directoryExecutableFinder, systemExecutableFinder, detectConfigurationFactory.createDetectExecutableOptions());
    OperationSystem operationSystem = new OperationSystem(eventSingletons.getStatusEventPublisher());
    OperationWrapper operationWrapper = new OperationWrapper();
    return new UtilitySingletons(externalIdFactory, connectionDetails, artifactResolver, codeLocationNameManager, airGapInspectorPaths, executableRunner, detectExecutableResolver, operationSystem, operationWrapper, artifactoryZipInstaller);
}
Also used : AirGapInspectorPaths(com.synopsys.integration.detect.workflow.airgap.AirGapInspectorPaths) DirectoryExecutableFinder(com.synopsys.integration.detect.tool.detector.executable.DirectoryExecutableFinder) CodeLocationNameManager(com.synopsys.integration.detect.workflow.codelocation.CodeLocationNameManager) ArtifactoryZipInstaller(com.synopsys.integration.detect.tool.detector.inspectors.ArtifactoryZipInstaller) OperationWrapper(com.synopsys.integration.detect.lifecycle.run.step.utility.OperationWrapper) ExternalIdFactory(com.synopsys.integration.bdio.model.externalid.ExternalIdFactory) ConnectionDetails(com.synopsys.integration.detect.configuration.connection.ConnectionDetails) OperationSystem(com.synopsys.integration.detect.workflow.status.OperationSystem) ArtifactResolver(com.synopsys.integration.detect.workflow.ArtifactResolver) SystemPathExecutableFinder(com.synopsys.integration.detect.tool.detector.executable.SystemPathExecutableFinder) BdioOptions(com.synopsys.integration.detect.workflow.bdio.BdioOptions) ConnectionFactory(com.synopsys.integration.detect.configuration.connection.ConnectionFactory) DetectExecutableResolver(com.synopsys.integration.detect.tool.detector.executable.DetectExecutableResolver) AirGapPathFinder(com.synopsys.integration.detect.workflow.airgap.AirGapPathFinder) CodeLocationNameGenerator(com.synopsys.integration.detect.workflow.codelocation.CodeLocationNameGenerator) DetectExecutableRunner(com.synopsys.integration.detect.tool.detector.executable.DetectExecutableRunner)

Example 4 with ConnectionFactory

use of com.synopsys.integration.detect.configuration.connection.ConnectionFactory in project synopsys-detect by blackducksoftware.

the class DetectFontInstallerTestIT method testFontInstall.

@Test
public void testFontInstall() throws Exception {
    Gson gson = new Gson();
    PropertyConfiguration propertyConfiguration = new PropertyConfiguration(Collections.emptyList());
    DetectConfigurationFactory detectConfigurationFactory = new DetectConfigurationFactory(new DetectPropertyConfiguration(propertyConfiguration, new SimplePathResolver()), gson);
    ConnectionFactory connectionFactory = new ConnectionFactory(detectConfigurationFactory.createConnectionDetails());
    ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
    InstalledToolManager installedToolManager = new InstalledToolManager();
    InstalledToolLocator installedToolLocator = new InstalledToolLocator(Paths.get(""), new Gson());
    DetectFontInstaller installer = new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator);
    installer.installFonts(targetDirectory);
    String[] fileList = targetDirectory.list();
    assertNotNull(fileList);
    assertTrue(fileList.length > 0);
}
Also used : ConnectionFactory(com.synopsys.integration.detect.configuration.connection.ConnectionFactory) InstalledToolManager(com.synopsys.integration.detect.tool.cache.InstalledToolManager) DetectPropertyConfiguration(com.synopsys.integration.detect.configuration.DetectPropertyConfiguration) DetectConfigurationFactory(com.synopsys.integration.detect.configuration.DetectConfigurationFactory) InstalledToolLocator(com.synopsys.integration.detect.tool.cache.InstalledToolLocator) Gson(com.google.gson.Gson) SimplePathResolver(com.synopsys.integration.configuration.property.types.path.SimplePathResolver) DetectPropertyConfiguration(com.synopsys.integration.detect.configuration.DetectPropertyConfiguration) PropertyConfiguration(com.synopsys.integration.configuration.config.PropertyConfiguration) ArtifactResolver(com.synopsys.integration.detect.workflow.ArtifactResolver) Test(org.junit.jupiter.api.Test)

Aggregations

ConnectionFactory (com.synopsys.integration.detect.configuration.connection.ConnectionFactory)4 ArtifactResolver (com.synopsys.integration.detect.workflow.ArtifactResolver)4 Gson (com.google.gson.Gson)2 PropertyConfiguration (com.synopsys.integration.configuration.config.PropertyConfiguration)2 SimplePathResolver (com.synopsys.integration.configuration.property.types.path.SimplePathResolver)2 DetectConfigurationFactory (com.synopsys.integration.detect.configuration.DetectConfigurationFactory)2 DetectPropertyConfiguration (com.synopsys.integration.detect.configuration.DetectPropertyConfiguration)2 InstalledToolLocator (com.synopsys.integration.detect.tool.cache.InstalledToolLocator)2 InstalledToolManager (com.synopsys.integration.detect.tool.cache.InstalledToolManager)2 DetectExecutableResolver (com.synopsys.integration.detect.tool.detector.executable.DetectExecutableResolver)2 DetectExecutableRunner (com.synopsys.integration.detect.tool.detector.executable.DetectExecutableRunner)2 DirectoryExecutableFinder (com.synopsys.integration.detect.tool.detector.executable.DirectoryExecutableFinder)2 SystemPathExecutableFinder (com.synopsys.integration.detect.tool.detector.executable.SystemPathExecutableFinder)2 ArtifactoryZipInstaller (com.synopsys.integration.detect.tool.detector.inspectors.ArtifactoryZipInstaller)2 AirGapPathFinder (com.synopsys.integration.detect.workflow.airgap.AirGapPathFinder)2 DetectFontInstaller (com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller)2 ExternalIdFactory (com.synopsys.integration.bdio.model.externalid.ExternalIdFactory)1 ConnectionDetails (com.synopsys.integration.detect.configuration.connection.ConnectionDetails)1 OperationWrapper (com.synopsys.integration.detect.lifecycle.run.step.utility.OperationWrapper)1 DockerInspectorInstaller (com.synopsys.integration.detect.tool.detector.inspectors.DockerInspectorInstaller)1