Package org.apache.cloudstack.network.contrail.model

Examples of org.apache.cloudstack.network.contrail.model.NetworkPolicyModel


    }

    public Boolean equalNetworkPolicy(NetworkACLVO db, NetworkPolicy policy, StringBuffer syncLogMesg) {
        syncLogMesg.append("Policy# DB: " + db.getName() +
                "; VNC: " + policy.getName() + "; action: equal\n");
        NetworkPolicyModel current = _manager.getDatabase().lookupNetworkPolicy(policy.getUuid());
        NetworkPolicyModel policyModel = new NetworkPolicyModel(db.getUuid(), db.getName());
        net.juniper.contrail.api.types.Project project = null;
        try {
            project = _manager.getDefaultVncProject();
        } catch (IOException ex) {
            s_logger.warn("read project", ex);
        }
        policyModel.setProject(project);
        List<NetworkACLItemVO> rules = _networkACLItemDao.listByACL(db.getId());
        try {
            policyModel.build(_manager.getModelController(), rules);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (_rw_mode) {
            if (current != null) {
                _manager.getDatabase().getNetworkPolicys().remove(current);
            }
            s_logger.debug("add policy model " + policyModel.getName());
            _manager.getDatabase().getNetworkPolicys().add(policyModel);  
            try {
                if (!policyModel.verify(_manager.getModelController())) {
                    policyModel.update(_manager.getModelController());
                }
            } catch (Exception ex) {
                s_logger.warn("update network-policy", ex);
            }
        } else {
View Full Code Here

TOP

Related Classes of org.apache.cloudstack.network.contrail.model.NetworkPolicyModel

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.