use of com.cloud.agent.resource.virtualnetwork.model.StaticNatRules in project cloudstack by apache.
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(), rule.getStringSrcPortRange(), rule.getDstIp());
rules.add(staticNatRule);
}
final StaticNatRules staticNatRules = new StaticNatRules(rules);
return generateConfigItems(staticNatRules);
}
use of com.cloud.agent.resource.virtualnetwork.model.StaticNatRules 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(), rule.getStringSrcPortRange(), rule.getDstIp());
rules.add(staticNatRule);
}
final StaticNatRules staticNatRules = new StaticNatRules(rules);
return generateConfigItems(staticNatRules);
}
Aggregations