blob: e305cea39f4453674ec92c6f999d0378cdd8b845 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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 Koidec9051db2014-10-20 15:18:37 -070016package org.onlab.onos.net.resource;
17
18import java.util.Set;
19
20/**
21 * Abstraction of a resources of a link.
22 */
23public 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}