Search in sources :

Example 1 with SupportedVersions

use of com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersions in project cloudbreak by hortonworks.

the class SupportedVersionService method collectSupportedVersions.

public SupportedVersions collectSupportedVersions() {
    SupportedVersions supportedVersions = new SupportedVersions();
    Set<SupportedVersion> supportedVersionsSet = new HashSet<>();
    resolver.cdhConfigurations().forEach((key, value) -> {
        SupportedVersion supportedVersion = new SupportedVersion();
        supportedVersion.setType(key.getStackType());
        supportedVersion.setVersion(key.getVersion());
        SupportedServices supportedServices = new SupportedServices();
        for (CdhService serviceName : value) {
            for (ServiceConfig serviceInformation : resolver.serviceConfigs()) {
                if (serviceInformation.getName().equals(serviceName.getName())) {
                    SupportedService supportedService = new SupportedService();
                    supportedService.setName(serviceInformation.getName());
                    supportedService.setDisplayName(serviceInformation.getDisplayName());
                    supportedService.setVersion(serviceName.getVersion());
                    supportedServices.getServices().add(supportedService);
                    break;
                }
            }
        }
        supportedVersion.setSupportedServices(supportedServices);
        supportedVersionsSet.add(supportedVersion);
    });
    supportedVersions.setSupportedVersions(supportedVersionsSet);
    return supportedVersions;
}
Also used : SupportedService(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService) CdhService(com.sequenceiq.cloudbreak.cmtemplate.generator.configuration.domain.versionmatrix.CdhService) ServiceConfig(com.sequenceiq.cloudbreak.cmtemplate.generator.configuration.domain.dependencies.ServiceConfig) SupportedVersions(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersions) SupportedServices(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedServices) SupportedVersion(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersion) HashSet(java.util.HashSet)

Example 2 with SupportedVersions

use of com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersions in project cloudbreak by hortonworks.

the class SupportedVersionServiceTest method testServicesAndDependencies.

@Test
public void testServicesAndDependencies() {
    SupportedVersions supportedVersions = supportedVersionService().collectSupportedVersions();
    Assert.assertTrue(!supportedVersions.getSupportedVersions().isEmpty());
}
Also used : SupportedVersions(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersions) Test(org.junit.Test)

Aggregations

SupportedVersions (com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersions)2 ServiceConfig (com.sequenceiq.cloudbreak.cmtemplate.generator.configuration.domain.dependencies.ServiceConfig)1 CdhService (com.sequenceiq.cloudbreak.cmtemplate.generator.configuration.domain.versionmatrix.CdhService)1 SupportedService (com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService)1 SupportedServices (com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedServices)1 SupportedVersion (com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersion)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1