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