use of com.cloud.legacymodel.network.rules.StaticNatRule in project cosmic by MissionCriticalCloud.
the class SetStaticNatRulesConfigItem method generateConfig.
@Override
public List<ConfigItem> generateConfig(final NetworkElementCommand cmd) {
final SetStaticNatRulesCommand command = (SetStaticNatRulesCommand) cmd;
final LinkedList<StaticNatRule> rules = new LinkedList<>();
for (final StaticNatRuleTO rule : command.getRules()) {
final StaticNatRule staticNatRule = new StaticNatRule(rule.revoked(), rule.getProtocol(), rule.getSrcIp(), getStringSrcPortRange(rule), rule.getDstIp());
rules.add(staticNatRule);
}
final StaticNatRules staticNatRules = new StaticNatRules(rules);
return generateConfigItems(staticNatRules);
}
Aggregations