Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -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 | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.resource; |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 17 | |
| 18 | import java.util.Collection; |
| 19 | import java.util.Set; |
| 20 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 21 | import org.onosproject.net.Link; |
| 22 | import org.onosproject.net.intent.Constraint; |
| 23 | import org.onosproject.net.intent.IntentId; |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Representation of a request for link resource. |
| 27 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 28 | public interface LinkResourceRequest extends ResourceRequest { |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * Returns the {@link IntentId} associated with the request. |
| 32 | * |
| 33 | * @return the {@link IntentId} associated with the request |
| 34 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 35 | IntentId intendId(); |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Returns the set of target links. |
| 39 | * |
| 40 | * @return the set of target links |
| 41 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 42 | Collection<Link> links(); |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Returns the set of resource requests. |
| 46 | * |
| 47 | * @return the set of resource requests |
| 48 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 49 | Set<ResourceRequest> resources(); |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Builder of link resource request. |
| 53 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 54 | interface Builder { |
| 55 | /** |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 56 | * Adds lambda request. |
| 57 | * |
| 58 | * @return self |
| 59 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 60 | public Builder addLambdaRequest(); |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * Adds bandwidth request with bandwidth value. |
| 64 | * |
| 65 | * @param bandwidth bandwidth value to be requested |
| 66 | * @return self |
| 67 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 68 | public Builder addBandwidthRequest(double bandwidth); |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 69 | |
| 70 | /** |
Thomas Vachuska | edc944c | 2014-11-04 15:42:25 -0800 | [diff] [blame] | 71 | * Adds the resources required for a constraint. |
| 72 | * |
| 73 | * @param constraint the constraint |
| 74 | * @return self |
| 75 | */ |
| 76 | public Builder addConstraint(Constraint constraint); |
| 77 | |
| 78 | /** |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 79 | * Returns link resource request. |
| 80 | * |
| 81 | * @return link resource request |
| 82 | */ |
Toshio Koide | 65e890f | 2014-10-23 12:02:25 -0700 | [diff] [blame] | 83 | public LinkResourceRequest build(); |
Toshio Koide | 569ca70 | 2014-10-23 11:37:44 -0700 | [diff] [blame] | 84 | } |
Toshio Koide | 485b478 | 2014-10-20 19:34:21 -0700 | [diff] [blame] | 85 | } |