Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.resource; |
| 2 | |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 3 | import org.onlab.onos.net.Link; |
| 4 | import org.onlab.onos.net.intent.IntentId; |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 5 | |
| 6 | /** |
| 7 | * Service for providing link resource allocation. |
| 8 | */ |
| 9 | public interface LinkResourceService { |
| 10 | |
| 11 | /** |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 12 | * Requests resources. |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 13 | * |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 14 | * @param req resources to be allocated |
| 15 | * @return allocated resources |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 16 | */ |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 17 | LinkResourceAllocations requestResources(LinkResourceRequest req); |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 18 | |
| 19 | /** |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 20 | * Releases resources. |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 21 | * |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 22 | * @param allocations resources to be released |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 23 | */ |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 24 | void releaseResources(LinkResourceAllocations allocations); |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 27 | * Returns all allocated resources. |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 28 | * |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 29 | * @return allocated resources |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 30 | */ |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 31 | Iterable<LinkResourceAllocations> getAllocations(); |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 32 | |
Brian O'Connor | 55153ce | 2014-10-23 13:44:05 -0700 | [diff] [blame] | 33 | /** |
| 34 | * Returns the resources allocated for an Intent. |
| 35 | * |
| 36 | * @param intentId the target Intent's id |
| 37 | * @return allocated resources for Intent |
| 38 | */ |
Brian O'Connor | e7e4bd5 | 2014-10-23 13:36:23 -0700 | [diff] [blame] | 39 | LinkResourceAllocations getAllocation(IntentId intentId); |
| 40 | |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 41 | /** |
| 42 | * Returns all allocated resources to given link. |
| 43 | * |
| 44 | * @param link a target link |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 45 | * @return allocated resources |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 46 | */ |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 47 | Iterable<LinkResourceAllocations> getAllocations(Link link); |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 48 | |
| 49 | /** |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 50 | * Returns all IDs of intents using the given link. |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 51 | * |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 52 | * @param link a target link |
| 53 | * @return IDs of intents using the link |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 54 | */ |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 55 | Iterable<IntentId> getIntents(Link link); |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Returns available resources for given link. |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 59 | * |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 60 | * @param link a target link |
| 61 | * @return available resources for the target link |
| 62 | */ |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 63 | ResourceRequest getAvailableResources(Link link); |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 64 | } |