use of com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService 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;
}
use of com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService in project cloudbreak by hortonworks.
the class SupportedServicesToBlueprintServicesV4ResponseConverter method convert.
public BlueprintServicesV4Response convert(SupportedServices source) {
BlueprintServicesV4Response blueprintServicesV4Response = new BlueprintServicesV4Response();
Set<SupportedServiceV4Response> services = new TreeSet<>();
for (SupportedService service : source.getServices()) {
SupportedServiceV4Response supportedServiceV4Response = new SupportedServiceV4Response();
supportedServiceV4Response.setDisplayName(service.getDisplayName());
supportedServiceV4Response.setVersion(service.getVersion());
supportedServiceV4Response.setName(service.getName());
services.add(supportedServiceV4Response);
}
blueprintServicesV4Response.setServices(services);
return blueprintServicesV4Response;
}
use of com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService in project cloudbreak by hortonworks.
the class SupportedVersionsToSupportedVersionsV4ResponseConverter method convert.
public SupportedVersionsV4Response convert(SupportedVersions source) {
SupportedVersionsV4Response supportedVersionsV4Response = new SupportedVersionsV4Response();
for (SupportedVersion supportedVersion : source.getSupportedVersions()) {
SupportedVersionV4Response supportedVersionV4Response = new SupportedVersionV4Response();
supportedVersionV4Response.setType(supportedVersion.getType());
supportedVersionV4Response.setVersion(supportedVersion.getVersion());
Set<SupportedServiceV4Response> services = new HashSet<>();
for (SupportedService service : supportedVersion.getSupportedServices().getServices()) {
SupportedServiceV4Response supportedServiceV4Response = new SupportedServiceV4Response();
supportedServiceV4Response.setName(service.getName());
supportedServiceV4Response.setDisplayName(service.getDisplayName());
supportedServiceV4Response.setVersion(service.getVersion());
services.add(supportedServiceV4Response);
}
supportedVersionV4Response.setServices(services);
supportedVersionsV4Response.getSupportedVersions().add(supportedVersionV4Response);
}
return supportedVersionsV4Response;
}
use of com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService in project cloudbreak by hortonworks.
the class ParcelFilterServiceTest method testShouldReturnAllParcelsWhenTheServiceNamesInTheBlueprintContainsANullValue.
@Test
void testShouldReturnAllParcelsWhenTheServiceNamesInTheBlueprintContainsANullValue() {
String parcelUrl = "http://parcel1.com/";
String parcelName = "CUSTOM";
ClouderaManagerProduct parcel = new ClouderaManagerProduct().withParcel(parcelUrl).withName(parcelName);
SupportedService supportedService = new SupportedService();
supportedService.setComponentNameInParcel(null);
SupportedServices supportedServices = new SupportedServices();
supportedServices.setServices(Set.of(supportedService));
when(clusterTemplateGeneratorService.getServicesByBlueprint(BLUEPRINT_TEXT)).thenReturn(supportedServices);
assertEquals(1, underTest.filterParcelsByBlueprint(STACK_ID, Set.of(parcel), getBlueprint()).size());
}
use of com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService in project cloudbreak by hortonworks.
the class ParcelFilterServiceTest method getSupportedServices.
private SupportedServices getSupportedServices(Set<String> componentNames) {
SupportedServices supportedServices = new SupportedServices();
Set<SupportedService> services = componentNames.stream().map(s -> {
SupportedService supportedService = new SupportedService();
supportedService.setComponentNameInParcel(s);
return supportedService;
}).collect(Collectors.toSet());
supportedServices.setServices(services);
return supportedServices;
}
Aggregations