Search in sources :

Example 1 with RDSConfigResponse

use of com.sequenceiq.cloudbreak.api.model.rds.RDSConfigResponse in project cloudbreak by hortonworks.

the class RDSConfigToRDSConfigResponseConverter method convert.

@Override
public RDSConfigResponse convert(RDSConfig source) {
    RDSConfigResponse json = new RDSConfigResponse();
    json.setId(source.getId());
    json.setName(source.getName());
    json.setConnectionURL(source.getConnectionURL());
    json.setDatabaseEngine(source.getDatabaseEngine());
    json.setConnectionDriver(source.getConnectionDriver());
    json.setPublicInAccount(source.isPublicInAccount());
    json.setCreationDate(source.getCreationDate());
    if (source.getClusters() != null) {
        json.setClusterNames(source.getClusters().stream().map(Cluster::getName).collect(Collectors.toSet()));
    } else {
        json.setClusterNames(new HashSet<>());
    }
    json.setStackVersion(source.getStackVersion());
    json.setType(source.getType());
    return json;
}
Also used : RDSConfigResponse(com.sequenceiq.cloudbreak.api.model.rds.RDSConfigResponse) Cluster(com.sequenceiq.cloudbreak.domain.Cluster)

Aggregations

RDSConfigResponse (com.sequenceiq.cloudbreak.api.model.rds.RDSConfigResponse)1 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)1