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;
}
Aggregations