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