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

io.github.devsecops.engine.domain.resolver.PathResolverBuilder Maven / Gradle / Ivy

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

import io.github.devsecops.engine.core.Log;
import io.github.devsecops.engine.core.contract.Factory;
import io.github.devsecops.engine.core.model.BuildParam;
import io.github.devsecops.engine.domain.resolver.model.PathList;
import io.github.devsecops.engine.domain.resolver.strategy.EnvironmentResolverStrategy;
import io.github.devsecops.engine.domain.resolver.strategy.PropertyFileResolverStrategy;
import io.github.devsecops.engine.domain.resolver.strategy.Resolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class PathResolverBuilder implements Factory {

    @Autowired
    private Log logger;

    @Autowired
    @Qualifier("PathList")
    private Map pathListMap;

    private PathList getPathList(Map parameters) {
        return pathListMap.get(parameters.get(BuildParam.ENV.name()).toUpperCase());
    }

    @Override
    public Resolver build(Map parameters) throws Exception {
        PathList pathList = this.getPathList(parameters);
//        TODO VAULT
        return new Resolver(new PropertyFileResolverStrategy(pathList), new EnvironmentResolverStrategy(), logger);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy