Search in sources :

Example 1 with CloudGatewayRequest

use of com.sequenceiq.environment.api.v1.platformresource.model.CloudGatewayRequest in project cloudbreak by hortonworks.

the class CloudGatewayssToPlatformGatewaysV1ResponseConverter method convert.

public PlatformGatewaysResponse convert(CloudGateWays source) {
    Map<String, Set<CloudGatewayRequest>> result = new HashMap<>();
    for (Entry<String, Set<CloudGateWay>> entry : source.getCloudGateWayResponses().entrySet()) {
        Set<CloudGatewayRequest> cloudGatewayJsons = new HashSet<>();
        for (CloudGateWay gateway : entry.getValue()) {
            CloudGatewayRequest actual = new CloudGatewayRequest(gateway.getName(), gateway.getId(), gateway.getProperties());
            cloudGatewayJsons.add(actual);
        }
        result.put(entry.getKey(), cloudGatewayJsons);
    }
    return new PlatformGatewaysResponse(result);
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) CloudGatewayRequest(com.sequenceiq.environment.api.v1.platformresource.model.CloudGatewayRequest) HashMap(java.util.HashMap) PlatformGatewaysResponse(com.sequenceiq.environment.api.v1.platformresource.model.PlatformGatewaysResponse) HashSet(java.util.HashSet) CloudGateWay(com.sequenceiq.cloudbreak.cloud.model.CloudGateWay)

Aggregations

CloudGateWay (com.sequenceiq.cloudbreak.cloud.model.CloudGateWay)1 CloudGatewayRequest (com.sequenceiq.environment.api.v1.platformresource.model.CloudGatewayRequest)1 PlatformGatewaysResponse (com.sequenceiq.environment.api.v1.platformresource.model.PlatformGatewaysResponse)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1