blob: 48053ef731733737f010a15552031ba665727f35 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
3import java.util.List;
4
5import net.onrc.onos.core.matchaction.MatchActionPlan;
6import net.onrc.onos.core.matchaction.action.IAction;
7import net.onrc.onos.core.matchaction.match.IMatch;
8import 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 */
16public class PathFlow implements IFlow {
Toshio Koide025a9152014-07-21 11:00:34 -070017 protected final FlowId id;
Toshio Koidea03915e2014-07-01 18:39:52 -070018 protected IMatch match;
19 protected PortNumber ingressPort;
20 protected Path path;
Toshio Koidec963a8d2014-07-21 17:47:48 -070021 protected List<IAction> 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 Koidec963a8d2014-07-21 17:47:48 -070031 * @param egressActions The list of IAction objects at the egress edge node.
Toshio Koidea03915e2014-07-01 18:39:52 -070032 */
33 public PathFlow(String id,
Toshio Koidec963a8d2014-07-21 17:47:48 -070034 IMatch match, PortNumber ingressPort, Path path, List<IAction> 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
48 public IMatch getMatch() {
49 return match;
50 }
51
52 @Override
53 public MatchActionPlan compile() {
54 // 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 /**
77 * Gets the list of IAction objects at the egress edge node.
78 *
79 * @return The list of IAction objects at the egress edge node.
80 */
Toshio Koidec963a8d2014-07-21 17:47:48 -070081 public List<IAction> getEgressActions() {
82 return egressActions;
Toshio Koidea03915e2014-07-01 18:39:52 -070083 }
84}