Package com.cloud.network.dao

Examples of com.cloud.network.dao.NetworkDao


    }

    private void setServiceInstanceNics(ModelController controller, VMInstanceVO instance) throws IOException {
        NicDao nicDao = controller.getNicDao();
        ContrailManager manager = controller.getManager();
        NetworkDao networkDao = controller.getNetworkDao();

        List<NicVO> nics = nicDao.listByVmId(_instanceId);
        for (NicVO nic : nics) {
            String tag;

            switch (nic.getDeviceId()) {
                case 0:
                    tag = "management";
                    break;
                case 1:
                    tag = "left";
                    break;
                case 2:
                    tag = "right";
                    break;
                default:
                    tag = null;
            }

            VMInterfaceModel vmiModel = getVMInterface(nic.getUuid());
            if (vmiModel == null) {
                vmiModel = new VMInterfaceModel(nic.getUuid());
                vmiModel.addToVirtualMachine(this);
                NetworkVO network = networkDao.findById(nic.getNetworkId());
                VirtualNetworkModel vnModel = manager.getDatabase().lookupVirtualNetwork(network.getUuid(), manager.getCanonicalName(network), network.getTrafficType());
                assert vnModel != null;
                vmiModel.addToVirtualNetwork(vnModel);
            }
            vmiModel.setProperties(controller, instance, nic);
View Full Code Here


    }
   
    private void setServiceInstanceNics(ModelController controller, VMInstanceVO instance) throws IOException {
        NicDao nicDao = controller.getNicDao();
        ContrailManager manager = controller.getManager();
        NetworkDao networkDao = controller.getNetworkDao();
       
        List<NicVO> nics = nicDao.listByVmId(_instanceId);
        for (NicVO nic : nics) {
            String tag;
           
            switch (nic.getDeviceId()) {
            case 0:
                tag = "management";
                break;
            case 1:
                tag = "left";
                break;
            case 2:
                tag = "right";
                break;
            default:
                tag = null;
            }

            VMInterfaceModel vmiModel = getVMInterface(nic.getUuid());
            if (vmiModel == null) {
                vmiModel = new VMInterfaceModel(nic.getUuid());
                vmiModel.addToVirtualMachine(this);
                NetworkVO network = networkDao.findById(nic.getNetworkId());
                VirtualNetworkModel vnModel = manager.getDatabase().lookupVirtualNetwork(
                        network.getUuid(), manager.getCanonicalName(network), network.getTrafficType());
                assert vnModel != null;
                vmiModel.addToVirtualNetwork(vnModel);
            }
View Full Code Here

TOP

Related Classes of com.cloud.network.dao.NetworkDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.