Sho SHIMIZU
Committed by Gerrit Code Review

Inherit resources from a high level intent when creating a FlowRuleIntent

Make constructor without resources argument deprecated

Change-Id: I400cedfb2ec5f8ec3217e4729d95b075ceb0b025
......@@ -41,6 +41,7 @@ public class FlowRuleIntent extends Intent {
* @param appId application id
* @param flowRules flow rules to be set.
*/
@Deprecated
public FlowRuleIntent(ApplicationId appId, List<FlowRule> flowRules) {
this(appId, null, flowRules, Collections.emptyList());
}
......
......@@ -104,7 +104,7 @@ public class LinkCollectionIntentCompiler implements IntentCompiler<LinkCollecti
for (DeviceId deviceId: outputPorts.keys()) {
rules.addAll(createRules(intent, deviceId, inputPorts.get(deviceId), outputPorts.get(deviceId)));
}
return Arrays.asList(new FlowRuleIntent(appId, rules));
return Arrays.asList(new FlowRuleIntent(appId, rules, intent.resources()));
}
private List<FlowRule> createRules(LinkCollectionIntent intent, DeviceId deviceId,
......
......@@ -86,7 +86,7 @@ public class MplsPathIntentCompiler implements IntentCompiler<MplsPathIntent> {
LinkResourceAllocations allocations = assignMplsLabel(intent);
List<FlowRule> rules = generateRules(intent, allocations);
return Arrays.asList(new FlowRuleIntent(appId, rules));
return Arrays.asList(new FlowRuleIntent(appId, rules, intent.resources()));
}
@Activate
......