blob: b4364c6668c9749ced26bbe243fa955950be6152 [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
43 /**
44 * Gets idle-timeout value.
45 *
46 * @return Idle-timeout value (seconds)
47 */
48 public int getIdleTimeout() {
49 return idleTimeout;
50 }
51
52 /**
53 * Gets hard-timeout value.
54 *
55 * @return Hard-timeout value (seconds)
56 */
57 public int getHardTimeout() {
58 return hardTimeout;
59 }
60
61 @Override
Toshio Koide5c5ca102014-08-19 00:49:52 -070062 public PacketMatch getMatch() {
63 return match;
64 }
65
66 @Override
67 public List<MatchActionOperations> compile(FlowBatchOperation.Operator op) {
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}