Search in sources :

Example 1 with ConfigurationServerImpl

use of com.cloud.server.ConfigurationServerImpl in project cloudstack by apache.

the class ContrailElementImpl method isReady.

@Override
public boolean isReady(PhysicalNetworkServiceProvider provider) {
    Map<String, String> serviceMap = ((ConfigurationServerImpl) _configServer).getServicesAndProvidersForNetwork(_manager.getRouterOffering().getId());
    List<TrafficType> types = new ArrayList<TrafficType>();
    types.add(TrafficType.Control);
    types.add(TrafficType.Management);
    types.add(TrafficType.Storage);
    List<NetworkVO> systemNets = _manager.findSystemNetworks(types);
    if (systemNets != null && !systemNets.isEmpty()) {
        for (NetworkVO net : systemNets) {
            s_logger.debug("update system network service: " + net.getName() + "; service provider: " + serviceMap);
            _networksDao.update(net.getId(), net, serviceMap);
        }
    } else {
        s_logger.debug("no system networks created yet");
    }
    serviceMap = ((ConfigurationServerImpl) _configServer).getServicesAndProvidersForNetwork(_manager.getPublicRouterOffering().getId());
    types = new ArrayList<TrafficType>();
    types.add(TrafficType.Public);
    systemNets = _manager.findSystemNetworks(types);
    if (systemNets != null && !systemNets.isEmpty()) {
        for (NetworkVO net : systemNets) {
            s_logger.debug("update system network service: " + net.getName() + "; service provider: " + serviceMap);
            _networksDao.update(net.getId(), net, serviceMap);
        }
    } else {
        s_logger.debug("no system networks created yet");
    }
    return true;
}
Also used : NetworkVO(com.cloud.network.dao.NetworkVO) ConfigurationServerImpl(com.cloud.server.ConfigurationServerImpl) ArrayList(java.util.ArrayList) TrafficType(com.cloud.network.Networks.TrafficType)

Aggregations

TrafficType (com.cloud.network.Networks.TrafficType)1 NetworkVO (com.cloud.network.dao.NetworkVO)1 ConfigurationServerImpl (com.cloud.server.ConfigurationServerImpl)1 ArrayList (java.util.ArrayList)1