Search in sources :

Example 1 with SupportedServiceV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedServiceV4Response 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;
}
Also used : BlueprintServicesV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintServicesV4Response) SupportedService(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService) TreeSet(java.util.TreeSet) SupportedServiceV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedServiceV4Response)

Example 2 with SupportedServiceV4Response

use of com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedServiceV4Response 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;
}
Also used : SupportedVersionsV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedVersionsV4Response) SupportedService(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService) SupportedVersionV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedVersionV4Response) SupportedServiceV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedServiceV4Response) SupportedVersion(com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersion) HashSet(java.util.HashSet)

Aggregations

SupportedServiceV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedServiceV4Response)2 SupportedService (com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedService)2 BlueprintServicesV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.BlueprintServicesV4Response)1 SupportedVersionV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedVersionV4Response)1 SupportedVersionsV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.blueprint.responses.SupportedVersionsV4Response)1 SupportedVersion (com.sequenceiq.cloudbreak.cmtemplate.generator.support.domain.SupportedVersion)1 HashSet (java.util.HashSet)1 TreeSet (java.util.TreeSet)1