Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.flowmanager; |
| 2 | |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 3 | import static com.google.common.base.Preconditions.checkNotNull; |
| 4 | |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 5 | import java.util.List; |
| 6 | |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 7 | import net.onrc.onos.core.matchaction.action.Action; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 8 | import net.onrc.onos.core.util.PortNumber; |
| 9 | |
| 10 | /** |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 11 | * An abstract class expressing a path flow. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 12 | */ |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 13 | public abstract class PathFlow extends Flow { |
| 14 | private final PortNumber ingressPort; |
| 15 | private final Path path; |
| 16 | private final List<Action> egressActions; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 17 | |
| 18 | /** |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 19 | * Creates the new flow instance. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 20 | * |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 21 | * @param id ID for this new PathFlow object |
| 22 | * @param ingressPort the ingress port number at the ingress node of the |
| 23 | * path |
| 24 | * @param path the Path between ingress and egress edge node |
| 25 | * @param egressActions the list of Action objects at the egress edge node |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 26 | */ |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 27 | public PathFlow(FlowId id, |
| 28 | PortNumber ingressPort, Path path, List<Action> egressActions) { |
| 29 | super(id); |
| 30 | this.ingressPort = checkNotNull(ingressPort); |
| 31 | this.path = checkNotNull(path); |
| 32 | this.egressActions = checkNotNull(egressActions); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Gets the ingress port number at the ingress node of the path. |
| 37 | * |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 38 | * @return the ingress port number at the ingress node of the path |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 39 | */ |
| 40 | public PortNumber getIngressPortNumber() { |
| 41 | return ingressPort; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Gets the path from ingress to egress edge node. |
| 46 | * |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 47 | * @return the path object from ingress to egress edge node |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 48 | */ |
| 49 | public Path getPath() { |
| 50 | return path; |
| 51 | } |
| 52 | |
| 53 | /** |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 54 | * Gets the list of Action objects at the egress edge node. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 55 | * |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame^] | 56 | * @return the list of Action objects at the egress edge node |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 57 | */ |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 58 | public List<Action> getEgressActions() { |
Toshio Koide | c963a8d | 2014-07-21 17:47:48 -0700 | [diff] [blame] | 59 | return egressActions; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 60 | } |
| 61 | } |