blob: d1b10f64f5636e0a2199ff1cee26e8672d74b5fc [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
3import java.util.List;
4
Ray Milkey42ae1b52014-08-15 16:37:06 -07005import net.onrc.onos.core.matchaction.MatchActionOperations;
Toshio Koided8b077a2014-08-13 10:47:21 -07006import net.onrc.onos.core.matchaction.action.Action;
7import net.onrc.onos.core.matchaction.match.Match;
Toshio Koidea03915e2014-07-01 18:39:52 -07008import net.onrc.onos.core.util.PortNumber;
9
10/**
11 * A path flow.
12 * <p>
13 * TODO: Think this: Should this class be an abstract class? Is it enough to
14 * have only the PacketPathFlow and OpticalPathFlow classes?
15 */
Toshio Koidefad1cd52014-08-07 17:10:07 -070016public class PathFlow implements Flow {
Toshio Koide025a9152014-07-21 11:00:34 -070017 protected final FlowId id;
Toshio Koided8b077a2014-08-13 10:47:21 -070018 protected Match match;
Toshio Koidea03915e2014-07-01 18:39:52 -070019 protected PortNumber ingressPort;
20 protected Path path;
Toshio Koided8b077a2014-08-13 10:47:21 -070021 protected List<Action> egressActions;
Toshio Koidea03915e2014-07-01 18:39:52 -070022
23 /**
24 * Constructor.
25 *
26 * @param id ID for this new PathFlow object.
27 * @param match Match object at the ingress node of the path.
28 * @param ingressPort The ingress port number at the ingress node of the
29 * path.
30 * @param path Path between ingress and egress edge node.
Toshio Koided8b077a2014-08-13 10:47:21 -070031 * @param egressActions The list of Action objects at the egress edge node.
Toshio Koidea03915e2014-07-01 18:39:52 -070032 */
33 public PathFlow(String id,
Toshio Koided8b077a2014-08-13 10:47:21 -070034 Match match, PortNumber ingressPort, Path path, List<Action> egressActions) {
Toshio Koide025a9152014-07-21 11:00:34 -070035 this.id = new FlowId(id);
Toshio Koidea03915e2014-07-01 18:39:52 -070036 this.match = match;
37 this.ingressPort = ingressPort;
38 this.path = path;
Toshio Koidec963a8d2014-07-21 17:47:48 -070039 this.egressActions = egressActions;
Toshio Koidea03915e2014-07-01 18:39:52 -070040 }
41
42 @Override
Toshio Koide025a9152014-07-21 11:00:34 -070043 public FlowId getId() {
Toshio Koidea03915e2014-07-01 18:39:52 -070044 return id;
45 }
46
47 @Override
Toshio Koided8b077a2014-08-13 10:47:21 -070048 public Match getMatch() {
Toshio Koidea03915e2014-07-01 18:39:52 -070049 return match;
50 }
51
52 @Override
Ray Milkey42ae1b52014-08-15 16:37:06 -070053 public MatchActionOperations compile() {
Toshio Koidea03915e2014-07-01 18:39:52 -070054 // TODO Auto-generated method stub
55 return null;
56 }
57
58 /**
59 * Gets the ingress port number at the ingress node of the path.
60 *
61 * @return The ingress port number at the ingress node of the path.
62 */
63 public PortNumber getIngressPortNumber() {
64 return ingressPort;
65 }
66
67 /**
68 * Gets the path from ingress to egress edge node.
69 *
70 * @return The path object from ingress to egress edge node.
71 */
72 public Path getPath() {
73 return path;
74 }
75
76 /**
Toshio Koided8b077a2014-08-13 10:47:21 -070077 * Gets the list of Action objects at the egress edge node.
Toshio Koidea03915e2014-07-01 18:39:52 -070078 *
Toshio Koided8b077a2014-08-13 10:47:21 -070079 * @return The list of Action objects at the egress edge node.
Toshio Koidea03915e2014-07-01 18:39:52 -070080 */
Toshio Koided8b077a2014-08-13 10:47:21 -070081 public List<Action> getEgressActions() {
Toshio Koidec963a8d2014-07-21 17:47:48 -070082 return egressActions;
Toshio Koidea03915e2014-07-01 18:39:52 -070083 }
84}