corsa support intent
Change-Id: I6eaa46d1ef39405defa3b0661e94d1cf285db332
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java
index 33eceff..0358d29 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentFlowObjectivesCompiler.java
@@ -33,7 +33,10 @@
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.flowobjective.DefaultForwardingObjective;
+import org.onosproject.net.flowobjective.DefaultNextObjective;
+import org.onosproject.net.flowobjective.FlowObjectiveService;
import org.onosproject.net.flowobjective.ForwardingObjective;
+import org.onosproject.net.flowobjective.NextObjective;
import org.onosproject.net.flowobjective.Objective;
import org.onosproject.net.intent.FlowObjectiveIntent;
import org.onosproject.net.intent.Intent;
@@ -58,6 +61,9 @@
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected CoreService coreService;
+ @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+ protected FlowObjectiveService flowObjectiveService;
+
private ApplicationId appId;
@Activate
@@ -133,16 +139,22 @@
treatment = defaultTreatment;
}
- Objective objective = DefaultForwardingObjective.builder()
+ NextObjective nextObjective = DefaultNextObjective.builder()
+ .withId(flowObjectiveService.allocateNextId())
+ .addTreatment(treatment)
+ .withType(NextObjective.Type.SIMPLE)
+ .fromApp(appId)
+ .makePermanent().add();
+ objectives.add(nextObjective);
+
+ objectives.add(DefaultForwardingObjective.builder()
.withSelector(selector)
- .withTreatment(treatment)
+ .nextStep(nextObjective.id())
.withPriority(intent.priority())
.fromApp(appId)
.makePermanent()
.withFlag(ForwardingObjective.Flag.SPECIFIC)
- .add();
-
- objectives.add(objective);
+ .add());
}
return objectives;