blob: baf163fbfb68b86c057351c62bd5a54026ea06e5 [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 {
17 protected final String id;
18 protected IMatch match;
19 protected PortNumber ingressPort;
20 protected Path path;
21 protected List<IAction> edgeActions;
22
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.
31 * @param edgeActions The list of IAction objects at the egress edge node.
32 */
33 public PathFlow(String id,
34 IMatch match, PortNumber ingressPort, Path path, List<IAction> edgeActions) {
35 this.id = id;
36 this.match = match;
37 this.ingressPort = ingressPort;
38 this.path = path;
39 this.edgeActions = edgeActions;
40 }
41
42 @Override
43 public String getId() {
44 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 */
81 public List<IAction> getActions() {
82 return edgeActions;
83 }
84}