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 | */ |
Toshio Koide | c9051db | 2014-10-20 15:18:37 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.resource; |
| 17 | |
| 18 | import java.util.Set; |
| 19 | |
| 20 | /** |
| 21 | * Abstraction of a resources of a link. |
| 22 | */ |
| 23 | public interface LinkResources { |
| 24 | |
| 25 | /** |
| 26 | * Returns resources as a set of {@link LinkResource}s. |
| 27 | * |
| 28 | * @return a set of {@link LinkResource}s |
| 29 | */ |
| 30 | Set<LinkResource> resources(); |
| 31 | |
| 32 | /** |
| 33 | * Builder of {@link LinkResources}. |
| 34 | */ |
| 35 | public interface Builder { |
| 36 | |
| 37 | /** |
| 38 | * Adds bandwidth resource. |
| 39 | * <p> |
| 40 | * This operation adds given bandwidth to previous bandwidth and |
| 41 | * generates single bandwidth resource. |
| 42 | * |
| 43 | * @param bandwidth bandwidth value to be added |
| 44 | * @return self |
| 45 | */ |
| 46 | public Builder addBandwidth(double bandwidth); |
| 47 | |
| 48 | /** |
| 49 | * Adds lambda resource. |
| 50 | * |
| 51 | * @param lambda lambda value to be added |
| 52 | * @return self |
| 53 | */ |
| 54 | public Builder addLambda(int lambda); |
| 55 | |
| 56 | /** |
| 57 | * Builds an immutable link resources. |
| 58 | * |
| 59 | * @return link resources |
| 60 | */ |
| 61 | public LinkResources build(); |
| 62 | } |
| 63 | } |