Search in sources :

Example 6 with NetworkModel

use of com.cloud.network.NetworkModel in project cloudstack by apache.

the class DhcpPvlanRules method accept.

@Override
public boolean accept(final NetworkTopologyVisitor visitor, final VirtualRouter router) throws ResourceUnavailableException {
    _router = router;
    String op = "add";
    if (!_isAddPvlan) {
        op = "delete";
    }
    NetworkDao networkDao = visitor.getVirtualNetworkApplianceFactory().getNetworkDao();
    final Network network = networkDao.findById(_nic.getNetworkId());
    NetworkModel networkModel = visitor.getVirtualNetworkApplianceFactory().getNetworkModel();
    final String networkTag = networkModel.getNetworkTag(_router.getHypervisorType(), network);
    _setupCommand = PvlanSetupCommand.createDhcpSetup(op, _nic.getBroadCastUri(), networkTag, _router.getInstanceName(), _nic.getMacAddress(), _nic.getIPv4Address());
    return visitor.visit(this);
}
Also used : NetworkDao(com.cloud.network.dao.NetworkDao) Network(com.cloud.network.Network) NetworkModel(com.cloud.network.NetworkModel)

Aggregations

NetworkModel (com.cloud.network.NetworkModel)6 Network (com.cloud.network.Network)3 VirtualMachineManager (com.cloud.vm.VirtualMachineManager)3 ConcurrentOperationException (com.cloud.exception.ConcurrentOperationException)2 LoadBalancerDao (com.cloud.network.dao.LoadBalancerDao)2 LoadBalancerVO (com.cloud.network.dao.LoadBalancerVO)2 LoadBalancingRule (com.cloud.network.lb.LoadBalancingRule)2 LbDestination (com.cloud.network.lb.LoadBalancingRule.LbDestination)2 LbHealthCheckPolicy (com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy)2 LbSslCert (com.cloud.network.lb.LoadBalancingRule.LbSslCert)2 LbStickinessPolicy (com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy)2 LoadBalancingRulesManager (com.cloud.network.lb.LoadBalancingRulesManager)2 Ip (com.cloud.utils.net.Ip)2 NicProfile (com.cloud.vm.NicProfile)2 NetworkUsageCommand (com.cloud.agent.api.NetworkUsageCommand)1 Commands (com.cloud.agent.manager.Commands)1 InsufficientCapacityException (com.cloud.exception.InsufficientCapacityException)1 ResourceUnavailableException (com.cloud.exception.ResourceUnavailableException)1 PublicIpAddress (com.cloud.network.PublicIpAddress)1 NetworkDao (com.cloud.network.dao.NetworkDao)1