protected boolean sendNetworkRulesToRouter(long routerId, long networkId)
throws ResourceUnavailableException {
DomainRouterVO router = _routerDao.findById(routerId);
Commands cmds = new Commands(OnError.Continue);
VirtualRouterProvider vrProvider = _vrProviderDao.findById(router.getElementId());
if (vrProvider == null) {
throw new CloudRuntimeException("Cannot find related virtual router provider of router: " + router.getHostName());
}
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 sendCommandsToRouter(router, cmds);
}