Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 1 | package net.onrc.onos.api.intent; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | import net.onrc.onos.api.batchoperation.BatchOperation; |
| 6 | import net.onrc.onos.api.batchoperation.IBatchOperationTarget; |
| 7 | import net.onrc.onos.api.flowmanager.IFlow; |
| 8 | |
| 9 | /** |
| 10 | * The base class for the connectivity abstraction. It allows applications to |
| 11 | * specify end hosts, apply some basic filtering to traffic, and constrain |
| 12 | * traffic. |
| 13 | * <p> |
| 14 | * This class is sub-classed to provide other intent types like shortest path |
| 15 | * connectivity and bandwidth constrained shortest path connectivity. |
| 16 | * <p> |
| 17 | * The reasoning behind "intent" is that the applications can provide some |
| 18 | * abstract representation of how traffic should flow be handled by the |
| 19 | * networking, allowing the network OS to compile, reserve and optimize the |
| 20 | * data-plane to satisfy those constraints. |
| 21 | */ |
| 22 | public abstract class Intent implements IBatchOperationTarget { |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 23 | protected final IntentId id; |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Constructor. |
| 27 | * |
| 28 | * @param id ID for this Intent object. |
| 29 | */ |
| 30 | public Intent(String id) { |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 31 | this.id = new IntentId(id); |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Gets ID for this Intent object. |
| 36 | * |
| 37 | * @return ID for this Intent object. |
| 38 | */ |
| 39 | @Override |
Toshio Koide | 025a915 | 2014-07-21 11:00:34 -0700 | [diff] [blame] | 40 | public IntentId getId() { |
Toshio Koide | a03915e | 2014-07-01 18:39:52 -0700 | [diff] [blame] | 41 | return id; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Compiles this Intent object to the list of FlowOperations. |
| 46 | * <p> |
| 47 | * All Intent object must implement this method and IntentRuntimeModule use |
| 48 | * this method to process this Intent. |
| 49 | * |
| 50 | * @return The list of FlowOperations of this Intent. |
| 51 | */ |
| 52 | public abstract List<BatchOperation<IFlow>> compile(); |
| 53 | } |