blob: 3fdef156f3a42afe8fd458d348913e1f1f2a6d8a [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
Mahesh Poojary Sba827292016-05-09 11:31:12 +053018import org.onosproject.incubator.net.tunnel.TunnelId;
Mahesh Poojary Sba827292016-05-09 11:31:12 +053019import org.onosproject.net.resource.ResourceConsumer;
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053020import org.onosproject.pce.pcestore.PcePathInfo;
Mahesh Poojary Sba827292016-05-09 11:31:12 +053021
22import java.util.Map;
23
24/**
25 * Abstraction of an entity providing pool of available labels to devices, links and tunnels.
26 */
27public interface PceStore {
28 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053029 * Checks whether tunnel id is present in tunnel info store.
30 *
31 * @param tunnelId tunnel id
32 * @return success of failure
33 */
34 boolean existsTunnelInfo(TunnelId tunnelId);
35
36 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053037 * Checks whether path info is present in failed path info list.
38 *
39 * @param failedPathInfo failed path information
40 * @return success or failure
41 */
42 boolean existsFailedPathInfo(PcePathInfo failedPathInfo);
43
44 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053045 * Retrieves the tunnel info count.
46 *
47 * @return tunnel info count
48 */
49 int getTunnelInfoCount();
50
51 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053052 * Retrieves the failed path info count.
53 *
54 * @return failed path info count
55 */
56 int getFailedPathInfoCount();
57
58 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053059 * Retrieves tunnel id and pcecc tunnel info pairs collection from tunnel info store.
60 *
Avantika-Huawei9e848e82016-09-01 12:12:42 +053061 * @return collection of tunnel id and resource consumer pairs
Mahesh Poojary Sba827292016-05-09 11:31:12 +053062 */
Avantika-Huawei9e848e82016-09-01 12:12:42 +053063 Map<TunnelId, ResourceConsumer> getTunnelInfos();
Mahesh Poojary Sba827292016-05-09 11:31:12 +053064
65 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053066 * Retrieves path info collection from failed path info store.
67 *
68 * @return collection of failed path info
69 */
70 Iterable<PcePathInfo> getFailedPathInfos();
71
72 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053073 * Retrieves local label info with tunnel consumer id from tunnel info store.
74 *
75 * @param tunnelId tunnel id
Avantika-Huawei9e848e82016-09-01 12:12:42 +053076 * @return resource consumer
Mahesh Poojary Sba827292016-05-09 11:31:12 +053077 */
Avantika-Huawei9e848e82016-09-01 12:12:42 +053078 ResourceConsumer getTunnelInfo(TunnelId tunnelId);
Mahesh Poojary Sba827292016-05-09 11:31:12 +053079
80 /**
81 * Stores local label info with tunnel consumer id into tunnel info store for specified tunnel id.
82 *
83 * @param tunnelId tunnel id
Avantika-Huawei9e848e82016-09-01 12:12:42 +053084 * @param tunnelConsumerId tunnel consumer id
Mahesh Poojary Sba827292016-05-09 11:31:12 +053085 */
Avantika-Huawei9e848e82016-09-01 12:12:42 +053086 void addTunnelInfo(TunnelId tunnelId, ResourceConsumer tunnelConsumerId);
Mahesh Poojary Sba827292016-05-09 11:31:12 +053087
88 /**
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +053089 * Stores path information into failed path info store.
90 *
91 * @param failedPathInfo failed path information
92 */
93 void addFailedPathInfo(PcePathInfo failedPathInfo);
94
95 /**
Mahesh Poojary Sba827292016-05-09 11:31:12 +053096 * Removes local label info with tunnel consumer id from tunnel info store for specified tunnel id.
97 *
98 * @param tunnelId tunnel id
99 * @return success or failure
100 */
101 boolean removeTunnelInfo(TunnelId tunnelId);
Mahesh Poojary Sf920ec02016-05-17 23:16:09 +0530102
103 /**
104 * Removes path info from failed path info store.
105 *
106 * @param failedPathInfo failed path information
107 * @return success or failure
108 */
109 boolean removeFailedPathInfo(PcePathInfo failedPathInfo);
Mahesh Poojary Sba827292016-05-09 11:31:12 +0530110}