use of com.cloud.network.Network.Provider in project cloudstack by apache.
the class VpcVirtualNetworkApplianceManagerImpl method sendNetworkRulesToRouter.
protected boolean sendNetworkRulesToRouter(final long routerId, final long networkId) throws ResourceUnavailableException {
final DomainRouterVO router = _routerDao.findById(routerId);
final Commands cmds = new Commands(OnError.Continue);
final VirtualRouterProvider vrProvider = _vrProviderDao.findById(router.getElementId());
if (vrProvider == null) {
throw new CloudRuntimeException("Cannot find related virtual router provider of router: " + router.getHostName());
}
final Provider provider = Network.Provider.getProvider(vrProvider.getType().toString());
if (provider == null) {
throw new CloudRuntimeException("Cannot find related provider of virtual router provider: " + vrProvider.getType().toString());
}
finalizeNetworkRulesForNetwork(cmds, router, provider, networkId);
return _nwHelper.sendCommandsToRouter(router, cmds);
}
Aggregations