Committed by
Gerrit Code Review
Inherit network resource information from a high level intent
This patch fixes ONOS-1677 Change-Id: I37d8742eb1a03b56d1e47d30d9342546ab42d23b
Showing
2 changed files
with
12 additions
and
1 deletions
... | @@ -46,6 +46,17 @@ public class FlowRuleIntent extends Intent { | ... | @@ -46,6 +46,17 @@ public class FlowRuleIntent extends Intent { |
46 | } | 46 | } |
47 | 47 | ||
48 | /** | 48 | /** |
49 | + * Creates a flow rule intent with the specified flow rules and resources. | ||
50 | + * | ||
51 | + * @param appId application id | ||
52 | + * @param flowRules flow rules to be set | ||
53 | + * @param resources network resource to be set | ||
54 | + */ | ||
55 | + public FlowRuleIntent(ApplicationId appId, List<FlowRule> flowRules, Collection<NetworkResource> resources) { | ||
56 | + this(appId, null, flowRules, resources); | ||
57 | + } | ||
58 | + | ||
59 | + /** | ||
49 | * Creates an flow rule intent with the specified key, flow rules to be set, and | 60 | * Creates an flow rule intent with the specified key, flow rules to be set, and |
50 | * required network resources. | 61 | * required network resources. |
51 | * | 62 | * | ... | ... |
... | @@ -88,7 +88,7 @@ public class OpticalPathIntentCompiler implements IntentCompiler<OpticalPathInte | ... | @@ -88,7 +88,7 @@ public class OpticalPathIntentCompiler implements IntentCompiler<OpticalPathInte |
88 | Set<LinkResourceAllocations> resources) { | 88 | Set<LinkResourceAllocations> resources) { |
89 | LinkResourceAllocations allocations = assignWavelength(intent); | 89 | LinkResourceAllocations allocations = assignWavelength(intent); |
90 | 90 | ||
91 | - return Arrays.asList(new FlowRuleIntent(appId, createRules(intent, allocations))); | 91 | + return Arrays.asList(new FlowRuleIntent(appId, createRules(intent, allocations), intent.resources())); |
92 | } | 92 | } |
93 | 93 | ||
94 | private LinkResourceAllocations assignWavelength(OpticalPathIntent intent) { | 94 | private LinkResourceAllocations assignWavelength(OpticalPathIntent intent) { | ... | ... |
-
Please register or login to post a comment