use of com.cloud.network.dao.NetworkServiceMapVO in project cosmic by MissionCriticalCloud.
the class NetworkModelImpl method getNetworkCapabilities.
@Override
public Map<Service, Map<Capability, String>> getNetworkCapabilities(final long networkId) {
final Map<Service, Map<Capability, String>> networkCapabilities = new HashMap<>();
// list all services of this networkOffering
final List<NetworkServiceMapVO> servicesMap = _ntwkSrvcDao.getServicesInNetwork(networkId);
for (final NetworkServiceMapVO instance : servicesMap) {
final Service service = Service.getService(instance.getService());
final NetworkElement element = getElementImplementingProvider(instance.getProvider());
if (element != null) {
final Map<Service, Map<Capability, String>> elementCapabilities = element.getCapabilities();
if (elementCapabilities != null) {
networkCapabilities.put(service, elementCapabilities.get(service));
}
}
}
return networkCapabilities;
}
use of com.cloud.network.dao.NetworkServiceMapVO in project cloudstack by apache.
the class NetworkOrchestrator method getServicesNotSupportedInNewOffering.
@Override
public List<String> getServicesNotSupportedInNewOffering(Network network, long newNetworkOfferingId) {
NetworkOffering offering = _networkOfferingDao.findById(newNetworkOfferingId);
List<String> services = _ntwkOfferingSrvcDao.listServicesForNetworkOffering(offering.getId());
List<NetworkServiceMapVO> serviceMap = _ntwkSrvcDao.getServicesInNetwork(network.getId());
List<String> servicesNotInNewOffering = new ArrayList<>();
for (NetworkServiceMapVO serviceVO : serviceMap) {
boolean inlist = false;
for (String service : services) {
if (serviceVO.getService().equalsIgnoreCase(service)) {
inlist = true;
break;
}
}
if (!inlist) {
// behaviour of network.
if (!serviceVO.getService().equalsIgnoreCase(Service.Gateway.getName()))
servicesNotInNewOffering.add(serviceVO.getService());
}
}
return servicesNotInNewOffering;
}
use of com.cloud.network.dao.NetworkServiceMapVO in project cloudstack by apache.
the class NetworkOrchestrator method getServiceProvidersMap.
private Map<Service, Set<Provider>> getServiceProvidersMap(final long networkId) {
final Map<Service, Set<Provider>> map = new HashMap<Service, Set<Provider>>();
final List<NetworkServiceMapVO> nsms = _ntwkSrvcDao.getServicesInNetwork(networkId);
for (final NetworkServiceMapVO nsm : nsms) {
Set<Provider> providers = map.get(Service.getService(nsm.getService()));
if (providers == null) {
providers = new HashSet<Provider>();
}
providers.add(Provider.getProvider(nsm.getProvider()));
map.put(Service.getService(nsm.getService()), providers);
}
return map;
}
use of com.cloud.network.dao.NetworkServiceMapVO in project cloudstack by apache.
the class NetworkModelImpl method getProviderServicesMap.
Map<Provider, Set<Service>> getProviderServicesMap(long networkId) {
Map<Provider, Set<Service>> map = new HashMap<Provider, Set<Service>>();
List<NetworkServiceMapVO> nsms = _ntwkSrvcDao.getServicesInNetwork(networkId);
for (NetworkServiceMapVO nsm : nsms) {
Set<Service> services = map.get(Provider.getProvider(nsm.getProvider()));
if (services == null) {
services = new HashSet<Service>();
}
services.add(Service.getService(nsm.getService()));
map.put(Provider.getProvider(nsm.getProvider()), services);
}
return map;
}
Aggregations