Search in sources :

Example 1 with Services

use of com.sequenceiq.cloudbreak.cmtemplate.generator.dependencies.domain.Services in project cloudbreak by hortonworks.

the class ServiceDependencyMatrixService method collectServiceDependencyMatrix.

public ServiceDependencyMatrix collectServiceDependencyMatrix(Set<String> services, String stackType, String version) {
    ServiceDependencyMatrix serviceDependencyMatrix = new ServiceDependencyMatrix();
    Services servicesObject = new Services();
    servicesObject.setServices(services);
    serviceDependencyMatrix.setServices(servicesObject);
    Dependencies dependencies = new Dependencies();
    Set<String> deps = new HashSet<>();
    for (String service : services) {
        for (ServiceConfig serviceInformation : resolver.serviceConfigs()) {
            if (service.toUpperCase().equals(serviceInformation.getName())) {
                for (String dependency : serviceInformation.getDependencies()) {
                    deps.add(dependency.toUpperCase());
                }
                break;
            }
        }
    }
    dependencies.setServices(deps);
    serviceDependencyMatrix.setDependencies(dependencies);
    return serviceDependencyMatrix;
}
Also used : Services(com.sequenceiq.cloudbreak.cmtemplate.generator.dependencies.domain.Services) ServiceConfig(com.sequenceiq.cloudbreak.cmtemplate.generator.configuration.domain.dependencies.ServiceConfig) Dependencies(com.sequenceiq.cloudbreak.cmtemplate.generator.dependencies.domain.Dependencies) ServiceDependencyMatrix(com.sequenceiq.cloudbreak.cmtemplate.generator.dependencies.domain.ServiceDependencyMatrix) HashSet(java.util.HashSet)

Aggregations

ServiceConfig (com.sequenceiq.cloudbreak.cmtemplate.generator.configuration.domain.dependencies.ServiceConfig)1 Dependencies (com.sequenceiq.cloudbreak.cmtemplate.generator.dependencies.domain.Dependencies)1 ServiceDependencyMatrix (com.sequenceiq.cloudbreak.cmtemplate.generator.dependencies.domain.ServiceDependencyMatrix)1 Services (com.sequenceiq.cloudbreak.cmtemplate.generator.dependencies.domain.Services)1 HashSet (java.util.HashSet)1