Java 类com.vmware.vim25.HostFirewallInfo 实例源码

项目:cloudstack    文件:HostMO.java   
public void enableVncOnHostFirewall() throws Exception {
    HostFirewallSystemMO firewallMo = getHostFirewallSystemMO();
    boolean bRefresh = false;
    if (firewallMo != null) {
        HostFirewallInfo firewallInfo = firewallMo.getFirewallInfo();
        if (firewallInfo != null && firewallInfo.getRuleset() != null) {
            for (HostFirewallRuleset rule : firewallInfo.getRuleset()) {
                if ("vncServer".equalsIgnoreCase(rule.getKey())) {
                    bRefresh = true;
                    firewallMo.enableRuleset("vncServer");
                } else if ("gdbserver".equalsIgnoreCase(rule.getKey())) {
                    bRefresh = true;
                    firewallMo.enableRuleset("gdbserver");
                }
            }
        }

        if (bRefresh)
            firewallMo.refreshFirewall();
    }
}
项目:cloudstack    文件:HostFirewallSystemMO.java   
public HostFirewallInfo getFirewallInfo() throws Exception {
    return (HostFirewallInfo)_context.getVimClient().getDynamicProperty(_mor, "firewallInfo");
}