[AETHER-599] Implement FabricPipelineTraceable
Core changes supporting fabric traceable implementation.
Includes minor fixes to the OFDPA traceable unit tests
Change-Id: I2f0d1172022a8fc725df9e96526092c59ddc0e0b
diff --git a/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java b/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java
index 2403c5e..8df5d95 100644
--- a/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java
+++ b/core/api/src/main/java/org/onosproject/net/PipelineTraceableInput.java
@@ -20,7 +20,6 @@
import com.google.common.collect.Maps;
import org.onosproject.core.GroupId;
import org.onosproject.net.flow.FlowEntry;
-import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.group.Group;
import java.util.List;
@@ -29,20 +28,29 @@
/**
* Represents the input of the pipeline traceable processing.
*/
-public class PipelineTraceableInput {
+public final class PipelineTraceableInput {
// Input state for the traceable behavior
- TrafficSelector ingressPacket;
- ConnectPoint ingressPort;
+ private PipelineTraceablePacket ingressPacket;
+ private ConnectPoint ingressPort;
// List here all possible device state using
// possibly an optimized reference
- List<FlowEntry> flows = Lists.newArrayList();
- Map<GroupId, Group> groups = Maps.newHashMap();
+ private List<FlowEntry> flows = Lists.newArrayList();
+ private Map<GroupId, Group> groups = Maps.newHashMap();
+ private List<DataPlaneEntity> deviceState;
- public PipelineTraceableInput(TrafficSelector ingressPacket, ConnectPoint ingressPort,
+ /**
+ * Builds a pipeline traceable input.
+ *
+ * @param ingressPacket the input packet
+ * @param ingressPort the input port
+ * @param deviceState the device state
+ */
+ public PipelineTraceableInput(PipelineTraceablePacket ingressPacket, ConnectPoint ingressPort,
List<DataPlaneEntity> deviceState) {
this.ingressPacket = ingressPacket;
this.ingressPort = ingressPort;
+ this.deviceState = deviceState;
processDeviceState(deviceState);
}
@@ -62,7 +70,7 @@
*
* @return the ingress packet
*/
- public TrafficSelector ingressPacket() {
+ public PipelineTraceablePacket ingressPacket() {
return ingressPacket;
}
@@ -76,6 +84,15 @@
}
/**
+ * Getter for the device state.
+ *
+ * @return the device state
+ */
+ public List<DataPlaneEntity> deviceState() {
+ return deviceState;
+ }
+
+ /**
* Getter for the flows.
*
* @return the flows
@@ -99,7 +116,7 @@
* @param groupId the group id
* @return the group, otherwise null.
*/
- public Group getGroup(GroupId groupId) {
+ public Group groupById(GroupId groupId) {
return groups.get(groupId);
}