Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Open Networking Laboratory |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Brian O'Connor | 6de2e20 | 2015-05-21 14:30:41 -0700 | [diff] [blame] | 16 | package org.onosproject.net.resource.link; |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 17 | |
| 18 | import java.util.Set; |
| 19 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 20 | import org.onosproject.net.Link; |
| 21 | import org.onosproject.net.intent.IntentId; |
Brian O'Connor | 6de2e20 | 2015-05-21 14:30:41 -0700 | [diff] [blame] | 22 | import org.onosproject.net.resource.ResourceAllocation; |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 23 | |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 24 | /** |
| 25 | * Manages link resources. |
Sho SHIMIZU | 364cbac | 2015-10-29 15:47:35 -0700 | [diff] [blame] | 26 | * |
| 27 | * @deprecated in Emu Release. |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 28 | */ |
Sho SHIMIZU | 364cbac | 2015-10-29 15:47:35 -0700 | [diff] [blame] | 29 | @Deprecated |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 30 | public interface LinkResourceStore { |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 31 | /** |
| 32 | * Returns free resources for given link. |
| 33 | * |
| 34 | * @param link a target link |
| 35 | * @return free resources for given link |
| 36 | */ |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 37 | Set<ResourceAllocation> getFreeResources(Link link); |
| 38 | |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 39 | /** |
| 40 | * Allocates resources. |
| 41 | * |
| 42 | * @param allocations resources to be allocated |
| 43 | */ |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 44 | void allocateResources(LinkResourceAllocations allocations); |
| 45 | |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 46 | /** |
| 47 | * Releases resources. |
| 48 | * |
| 49 | * @param allocations resources to be released |
Pavlin Radoslavov | 119fd5c | 2014-11-25 19:08:19 -0800 | [diff] [blame] | 50 | * @return the link resource event |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 51 | */ |
Ray Milkey | e97ede9 | 2014-11-20 10:43:12 -0800 | [diff] [blame] | 52 | LinkResourceEvent releaseResources(LinkResourceAllocations allocations); |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 53 | |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 54 | /** |
| 55 | * Returns resources allocated for an Intent. |
| 56 | * |
| 57 | * @param intentId the target Intent's ID |
Yuta HIGUCHI | 6593489 | 2014-12-04 17:47:44 -0800 | [diff] [blame] | 58 | * @return allocated resources or null if no resource is allocated |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 59 | */ |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 60 | LinkResourceAllocations getAllocations(IntentId intentId); |
| 61 | |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 62 | /** |
| 63 | * Returns resources allocated for a link. |
| 64 | * |
| 65 | * @param link the target link |
| 66 | * @return allocated resources |
| 67 | */ |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 68 | Iterable<LinkResourceAllocations> getAllocations(Link link); |
| 69 | |
Toshio Koide | 07df706 | 2014-10-30 10:54:25 -0700 | [diff] [blame] | 70 | /** |
| 71 | * Returns all allocated resources. |
| 72 | * |
| 73 | * @return allocated resources |
| 74 | */ |
Toshio Koide | 106d449 | 2014-10-28 11:22:02 -0700 | [diff] [blame] | 75 | Iterable<LinkResourceAllocations> getAllocations(); |
| 76 | } |