blob: 5b26a04e7fee64202d72425ec48255b70d15311d [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
Toshio Koide9aa4c0f2014-08-11 16:06:44 -07003import static com.google.common.base.Preconditions.checkNotNull;
4
Toshio Koide5c5ca102014-08-19 00:49:52 -07005import java.util.List;
Toshio Koidea03915e2014-07-01 18:39:52 -07006import java.util.Set;
7
Toshio Koided7d550c2014-08-21 16:08:55 -07008import net.onrc.onos.api.flowmanager.FlowBatchOperation.Operator;
9import net.onrc.onos.core.matchaction.MatchActionIdGenerator;
Ray Milkey42ae1b52014-08-15 16:37:06 -070010import net.onrc.onos.core.matchaction.MatchActionOperations;
Toshio Koided7d550c2014-08-21 16:08:55 -070011import net.onrc.onos.core.matchaction.MatchActionOperationsIdGenerator;
Toshio Koidea03915e2014-07-01 18:39:52 -070012import net.onrc.onos.core.matchaction.action.OutputAction;
13import net.onrc.onos.core.matchaction.match.PacketMatch;
14import net.onrc.onos.core.util.Dpid;
15import net.onrc.onos.core.util.Pair;
16import net.onrc.onos.core.util.SwitchPort;
17
18/**
Toshio Koide7894ca02014-08-15 14:30:13 -070019 * A Flow object expressing the point-to-multipoints tree flow for the packet
Toshio Koidea03915e2014-07-01 18:39:52 -070020 * layer.
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070021 * <p>
22 * NOTE: This class is not fully supported for the August release.
Toshio Koidea03915e2014-07-01 18:39:52 -070023 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070024public class SingleSrcTreeFlow extends Flow {
Toshio Koidea03915e2014-07-01 18:39:52 -070025 protected PacketMatch match;
26 protected SwitchPort ingressPort;
27 protected Tree tree;
28 protected Set<Pair<Dpid, OutputAction>> outputActions;
29
30 /**
31 * Creates new instance using Tree object.
32 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070033 * @param id ID for this object
34 * @param match the traffic filter for the tree
35 * @param ingressPort an ingress port of the tree
36 * @param tree the tree object specifying tree topology for this object
37 * @param outputActions the set of the pairs of the switch DPID and
38 * OutputAction object at the egress edge switchs
Toshio Koidea03915e2014-07-01 18:39:52 -070039 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070040 public SingleSrcTreeFlow(FlowId id, PacketMatch match,
Toshio Koidea03915e2014-07-01 18:39:52 -070041 SwitchPort ingressPort, Tree tree, Set<Pair<Dpid, OutputAction>> outputActions) {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070042 super(id);
43 this.match = checkNotNull(match);
44 this.ingressPort = checkNotNull(ingressPort);
45 this.tree = checkNotNull(tree);
46 this.outputActions = checkNotNull(outputActions);
Toshio Koidea03915e2014-07-01 18:39:52 -070047
48 // TODO: check if the tree is a P2MP tree.
49 // TODO: check consistency among rootPort, tree, and actions.
50 }
51
Toshio Koidea03915e2014-07-01 18:39:52 -070052 /**
53 * Gets the ingress port (the root) of the tree.
54 *
55 * @return The ingress port of the tree.
56 */
57 public SwitchPort getIngressPort() {
58 return ingressPort;
59 }
60
61 /**
62 * Gets the tree.
63 *
64 * @return The tree object.
65 */
66 public Tree getTree() {
67 return tree;
68 }
69
70 /**
71 * Gets the output actions for the tree.
72 *
73 * @return The set of the pairs of Dpid and OutputAction object.
74 */
Toshio Koidec963a8d2014-07-21 17:47:48 -070075 public Set<Pair<Dpid, OutputAction>> getOutputActions() {
Toshio Koidea03915e2014-07-01 18:39:52 -070076 return outputActions;
77 }
Toshio Koide5c5ca102014-08-19 00:49:52 -070078
79 @Override
80 public PacketMatch getMatch() {
81 return match;
82 }
83
84 @Override
Toshio Koided7d550c2014-08-21 16:08:55 -070085 public List<MatchActionOperations> compile(Operator op,
86 MatchActionIdGenerator maIdGenerator,
87 MatchActionOperationsIdGenerator maoIdGenerator) {
Toshio Koide5c5ca102014-08-19 00:49:52 -070088 // TODO Auto-generated method stub
89 return null;
90 }
Toshio Koidea03915e2014-07-01 18:39:52 -070091}