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);
}
Aggregations