blob: 0a7fa9486eeeaeef31943da8a4882b79949bb3bf [file] [log] [blame]
Mahesh Poojary Sba827292016-05-09 11:31:12 +05301/*
2 * Copyright 2016-present 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 */
16package org.onosproject.pce.pcestore.api;
17
Priyanka Bbae0eeb12016-11-30 11:59:48 +053018import java.util.List;
19
Mahesh Poojary Sba827292016-05-09 11:31:12 +053020import org.onosproject.incubator.net.tunnel.TunnelId;
Mahesh Poojary Sba827292016-05-09 11:31:12 +053021import org.onosproject.net.resource.ResourceConsumer;
Priyanka Bbae0eeb12016-11-30 11:59:48 +053022import org.onosproject.pce.pceservice.ExplicitPathInfo;
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053023import org.onosproject.pce.pcestore.PcePathInfo;
Mahesh Poojary Sba827292016-05-09 11:31:12 +053024
25import java.util.Map;
26
27/**
28 * Abstraction of an entity providing pool of available labels to devices, links and tunnels.
29 */
30public interface PceStore {
31 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053032 * Checks whether tunnel id is present in tunnel info store.
33 *
34 * @param tunnelId tunnel id
35 * @return success of failure
36 */
37 boolean existsTunnelInfo(TunnelId tunnelId);
38
39 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053040 * Checks whether path info is present in failed path info list.
41 *
42 * @param failedPathInfo failed path information
43 * @return success or failure
44 */
45 boolean existsFailedPathInfo(PcePathInfo failedPathInfo);
46
47 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053048 * Retrieves the tunnel info count.
49 *
50 * @return tunnel info count
51 */
52 int getTunnelInfoCount();
53
54 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053055 * Retrieves the failed path info count.
56 *
57 * @return failed path info count
58 */
59 int getFailedPathInfoCount();
60
61 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053062 * Retrieves tunnel id and pcecc tunnel info pairs collection from tunnel info store.
63 *
Avantika-Huawei9e848e82016-09-01 12:12:42 +053064 * @return collection of tunnel id and resource consumer pairs
Mahesh Poojary Sba827292016-05-09 11:31:12 +053065 */
Avantika-Huawei9e848e82016-09-01 12:12:42 +053066 Map<TunnelId, ResourceConsumer> getTunnelInfos();
Mahesh Poojary Sba827292016-05-09 11:31:12 +053067
68 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053069 * Retrieves path info collection from failed path info store.
70 *
71 * @return collection of failed path info
72 */
73 Iterable<PcePathInfo> getFailedPathInfos();
74
75 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053076 * Retrieves local label info with tunnel consumer id from tunnel info store.
77 *
78 * @param tunnelId tunnel id
Avantika-Huawei9e848e82016-09-01 12:12:42 +053079 * @return resource consumer
Mahesh Poojary Sba827292016-05-09 11:31:12 +053080 */
Avantika-Huawei9e848e82016-09-01 12:12:42 +053081 ResourceConsumer getTunnelInfo(TunnelId tunnelId);
Mahesh Poojary Sba827292016-05-09 11:31:12 +053082
83 /**
84 * Stores local label info with tunnel consumer id into tunnel info store for specified tunnel id.
85 *
86 * @param tunnelId tunnel id
Avantika-Huawei9e848e82016-09-01 12:12:42 +053087 * @param tunnelConsumerId tunnel consumer id
Mahesh Poojary Sba827292016-05-09 11:31:12 +053088 */
Avantika-Huawei9e848e82016-09-01 12:12:42 +053089 void addTunnelInfo(TunnelId tunnelId, ResourceConsumer tunnelConsumerId);
Mahesh Poojary Sba827292016-05-09 11:31:12 +053090
91 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053092 * Stores path information into failed path info store.
93 *
94 * @param failedPathInfo failed path information
95 */
96 void addFailedPathInfo(PcePathInfo failedPathInfo);
97
98 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053099 * Removes local label info with tunnel consumer id from tunnel info store for specified tunnel id.
100 *
101 * @param tunnelId tunnel id
102 * @return success or failure
103 */
104 boolean removeTunnelInfo(TunnelId tunnelId);
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +0530105
106 /**
107 * Removes path info from failed path info store.
108 *
109 * @param failedPathInfo failed path information
110 * @return success or failure
111 */
112 boolean removeFailedPathInfo(PcePathInfo failedPathInfo);
Priyanka Bbae0eeb12016-11-30 11:59:48 +0530113
114 /**
115 * Adds explicit path info to the map with corresponding tunnel name.
116 *
117 * @param tunnelName tunnel name as key
118 * @param explicitPathInfo list of explicit path objects
119 * @return whether it is added to map
120 */
121 boolean tunnelNameExplicitPathInfoMap(String tunnelName, List<ExplicitPathInfo> explicitPathInfo);
122
123 /**
124 * Gets explicit path info based on tunnel name.
125 *
126 * @param tunnelName tunnel name as key
127 * @return list of explicit path info
128 */
129 List<ExplicitPathInfo> getTunnelNameExplicitPathInfoMap(String tunnelName);
Mahesh Poojary Sba827292016-05-09 11:31:12 +0530130}