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 | d7d550c | 2014-08-21 16:08:55 -0700 | [diff] [blame] | 7 | import net.onrc.onos.api.flowmanager.FlowBatchOperation.Operator; |
| 8 | import net.onrc.onos.core.matchaction.MatchActionIdGenerator; |
Ray Milkey | 42ae1b5 | 2014-08-15 16:37:06 -0700 | [diff] [blame] | 9 | import net.onrc.onos.core.matchaction.MatchActionOperations; |
Toshio Koide | d7d550c | 2014-08-21 16:08:55 -0700 | [diff] [blame] | 10 | import net.onrc.onos.core.matchaction.MatchActionOperationsIdGenerator; |
Toshio Koide | d8b077a | 2014-08-13 10:47:21 -0700 | [diff] [blame] | 11 | import net.onrc.onos.core.matchaction.action.Action; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 12 | import net.onrc.onos.core.matchaction.match.PacketMatch; |
| 13 | import net.onrc.onos.core.util.PortNumber; |
| 14 | |
| 15 | /** |
Toshio Koide | 7894ca0 | 2014-08-15 14:30:13 -0700 | [diff] [blame] | 16 | * Flow object representing a packet path. |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 17 | * <p> |
| 18 | * TODO: Think this: Do we need a bandwidth constraint? |
| 19 | */ |
| 20 | public class PacketPathFlow extends PathFlow { |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame] | 21 | private final PacketMatch match; |
| 22 | private final int hardTimeout; |
| 23 | private final int idleTimeout; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Constructor. |
| 27 | * |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame] | 28 | * @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 Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 35 | */ |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame] | 36 | public PacketPathFlow(FlowId id, |
| 37 | PacketMatch match, PortNumber ingressPort, Path path, |
| 38 | List<Action> egressActions, |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 39 | int hardTimeout, int idleTimeout) { |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame] | 40 | super(id, ingressPort, path, egressActions); |
| 41 | this.match = checkNotNull(match); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 42 | 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 Koide | 5c5ca10 | 2014-08-19 00:49:52 -0700 | [diff] [blame] | 65 | public PacketMatch getMatch() { |
| 66 | return match; |
| 67 | } |
| 68 | |
| 69 | @Override |
Toshio Koide | d7d550c | 2014-08-21 16:08:55 -0700 | [diff] [blame] | 70 | public List<MatchActionOperations> compile(Operator op, |
| 71 | MatchActionIdGenerator maIdGenerator, |
| 72 | MatchActionOperationsIdGenerator maoIdGenerator) { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 73 | // TODO Auto-generated method stub |
Toshio Koide | 9aa4c0f | 2014-08-11 16:06:44 -0700 | [diff] [blame] | 74 | return null; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 75 | } |
| 76 | } |