Search in sources :

Example 1 with MockNetwork

use of com.sequenceiq.environment.network.dao.domain.MockNetwork in project cloudbreak by hortonworks.

the class MockEnvironmentNetworkConverter method setCreatedCloudNetwork.

@Override
public BaseNetwork setCreatedCloudNetwork(BaseNetwork baseNetwork, CreatedCloudNetwork createdCloudNetwork) {
    MockNetwork mockNetwork = (MockNetwork) baseNetwork;
    mockNetwork.setName(createdCloudNetwork.getStackName());
    mockNetwork.setVpcId(createdCloudNetwork.getNetworkId());
    mockNetwork.setSubnetMetas(createdCloudNetwork.getSubnets().stream().collect(Collectors.toMap(CreatedSubnet::getSubnetId, subnet -> new CloudSubnet(subnet.getSubnetId(), subnet.getSubnetId(), subnet.getAvailabilityZone(), subnet.getCidr(), !subnet.isPublicSubnet(), subnet.isMapPublicIpOnLaunch(), subnet.isIgwAvailable(), subnet.getType()))));
    return mockNetwork;
}
Also used : MockNetwork(com.sequenceiq.environment.network.dao.domain.MockNetwork) CreatedSubnet(com.sequenceiq.cloudbreak.cloud.model.network.CreatedSubnet) CloudSubnet(com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)

Aggregations

CloudSubnet (com.sequenceiq.cloudbreak.cloud.model.CloudSubnet)1 CreatedSubnet (com.sequenceiq.cloudbreak.cloud.model.network.CreatedSubnet)1 MockNetwork (com.sequenceiq.environment.network.dao.domain.MockNetwork)1