blob: ce1fdb49f4ae76da4defa952b48cd22f2f1eb956 [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 Koided7d550c2014-08-21 16:08:55 -07007import net.onrc.onos.api.flowmanager.FlowBatchOperation.Operator;
8import net.onrc.onos.core.matchaction.MatchActionIdGenerator;
Ray Milkey42ae1b52014-08-15 16:37:06 -07009import net.onrc.onos.core.matchaction.MatchActionOperations;
Toshio Koided7d550c2014-08-21 16:08:55 -070010import net.onrc.onos.core.matchaction.MatchActionOperationsIdGenerator;
Toshio Koided8b077a2014-08-13 10:47:21 -070011import net.onrc.onos.core.matchaction.action.Action;
Toshio Koidea03915e2014-07-01 18:39:52 -070012import net.onrc.onos.core.matchaction.match.PacketMatch;
13import net.onrc.onos.core.util.PortNumber;
14
15/**
Toshio Koide7894ca02014-08-15 14:30:13 -070016 * Flow object representing a packet path.
Toshio Koidea03915e2014-07-01 18:39:52 -070017 * <p>
18 * TODO: Think this: Do we need a bandwidth constraint?
19 */
20public class PacketPathFlow extends PathFlow {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070021 private final PacketMatch match;
22 private final int hardTimeout;
23 private final int idleTimeout;
Toshio Koidea03915e2014-07-01 18:39:52 -070024
25 /**
26 * Constructor.
27 *
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070028 * @param id ID for this new Flow object
29 * @param match the Match object at the source node of the path
30 * @param ingressPort the Ingress port number at the ingress edge node
31 * @param path the Path between ingress and egress edge node
32 * @param egressActions the list of Action objects at the egress edge node
33 * @param hardTimeout the hard-timeout value in seconds, or 0 for no timeout
34 * @param idleTimeout the idle-timeout value in seconds, or 0 for no timeout
Toshio Koidea03915e2014-07-01 18:39:52 -070035 */
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070036 public PacketPathFlow(FlowId id,
37 PacketMatch match, PortNumber ingressPort, Path path,
38 List<Action> egressActions,
Toshio Koidea03915e2014-07-01 18:39:52 -070039 int hardTimeout, int idleTimeout) {
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070040 super(id, ingressPort, path, egressActions);
41 this.match = checkNotNull(match);
Toshio Koidea03915e2014-07-01 18:39:52 -070042 this.hardTimeout = hardTimeout;
43 this.idleTimeout = idleTimeout;
44 }
45
46 /**
47 * Gets idle-timeout value.
48 *
49 * @return Idle-timeout value (seconds)
50 */
51 public int getIdleTimeout() {
52 return idleTimeout;
53 }
54
55 /**
56 * Gets hard-timeout value.
57 *
58 * @return Hard-timeout value (seconds)
59 */
60 public int getHardTimeout() {
61 return hardTimeout;
62 }
63
64 @Override
Toshio Koide5c5ca102014-08-19 00:49:52 -070065 public PacketMatch getMatch() {
66 return match;
67 }
68
69 @Override
Toshio Koided7d550c2014-08-21 16:08:55 -070070 public List<MatchActionOperations> compile(Operator op,
71 MatchActionIdGenerator maIdGenerator,
72 MatchActionOperationsIdGenerator maoIdGenerator) {
Toshio Koidea03915e2014-07-01 18:39:52 -070073 // TODO Auto-generated method stub
Toshio Koide9aa4c0f2014-08-11 16:06:44 -070074 return null;
Toshio Koidea03915e2014-07-01 18:39:52 -070075 }
76}