All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.devsecops.engine.mojos.quality.CheckQualityFactory Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
package io.github.devsecops.engine.mojos.quality;

import io.github.devsecops.engine.core.CommandInvoker;
import io.github.devsecops.engine.core.Log;
import io.github.devsecops.engine.core.contract.Command;
import io.github.devsecops.engine.core.contract.Factory;
import io.github.devsecops.engine.core.contract.Invoker;
import io.github.devsecops.engine.domain.resolver.path.PathResolverBuilder;
import io.github.devsecops.engine.domain.resolver.strategy.Resolver;
import io.github.devsecops.engine.domain.sonar.commands.SonarCheckQualityCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.Stack;


@Service
public class CheckQualityFactory implements Factory {

    @Autowired
    private Log logger;

    @Autowired
    private PathResolverBuilder pathResolverFactory;

    @Autowired
    private SonarCheckQualityCommand sonarCheckQualityCommand;

    @Override
    public Invoker build(Map parameters) throws Exception {
        final Resolver resolver = pathResolverFactory.build(parameters);
        sonarCheckQualityCommand.setResolver(resolver);
        Stack commands = new Stack<>();
        commands.push(sonarCheckQualityCommand);
        return new CommandInvoker(commands, logger);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy