blob: 0cc35ce5e85d003021b4b9fdf34160d906235dc1 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.flowmanager;
2
Toshio Koide9aa4c0f2014-08-11 16:06:44 -07003import static com.google.common.base.Preconditions.checkNotNull;
4
Toshio Koidea03915e2014-07-01 18:39:52 -07005import java.util.List;
6
Toshio Koided8b077a2014-08-13 10:47:21 -07007import net.onrc.onos.core.matchaction.action.Action;
Toshio Koidea03915e2014-07-01 18:39:52 -07008import net.onrc.onos.core.util.PortNumber;
9
10/**
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070011 * An abstract class expressing a path flow.
Toshio Koidea03915e2014-07-01 18:39:52 -070012 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070013public abstract class PathFlow extends Flow {
14 private final PortNumber ingressPort;
15 private final Path path;
16 private final List<Action> egressActions;
Toshio Koidea03915e2014-07-01 18:39:52 -070017
18 /**
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070019 * Creates the new flow instance.
Toshio Koidea03915e2014-07-01 18:39:52 -070020 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070021 * @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 Koidea03915e2014-07-01 18:39:52 -070026 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070027 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 Koidea03915e2014-07-01 18:39:52 -070033 }
34
35 /**
36 * Gets the ingress port number at the ingress node of the path.
37 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070038 * @return the ingress port number at the ingress node of the path
Toshio Koidea03915e2014-07-01 18:39:52 -070039 */
40 public PortNumber getIngressPortNumber() {
41 return ingressPort;
42 }
43
44 /**
45 * Gets the path from ingress to egress edge node.
46 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070047 * @return the path object from ingress to egress edge node
Toshio Koidea03915e2014-07-01 18:39:52 -070048 */
49 public Path getPath() {
50 return path;
51 }
52
53 /**
Toshio Koided8b077a2014-08-13 10:47:21 -070054 * Gets the list of Action objects at the egress edge node.
Toshio Koidea03915e2014-07-01 18:39:52 -070055 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070056 * @return the list of Action objects at the egress edge node
Toshio Koidea03915e2014-07-01 18:39:52 -070057 */
Toshio Koided8b077a2014-08-13 10:47:21 -070058 public List<Action> getEgressActions() {
Toshio Koidec963a8d2014-07-21 17:47:48 -070059 return egressActions;
Toshio Koidea03915e2014-07-01 18:39:52 -070060 }
61}