Sho SHIMIZU
Committed by Gerrit Code Review

Inherit network resource information from a high level intent

This patch fixes ONOS-1677

Change-Id: I37d8742eb1a03b56d1e47d30d9342546ab42d23b
......@@ -46,6 +46,17 @@ public class FlowRuleIntent extends Intent {
}
/**
* Creates a flow rule intent with the specified flow rules and resources.
*
* @param appId application id
* @param flowRules flow rules to be set
* @param resources network resource to be set
*/
public FlowRuleIntent(ApplicationId appId, List<FlowRule> flowRules, Collection<NetworkResource> resources) {
this(appId, null, flowRules, resources);
}
/**
* Creates an flow rule intent with the specified key, flow rules to be set, and
* required network resources.
*
......
......@@ -88,7 +88,7 @@ public class OpticalPathIntentCompiler implements IntentCompiler<OpticalPathInte
Set<LinkResourceAllocations> resources) {
LinkResourceAllocations allocations = assignWavelength(intent);
return Arrays.asList(new FlowRuleIntent(appId, createRules(intent, allocations)));
return Arrays.asList(new FlowRuleIntent(appId, createRules(intent, allocations), intent.resources()));
}
private LinkResourceAllocations assignWavelength(OpticalPathIntent intent) {
......