/* (non-Javadoc) * @see com.cloud.utils.component.Manager#start() */ @Override public boolean start() { for (NetworkElement element : _networkElements) { Provider implementedProvider = element.getProvider(); if (implementedProvider != null) { if (s_providerToNetworkElementMap.containsKey(implementedProvider.getName())) { s_logger.error( "Cannot start MapNetworkManager: Provider <-> NetworkElement must be a one-to-one map, " + "multiple NetworkElements found for Provider: " + implementedProvider.getName()); return false; } s_providerToNetworkElementMap.put(implementedProvider.getName(), element.getName()); } } return true; }
@Override public Provider getProvider() { Provider provider = null; synchronized (s_SSP_NAME) { provider = Provider.getProvider(s_SSP_NAME); if (provider == null) { provider = new Provider(s_SSP_NAME, true); s_logger.debug("registering Network.Provider " + s_SSP_NAME); } } return provider; }
@Override @DB public void persistNetworkServiceProviders( long networkId, Map<String, String> serviceProviderMap) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); for (String service : serviceProviderMap.keySet()) { NetworkServiceMapVO serviceMap = new NetworkServiceMapVO( networkId, Service.getService(service), Provider.getProvider(serviceProviderMap.get(service))); _ntwkSvcMap.persist(serviceMap); } txn.commit(); }