Skeletons for Intent-runtime, Flow-manager and Match-action modules.
This task is a part of ONOS-1395.
(Sub-tasks: ONOS-1397, ONOS-1398, ONOS-1400)
Change-Id: I30064f658b6c193aee8419079dad380163364475
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java b/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java
new file mode 100644
index 0000000..cecb605
--- /dev/null
+++ b/src/main/java/net/onrc/onos/api/flowmanager/SingleSrcTreeFlow.java
@@ -0,0 +1,87 @@
+package net.onrc.onos.api.flowmanager;
+
+import java.util.Set;
+
+import net.onrc.onos.core.matchaction.MatchActionPlan;
+import net.onrc.onos.core.matchaction.action.OutputAction;
+import net.onrc.onos.core.matchaction.match.PacketMatch;
+import net.onrc.onos.core.util.Dpid;
+import net.onrc.onos.core.util.Pair;
+import net.onrc.onos.core.util.SwitchPort;
+
+/**
+ * An IFlow object expressing the point-to-multipoints tree flow for the packet
+ * layer.
+ */
+public class SingleSrcTreeFlow implements IFlow {
+ protected String id;
+ protected PacketMatch match;
+ protected SwitchPort ingressPort;
+ protected Tree tree;
+ protected Set<Pair<Dpid, OutputAction>> outputActions;
+
+ /**
+ * Creates new instance using Tree object.
+ *
+ * @param id ID for this object.
+ * @param match Traffic filter for the tree.
+ * @param ingressPort A ingress port of the tree.
+ * @param tree Tree object specifying tree topology for this object.
+ * @param outputActions The set of the pairs of the switch DPID and
+ * OutputAction object at the egress edge switchs.
+ */
+ public SingleSrcTreeFlow(String id, PacketMatch match,
+ SwitchPort ingressPort, Tree tree, Set<Pair<Dpid, OutputAction>> outputActions) {
+ this.id = id;
+ this.match = match;
+ this.ingressPort = ingressPort;
+ this.tree = tree;
+ this.outputActions = outputActions;
+
+ // TODO: check if the tree is a P2MP tree.
+ // TODO: check consistency among rootPort, tree, and actions.
+ }
+
+ @Override
+ public String getId() {
+ return id;
+ }
+
+ @Override
+ public PacketMatch getMatch() {
+ return match;
+ }
+
+ @Override
+ public MatchActionPlan compile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /**
+ * Gets the ingress port (the root) of the tree.
+ *
+ * @return The ingress port of the tree.
+ */
+ public SwitchPort getIngressPort() {
+ return ingressPort;
+ }
+
+ /**
+ * Gets the tree.
+ *
+ * @return The tree object.
+ */
+ public Tree getTree() {
+ return tree;
+ }
+
+ /**
+ * Gets the output actions for the tree.
+ *
+ * @return The set of the pairs of Dpid and OutputAction object.
+ */
+ public Set<Pair<Dpid, OutputAction>> getActions() {
+ return outputActions;
+ }
+}