blob: 8a15f3f65c4f70d1f1ac3ff225fa4d4a4a594d79 [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
Ray Milkey42ae1b52014-08-15 16:37:06 -07007import net.onrc.onos.core.matchaction.MatchActionOperations;
Toshio Koided8b077a2014-08-13 10:47:21 -07008import net.onrc.onos.core.matchaction.action.Action;
Toshio Koidea03915e2014-07-01 18:39:52 -07009import net.onrc.onos.core.matchaction.match.PacketMatch;
10import net.onrc.onos.core.util.PortNumber;
11
12/**
Toshio Koide7894ca02014-08-15 14:30:13 -070013 * Flow object representing a packet path.
Toshio Koidea03915e2014-07-01 18:39:52 -070014 * <p>
15 * TODO: Think this: Do we need a bandwidth constraint?
16 */
17public class PacketPathFlow extends PathFlow {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070018 private final PacketMatch match;
19 private final int hardTimeout;
20 private final int idleTimeout;
Toshio Koidea03915e2014-07-01 18:39:52 -070021
22 /**
23 * Constructor.
24 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070025 * @param id ID for this new Flow object
26 * @param match the Match object at the source node of the path
27 * @param ingressPort the Ingress port number at the ingress edge node
28 * @param path the Path between ingress and egress edge node
29 * @param egressActions the list of Action objects at the egress edge node
30 * @param hardTimeout the hard-timeout value in seconds, or 0 for no timeout
31 * @param idleTimeout the idle-timeout value in seconds, or 0 for no timeout
Toshio Koidea03915e2014-07-01 18:39:52 -070032 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070033 public PacketPathFlow(FlowId id,
34 PacketMatch match, PortNumber ingressPort, Path path,
35 List<Action> egressActions,
Toshio Koidea03915e2014-07-01 18:39:52 -070036 int hardTimeout, int idleTimeout) {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070037 super(id, ingressPort, path, egressActions);
38 this.match = checkNotNull(match);
Toshio Koidea03915e2014-07-01 18:39:52 -070039 this.hardTimeout = hardTimeout;
40 this.idleTimeout = idleTimeout;
41 }
42
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070043 @Override
44 public PacketMatch getMatch() {
45 return match;
46 }
47
Toshio Koidea03915e2014-07-01 18:39:52 -070048 /**
49 * Gets idle-timeout value.
50 *
51 * @return Idle-timeout value (seconds)
52 */
53 public int getIdleTimeout() {
54 return idleTimeout;
55 }
56
57 /**
58 * Gets hard-timeout value.
59 *
60 * @return Hard-timeout value (seconds)
61 */
62 public int getHardTimeout() {
63 return hardTimeout;
64 }
65
66 @Override
Ray Milkey42ae1b52014-08-15 16:37:06 -070067 public MatchActionOperations compile() {
Toshio Koidea03915e2014-07-01 18:39:52 -070068 // TODO Auto-generated method stub
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070069 return null;
Toshio Koidea03915e2014-07-01 18:39:52 -070070 }
71}