blob: b16287c171f68bfc088cffd9842b5ade48daecfd [file] [log] [blame]
Satish K2eb5d842017-04-04 16:28:37 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Satish K2eb5d842017-04-04 16:28:37 +05303 *
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 */
16package org.onosproject.bandwidthmgr.api;
17
18import org.onosproject.net.Link;
19import org.onosproject.net.LinkKey;
20
21import java.util.Set;
22
23public interface BandwidthMgmtService {
24
25
26 /**
27 * Allocate local bandwidth(non rsvp-te) to linkKey mapping.
28 *
29 * @param linkkey link key of the link
30 * @param bandwidth requested local bandwidth
31 * @return success or failure
32 */
33 boolean allocLocalReservedBw(LinkKey linkkey, Double bandwidth);
34
35
36 /**
37 * Release local bandwidth(non rsvp-te) to linkKey mapping.
38 *
39 * @param linkkey link key of the link
40 * @param bandwidth releasing local bandwidth
41 * @return success or failure
42 */
43 boolean releaseLocalReservedBw(LinkKey linkkey, Double bandwidth);
44
45 /**
46 * Get local allocated bandwidth of the link.
47 *
48 * @param linkkey link key of the link
49 * @return allocated bandwidth
50 */
51 Double getAllocatedLocalReservedBw(LinkKey linkkey);
52
53 /**
54 * Add unreserved bandwidth to linkKey mapping.
55 *
56 * @param linkkey link key of the link
57 * @param bandwidth set of unreserved bandwidth
58 * @return success or failure
59 */
60 boolean addUnreservedBw(LinkKey linkkey, Set<Double> bandwidth);
61
62 /**
63 * Remove unreserved bandwidth to linkKey mapping.
64 *
65 * @param linkkey link key of the link
66 * @return success or failure
67 */
68 boolean removeUnreservedBw(LinkKey linkkey);
69
70 /**
71 * Get list of unreserved Bandwidth of the link.
72 *
73 * @param linkkey link key of the link
74 * @return Set of unreserved bandwidth
75 */
76 Set<Double> getUnreservedBw(LinkKey linkkey);
77
78 /**
79 * Returns if the link has the available bandwidth or not.
80 *
81 * @param link link
82 * @param bandwidth required bandwidth
83 * @return true if bandwidth is available else false
84 */
85 boolean isBandwidthAvailable(Link link, Double bandwidth);
86
87 /**
88 * Returns Te cost for the specified link key.
89 *
90 * @param linkKey connect point of source and destination of the link
91 * @return Te cost for the linkKey
92 */
93 Double getTeCost(LinkKey linkKey);
94
95 /**
96 * Returns available bandwidth for the linkKey.
97 *
98 * @param linkKey connect point of source and destination of the link
99 * @return available bandwidth for the linkKey
100 */
101 Double getAvailableBandwidth(LinkKey linkKey);
102}