blob: 43589c93ddcc42544b7d18413211726ac89558d5 [file] [log] [blame]
Satish K2eb5d842017-04-04 16:28:37 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-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.LinkKey;
19
20import java.util.Set;
21
22/**
23 * Abstraction of an entity providing pool of available labels to devices, links and tunnels.
24 */
25public interface BandwidthMgmtStore {
26
27 /**
28 * Allocate local bandwidth(non rsvp-te) to linkKey mapping.
29 *
30 * @param linkkey link key of the link
31 * @param bandwidth requested local bandwidth
32 * @return success or failure
33 */
34 boolean allocLocalReservedBw(LinkKey linkkey, Double bandwidth);
35
36
37 /**
38 * Release local bandwidth(non rsvp-te) to linkKey mapping.
39 *
40 * @param linkkey link key of the link
41 * @param bandwidth releasing local bandwidth
42 * @return success or failure
43 */
44 boolean releaseLocalReservedBw(LinkKey linkkey, Double bandwidth);
45
46 /**
47 * Get local allocated bandwidth of the link.
48 *
49 * @param linkkey link key of the link
50 * @return allocated bandwidth
51 */
52 Double getAllocatedLocalReservedBw(LinkKey linkkey);
53
54 /**
55 * Add unreserved bandwidth to linkKey mapping.
56 *
57 * @param linkkey link key of the link
58 * @param bandwidth set of unreserved bandwidth
59 * @return success or failure
60 */
61 boolean addUnreservedBw(LinkKey linkkey, Set<Double> bandwidth);
62
63 /**
64 * Remove unreserved bandwidth to linkKey mapping.
65 *
66 * @param linkkey link key of the link
67 * @return success or failure
68 */
69 boolean removeUnreservedBw(LinkKey linkkey);
70
71 /**
72 * Get list of unreserved Bandwidth of the link.
73 *
74 * @param linkkey link key of the link
75 * @return Set of unreserved bandwidth
76 */
77 Set<Double> getUnreservedBw(LinkKey linkkey);
78
79 /**
80 * Returns Te cost for the specified link key.
81 *
82 * @param linkKey connect point of source and destination of the link
83 * @return Te cost for the linkKey
84 */
85 Double getTeCost(LinkKey linkKey);
86}