Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.flowmanager; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
Ray Milkey | 42ae1b5 | 2014-08-15 16:37:06 -0700 | [diff] [blame^] | 5 | import net.onrc.onos.core.matchaction.MatchActionOperations; |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 6 | import net.onrc.onos.core.matchaction.action.Action; |
| 7 | import net.onrc.onos.core.matchaction.match.Match; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 8 | import 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 Koide | fad1cd5 | 2014-08-07 17:10:07 -0700 | [diff] [blame] | 16 | public class PathFlow implements Flow { |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 17 | protected final FlowId id; |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 18 | protected Match match; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 19 | protected PortNumber ingressPort; |
| 20 | protected Path path; |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 21 | protected List<Action> egressActions; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 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. |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 31 | * @param egressActions The list of Action objects at the egress edge node. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 32 | */ |
| 33 | public PathFlow(String id, |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 34 | Match match, PortNumber ingressPort, Path path, List<Action> egressActions) { |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 35 | this.id = new FlowId(id); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 36 | this.match = match; |
| 37 | this.ingressPort = ingressPort; |
| 38 | this.path = path; |
Toshio Koide | c963a8d | 2014-07-21 17:47:48 -0700 | [diff] [blame] | 39 | this.egressActions = egressActions; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | @Override |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 43 | public FlowId getId() { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 44 | return id; |
| 45 | } |
| 46 | |
| 47 | @Override |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 48 | public Match getMatch() { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 49 | return match; |
| 50 | } |
| 51 | |
| 52 | @Override |
Ray Milkey | 42ae1b5 | 2014-08-15 16:37:06 -0700 | [diff] [blame^] | 53 | public MatchActionOperations compile() { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 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 | /** |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 77 | * Gets the list of Action objects at the egress edge node. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 78 | * |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 79 | * @return The list of Action objects at the egress edge node. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 80 | */ |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 81 | public List<Action> getEgressActions() { |
Toshio Koide | c963a8d | 2014-07-21 17:47:48 -0700 | [diff] [blame] | 82 | return egressActions; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 83 | } |
| 84 | } |