Added a TrafficTreatment to the filtering objective to cover those
pipelines where the filtering action is accompanied by a corresponding
change to the permitted packet. Fixed Filtering Objective javadocs.
Change-Id: I7f3c1a1a3553c0fdbfe5e7e48c6426cde1602efd
diff --git a/core/api/src/main/java/org/onosproject/net/flowobjective/DefaultFilteringObjective.java b/core/api/src/main/java/org/onosproject/net/flowobjective/DefaultFilteringObjective.java
index 7b5924f..06305bf 100644
--- a/core/api/src/main/java/org/onosproject/net/flowobjective/DefaultFilteringObjective.java
+++ b/core/api/src/main/java/org/onosproject/net/flowobjective/DefaultFilteringObjective.java
@@ -18,6 +18,7 @@
import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableList;
import org.onosproject.core.ApplicationId;
+import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.flow.criteria.Criteria;
import org.onosproject.net.flow.criteria.Criterion;
@@ -46,6 +47,7 @@
private final int id;
private final Operation op;
private final Optional<ObjectiveContext> context;
+ private final TrafficTreatment meta;
private DefaultFilteringObjective(Builder builder) {
this.key = builder.key;
@@ -57,6 +59,7 @@
this.conditions = builder.conditions;
this.op = builder.op;
this.context = Optional.ofNullable(builder.context);
+ this.meta = builder.meta;
this.id = Objects.hash(type, key, conditions, permanent,
timeout, appId, priority);
@@ -83,6 +86,12 @@
}
@Override
+ public TrafficTreatment meta() {
+ return meta;
+ }
+
+
+ @Override
public int priority() {
return priority;
}
@@ -135,6 +144,7 @@
private List<Criterion> conditions;
private Operation op;
private ObjectiveContext context;
+ private TrafficTreatment meta;
@Override
public Builder withKey(Criterion key) {
@@ -186,6 +196,12 @@
}
@Override
+ public Builder setMeta(TrafficTreatment treatment) {
+ this.meta = treatment;
+ return this;
+ }
+
+ @Override
public FilteringObjective add() {
conditions = listBuilder.build();
op = Operation.ADD;