System.out.println("Cannot find the host:" + hostname);
si.getServerConnection().logout();
return;
}
HostFirewallSystem hss = host.getHostFirewallSystem();
HostFirewallInfo hsi = hss.getFirewallInfo();
System.out.println("Default Firewall Policy:");
HostFirewallDefaultPolicy defPolicy = hsi.getDefaultPolicy();
System.out.println("IncomingBlocked:"
+ defPolicy.getIncomingBlocked());
System.out.println("OutgoingBlocked:"
+ defPolicy.getOutgoingBlocked());
HostFirewallRuleset[] rs = hsi.getRuleset();
for(int i=0; rs!=null && i<rs.length; i++)
{
printRuleSet(rs[i]);
if(!rs[i].isEnabled())
{
hss.enableRuleset(rs[i].getKey());
}
}
}