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 { ...@@ -41,6 +41,7 @@ public class FlowRuleIntent extends Intent {
41 * @param appId application id 41 * @param appId application id
42 * @param flowRules flow rules to be set. 42 * @param flowRules flow rules to be set.
43 */ 43 */
44 + @Deprecated
44 public FlowRuleIntent(ApplicationId appId, List<FlowRule> flowRules) { 45 public FlowRuleIntent(ApplicationId appId, List<FlowRule> flowRules) {
45 this(appId, null, flowRules, Collections.emptyList()); 46 this(appId, null, flowRules, Collections.emptyList());
46 } 47 }
......
...@@ -104,7 +104,7 @@ public class LinkCollectionIntentCompiler implements IntentCompiler<LinkCollecti ...@@ -104,7 +104,7 @@ public class LinkCollectionIntentCompiler implements IntentCompiler<LinkCollecti
104 for (DeviceId deviceId: outputPorts.keys()) { 104 for (DeviceId deviceId: outputPorts.keys()) {
105 rules.addAll(createRules(intent, deviceId, inputPorts.get(deviceId), outputPorts.get(deviceId))); 105 rules.addAll(createRules(intent, deviceId, inputPorts.get(deviceId), outputPorts.get(deviceId)));
106 } 106 }
107 - return Arrays.asList(new FlowRuleIntent(appId, rules)); 107 + return Arrays.asList(new FlowRuleIntent(appId, rules, intent.resources()));
108 } 108 }
109 109
110 private List<FlowRule> createRules(LinkCollectionIntent intent, DeviceId deviceId, 110 private List<FlowRule> createRules(LinkCollectionIntent intent, DeviceId deviceId,
......
...@@ -86,7 +86,7 @@ public class MplsPathIntentCompiler implements IntentCompiler<MplsPathIntent> { ...@@ -86,7 +86,7 @@ public class MplsPathIntentCompiler implements IntentCompiler<MplsPathIntent> {
86 LinkResourceAllocations allocations = assignMplsLabel(intent); 86 LinkResourceAllocations allocations = assignMplsLabel(intent);
87 List<FlowRule> rules = generateRules(intent, allocations); 87 List<FlowRule> rules = generateRules(intent, allocations);
88 88
89 - return Arrays.asList(new FlowRuleIntent(appId, rules)); 89 + return Arrays.asList(new FlowRuleIntent(appId, rules, intent.resources()));
90 } 90 }
91 91
92 @Activate 92 @Activate
......