blob: bb896c8dd7802210ff360a17436c1b779fef1865 [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 Koidea03915e2014-07-01 18:39:52 -07005import java.util.Set;
6
Ray Milkey42ae1b52014-08-15 16:37:06 -07007import net.onrc.onos.core.matchaction.MatchActionOperations;
Toshio Koidea03915e2014-07-01 18:39:52 -07008import net.onrc.onos.core.matchaction.action.OutputAction;
9import net.onrc.onos.core.matchaction.match.PacketMatch;
10import net.onrc.onos.core.util.Dpid;
11import net.onrc.onos.core.util.Pair;
12import net.onrc.onos.core.util.SwitchPort;
13
14/**
Toshio Koide7894ca02014-08-15 14:30:13 -070015 * A Flow object expressing the point-to-multipoints tree flow for the packet
Toshio Koidea03915e2014-07-01 18:39:52 -070016 * layer.
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070017 * <p>
18 * NOTE: This class is not fully supported for the August release.
Toshio Koidea03915e2014-07-01 18:39:52 -070019 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070020public class SingleSrcTreeFlow extends Flow {
Toshio Koidea03915e2014-07-01 18:39:52 -070021 protected PacketMatch match;
22 protected SwitchPort ingressPort;
23 protected Tree tree;
24 protected Set<Pair<Dpid, OutputAction>> outputActions;
25
26 /**
27 * Creates new instance using Tree object.
28 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070029 * @param id ID for this object
30 * @param match the traffic filter for the tree
31 * @param ingressPort an ingress port of the tree
32 * @param tree the tree object specifying tree topology for this object
33 * @param outputActions the set of the pairs of the switch DPID and
34 * OutputAction object at the egress edge switchs
Toshio Koidea03915e2014-07-01 18:39:52 -070035 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070036 public SingleSrcTreeFlow(FlowId id, PacketMatch match,
Toshio Koidea03915e2014-07-01 18:39:52 -070037 SwitchPort ingressPort, Tree tree, Set<Pair<Dpid, OutputAction>> outputActions) {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070038 super(id);
39 this.match = checkNotNull(match);
40 this.ingressPort = checkNotNull(ingressPort);
41 this.tree = checkNotNull(tree);
42 this.outputActions = checkNotNull(outputActions);
Toshio Koidea03915e2014-07-01 18:39:52 -070043
44 // TODO: check if the tree is a P2MP tree.
45 // TODO: check consistency among rootPort, tree, and actions.
46 }
47
48 @Override
Toshio Koidea03915e2014-07-01 18:39:52 -070049 public PacketMatch getMatch() {
50 return match;
51 }
52
53 @Override
Ray Milkey42ae1b52014-08-15 16:37:06 -070054 public MatchActionOperations compile() {
Toshio Koidea03915e2014-07-01 18:39:52 -070055 // TODO Auto-generated method stub
56 return null;
57 }
58
59 /**
60 * Gets the ingress port (the root) of the tree.
61 *
62 * @return The ingress port of the tree.
63 */
64 public SwitchPort getIngressPort() {
65 return ingressPort;
66 }
67
68 /**
69 * Gets the tree.
70 *
71 * @return The tree object.
72 */
73 public Tree getTree() {
74 return tree;
75 }
76
77 /**
78 * Gets the output actions for the tree.
79 *
80 * @return The set of the pairs of Dpid and OutputAction object.
81 */
Toshio Koidec963a8d2014-07-21 17:47:48 -070082 public Set<Pair<Dpid, OutputAction>> getOutputActions() {
Toshio Koidea03915e2014-07-01 18:39:52 -070083 return outputActions;
84 }
85}